S_SKIN

From SRB2 Wiki
Jump to navigation Jump to search

S_SKIN is a special text lump that is used to define a playable character skin for SRB2. It determines the name of the skin and various attributes for the character itself, e.g., abilities, movement speeds and items spawned. The lump itself also acts as a starting marker for the character's sprites, which must immediately follow it within a WAD or PK3 file.

The name of this lump is partially flexible – the game will only check if the lump's name starts with "S_SKIN" in order for it to be recognised as the definition of a new skin. Anything can be used after these first six characters, e.g., S_SKIN1, S_SKIN2, and S_SKINAB are all acceptable alternatives to S_SKIN as the lump name.

Format

The format of text within S_SKIN is very similar to that of a SOC lump – it consists of a list of parameters and their values. Most text (with the exception of realname) in the S_SKIN lump is not case-sensitive, e.g., the parameter "hudname" could also be written as "HUDNAME", "HudName" or even "hUdNaMe".

When placed at the start of a line, the # (number sign, or hash) symbol is used to signify the start of a comment, just as in SOCs. However, comment lines can also be started by placing two forward slashes (//) at the start of a line.

The following is a typical example of what an S_SKIN lump looks like:

name = Idreia
ability = CA_DOUBLEJUMP
ability2 = CA2_NONE
normalspeed = 36
thrustfactor = 3
accelstart = 112
acceleration = 42
startcolor = 200
prefcolor = Azure
jumpfactor = 1

Note that you don't have to supply all parameters available for S_SKIN (see below), or even anything at all (though this is not recommended). Any parameters that are left out will be set to default values, which are listed below.

Parameters

name

Default: skin [number]

The unique name of the skin, for identification purposes internally. It is used with the skin console variable and will always be used and displayed in all lowercase. Spaces are not allowed; use underscores instead. If another skin of the same name is added to the game, the game will automatically add a number to the end of the latter skin's name. To avoid this, ensure that your skin name is unique, for example by adding by your own username or an abbreviation of it to the end.

Example: name = shadow

flags

Default: 0

Determines the skin flags given to the skin – these are a series of toggles that determine whether certain traits available for a character are applied. These are listed in the table below. Alternatively, flags can be given individually using their parameters. For example, super = true is an alternative way of giving a character the SF_SUPER flag.

Decimal Hexadecimal Flag name Parameter Description
1 0x00001 SF_SUPER super The character can turn Super in Single Player/Coop after collecting all Chaos Emeralds. Used by Sonic, Knuckles and Metal Sonic in unmodified SRB2.
2 0x00002 SF_NOSUPERSPIN nosuperspin The character's Super form will use standing, walking or running animations, instead of the normal spinning animation, when jumping, spindashing or otherwise rolling on the ground. This replicates the old Super Sonic animations in versions of SRB2 before v1.09.4.
4 0x00004 SF_NOSPINDASHDUST nospindashdust The character does not create dust particles when charging a spindash.
8 0x00008 SF_HIRES hires The character's sprites will be rendered at a different scale, which is set by the highresscale parameter. This allows you to use high-resolution (or low-resolution) sprites for your character.
16 0x00010 SF_NOSKID noskid The character does not display skid particles and play the skidding sound when braking or making sharp turns.
32 0x00020 SF_NOSPEEDADJUST nospeedadjust The character's animations will not be automatically adjusted according to the player's speed, for example when Sonic's walking animation speeds up as he walks faster. Instead, the animations will use the default state durations as set in the player's states.
64 0x00040 SF_RUNONWATER runonwater Allows the character to run on top of water and goop FOFs.
128 0x00080 SF_NOJUMPSPIN nojumpspin The character will not curl up into a ball when jumping. They will use a falling state when going down, and their height will not be reduced. If the character does not have dedicated jump frames, then they will also use spring frames instead of rolling frames. Used by Fang and Amy in unmodified SRB2.
256 0x00100 SF_NOJUMPDAMAGE nojumpdamage This character cannot damage enemies by jumping in them from any angle. Used by Fang and Amy in unmodified SRB2.
512 0x00200 SF_STOMPDAMAGE stompdamage This character will always be able to damage enemies by landing on them, regardless of their vulnerability.
768 0x00300 SF_MARIODAMAGE mariodamage This character cannot damage enemies from any angle, but they can still land on enemies. This is equivalent to combining SF_NOJUMPDAMAGE and SF_STOMPDAMAGE.
1024 0x00400 SF_MACHINE machine This character is considered a "robot". While dying, they will spawn explosion effects. While underwater or in space, this character will get unique drowning numbers, sound effects, and electric short-out particle effects. Used by Metal Sonic in unmodified SRB2.
2048 0x00800 SF_DASHMODE dashmode This character will have the "Boost Mode" ability, giving them increased top speed and jump height the longer they run without losing speed. When paired with SF_MACHINE, Boost Mode will also be able to damage enemies and destroy spikes. Used by Metal Sonic in unmodified SRB2.
4096 0x01000 SF_FASTEDGE fastedge This character's edge teeter animation will play faster than usual. Used by Fang in unmodified SRB2.
8192 0x02000 SF_MULTIABILITY multiability This character's primary ability can be used more than once per jump. Used by Metal Sonic in unmodified SRB2.
16384 0x04000 SF_NONIGHTSROTATION nonightsrotation The character's NiGHTS Mode sprites will not use automatic sprite rotation.
32768 0x08000 SF_NONIGHTSSUPER nonightssuper The character's NiGHTS Mode sprites will not use super color gradients. (The skin must also have SF_SUPER for this flag to work.)
65536 0x10000 SF_NOSUPERSPRITES nosupersprites The character will not use super sprites while super.
131072 0x20000 SF_NOSUPERJUMPBOOST nosuperjumpboost The character will not receive a jump boost while super. Used by Knuckles in unmodified SRB2.
262144 0x40000 SF_CANBUSTWALLS canbustwalls The character can naturally bust strong walls on contact.
524288 0x80000 SF_NOSHIELDABILITY noshieldability The character will not be able to use shield abilities. This will also prevent the Attraction Shield's target indicator from appearing.

The skin flags are stored in an integer value where each bit represents a flag, i.e., 0 means "disabled" and 1 means "enabled". To set several flags at once, they must be combined with the bitwise OR operator (|).

Example: flags = SF_SUPER|SF_HIRES|SF_NOSKID

hudname

Default: ???

The name of the character displayed next to the life icon on the HUD. It is recommended to keep this name short so that it fits above the lives counter. If this parameter is not supplied, the name defaults to the value given by realname if it is set, or otherwise by name.

Example: hudname = SHADOW

realname

Default: Someone

The "real" name of the character displayed by the game in general, e.g., on intermission screens, the multiplayer character select screen, etc. This is not required to be a unique name, unlike with name. If this parameter is not supplied, the name defaults to the value given by hudname if it is set, or otherwise by name.

Example: realname = Shadow

ability

Default: CA_NONE

The character's primary special ability, such as Sonic's thok, or Tails's flying ability. It is usually activated by pressing the jump button a second time in mid-air after jumping. Only one ability may be selected; they cannot be combined. The values possible are as follows:

Value Name Ability Description
0 CA_NONE No ability The character will not have a special ability. This is the default setting when this parameter is not supplied.
1 CA_THOK Speed thok Sonic's default ability, loosely based on Sonic's air dash attack from Sonic Adventure. Pressing jump a second time in mid-air will thrust the player forward at a speed determined by actionspd.
2 CA_FLY Flying Tails' default ability, based on Tails' flight ability from Sonic 3. Pressing jump a second time in mid-air will make the player start flying in mid-air – repeatedly pressing jump afterwards will allow the player to fly further upwards. However, the player can only fly for a limited amount of time (determined by TailsFlyTics in the MainCfg block, which is 8 seconds by default); afterwards, they will slowly descend to the ground. The speed at which the player moves upwards or downwards when flying is determined by actionspd.

Other notes about flying:

  • The player's top speed is reduced when flying, but acceleration is increased to compensate.
  • The spin button can be used to descend more quickly if necessary.
  • The player will be unable to inflict damage to enemies, except by flying into them from below.

Sprite name FLY_ is used for the flying animation, sprite name SWIM is used when flying underwater, and sprite name TIRE is used when the character is tired and cannot fly anymore. If the player does not have a FLY_ sprite, SPNG is used instead.

3 CA_GLIDEANDCLIMB Gliding and climbing Knuckles' default ability, based on Knuckles' abilities (gliding, climbing and rock smashing) from Sonic & Knuckles. Pressing jump a second time in mid-air will make the player start a glide – the player will accelerate forward from a starting speed determined by actionspd for as long as the jump button is held down. However, the player will gradually lose height while doing so. The player will be able to damage all enemies by aiming their glide into them while using this ability. When landing on the ground from gliding, the player will skid to a halt in the glide animation. When releasing a glide, the player will lose momentum and go into a landing animation. As of 2.2.5, if the player is underwater, they will swim rather than glide. Swimming is slower than gliding but it provides more horizontal control.

If the player glides into a wall, they will latch onto it and can climb up, down or sideways on it, as well as climb over to adjacent walls. If the player is climbing, pressing jump will make them jump off and face away from the wall; pressing spin will make them jump off while still facing the wall. However, not all walls are climbable; some linedefs may have Flag [6] / Not Climbable checked, which prevents characters with this ability from climbing it. Any walls that are part of the sky will also not be climbable regardless of linedef flags.

Additionally, characters with this ability will be able to destroy all types of bustable FOFs on touch, rather than needing to spin into them. Bustable FOFs that have the FF_KNUXONLY flag set can be destroyed by characters with this ability.

Sprite name GLID is used for the gliding animation, SWIM is used for swimming, sprite name CLNG is used for attaching to a wall without moving, sprite name CLMB is used for the climbing animation and sprite name LAND is used for the landing animation. If the player does not have a GLID or SWIM sprite, FLY_ (or if not that, SPNG) is used instead; SPIN replaces CLNG, CLMB, and LAND if the player does not have one of those sprites.

4 CA_HOMINGTHOK Homing attack A weakened version of the speed thok ability, but with the addition of a homing attack feature similar to that in Sonic Adventure and beyond – if an enemy, spring or monitor is close enough to the player when triggering the ability, an arrow will appear over the target Object and the player will home in towards it until they touch/destroy it. If the character fails to reach the Object within 3 seconds, the homing attack is automatically canceled. Unlike the thok, this ability does not keep the player in their spin state and instead switches to their FALL sprite unless they are performing a homing attack, again like in Sonic Adventure.
5 CA_SWIM Swimming Similar to the flying ability, except this ability will work only underwater; attempting to use this ability outside of water will do nothing. Unlike flight, however, the ability can be used indefinitely while underwater.

Sprite name SWIM is used while using this ability. If the player does not have a SWIM sprite, SPNG is used instead.

6 CA_DOUBLEJUMP Double jump Pressing jump a second time in mid-air will make the player perform a second jump.
7 CA_FLOAT Hovering Metal Sonic's default ability. Pressing jump a second time in mid-air and holding the button down will allow the player to hold their vertical position in mid-air continuously, but without spinning. While moving slowly, they will slowly fall over time.
8 CA_SLOWFALL Hovering with slow descent Pressing jump a second time in mid-air and holding the button down will cause the player to fall downwards at a slower rate than normal, again without spinning. This is similar to E-102 Gamma's booster powerup from Sonic Adventure. The falling speed is fixed and cannot be adjusted with the actionspd parameter.
9 CA_TELEKINESIS Telekinesis Pressing the jump button a second time in mid-air will push enemies and players within a radius of 384 fracunits around the player away; pressing the spin button in mid-air will pull them closer instead. The thrust of the pushing/pulling is determined by actionspd.
10 CA_FALLSWITCH Fall switch Reverses the player's vertical momentum when pressing jump a second time in mid-air, thrusting them in the opposite direction instead.
11 CA_JUMPBOOST Jump boost The player's jump strength increases with the player's running speed – the faster the player moves, the higher they can jump. actionspd is used as a multiplier for the jump boost given. Pressing the jump button in mid-air has no effect.
12 CA_AIRDRILL Air drill Pressing jump a second time in mid-air will initiate an air drill, thrusting the player forward and upward. The player will fly upwards in an arc, eventually finishing the drill when the player starts falling down to the ground. Holding the spin button while drilling will cause the player to descend more quickly. actionspd is used as an angular speed for the drill – the higher the value is, the steeper and quicker the player's ascent will be.
13 CA_JUMPTHOK Jump-thok A hybrid between the thok and the double jump, which thrusts the player both forward and upward. As with the regular thok, actionspd determines the horizontal thrust.
14 CA_BOUNCE Tail bounce Fang's default ability. Pressing jump a second time and holding it lets you bounce high off of enemies and on any hazards, similar to Scrooge McDuck's ability from DuckTales.

Uses sprite name BNCE while in the air, and sprite name LAND during the pause when hitting the ground. If the player does not have a BNCE sprite, FALL is used instead; if the player does not have a LAND sprite, SPIN is used instead.

15 CA_TWINSPIN Spin attack Amy's default ability. Lets you roll up temporarily, allowing you to damage enemies, get a boost from springs, and break spikes, by timing a second jump press. This ability will also occur when you press jump and spin without a shield. Bustable FOFs that have the FF_KNUXONLY flag set (aka the "Strong Characters Only" checkbox for bustable FOF linedefs in Zone Builder) can be destroyed by characters with this ability.

Uses sprite name TWIN for this ability; if the player does not have a TWIN sprite, SPIN is used.

Example: ability = CA_THOK

ability2

Default: CA2_SPINDASH

The character's secondary special ability. Only one of these may be selected; they cannot be combined. The values possible are as follows:

Value Name Ability Description
0 CA2_NONE No ability The player will not have a secondary special ability.
1 CA2_SPINDASH Spindash The default secondary ability, which is used by Sonic, Tails, Knuckles, and Metal Sonic. The player can use the Spin control to charge a spindash, or otherwise spin on the ground while moving.
2 CA2_GUNSLINGER Gunslinger The secondary ability used by Fang. This character will get an arrow hovering over enemies and monitors. Pressing the Spin control while not moving will put the character in their firing animation and shoot their revitem toward the target.
3 CA2_MELEE Melee attack The secondary ability used by Amy. This character will do a small hop and damage any enemies from the front when they press the Spin control on the ground. Bustable FOFs that have the FF_KNUXONLY flag set can be destroyed by characters with this ability.

The parameters mindash and maxdash control the vertical and horizontal thrust of the hop, respectively.

Example: ability2 = CA2_SPINDASH

actionspd

Default: 30

The speed value of the character's primary special ability. For most abilities, it determines how fast the character will move while performing the special ability, but the specific effect depends on the ability. It is possible to supply negative values for this parameter, which will generally make the ability work in reverse. For example, the thok becomes reversed and sends the player backwards, flight and swim become unable to rise and are turned into a slow fall that gradually becomes faster and can't hurt enemies, and glide becomes a backwards glide that cannot climb walls.

Example: actionspd = 20
Defaults:
  • Sonic – 60
  • Tails – 100
  • Knuckles – 25
  • Metal Sonic – 60

mindash

Default: 15

Defines the minimum speed at which the character can spin at after charging a spindash.

Example: mindash = 15

maxdash

Default: 70

Defines the maximum speed at which the character can spin at after charging a spindash. Setting this to 0 will cause the player to spin in place after releasing a spindash.

Example: maxdash = 90

normalspeed

Default: 36

The character's normal top speed before friction is applied. A player can always reach this speed in the air, but their effective top speed on the ground will typically be lower. For example, a normalspeed of 36 results in a ground speed of 32 under default friction. The discrepancy worsens at higher speed values.

This stat is multiplied by five thirds when Super or when using Super Sneakers and it is halved when flying or while underwater. Is set to the default for every character in base SRB2.

Example: normalspeed = 32

runspeed

Default: 28

Defines at which speed the character starts going into their running animation. This value can be higher than the character's normalspeed. For example, in v1.09.4 and older, Tails could only enter his running animation by using Super Sneakers.

Example: runspeed = 30

thrustfactor

Default: 5

Part of the player's acceleration, which is calculated as follows: thrustfactor * (accelstart + speed * acceleration). This means that thrustfactor is a factor applied to the whole acceleration value regardless of how fast the player is currently moving. Is set to the default for every character in base SRB2.

Example: thrustfactor = 3

accelstart

Default: 96

The speed-independent part of the player's acceleration. The acceleration is calculated as follows: thrustfactor * (accelstart + speed * acceleration). This means that accelstart determines how fast the player accelerates when they start moving from a standstill. As the player gains speed, the acceleration increases further by the factor determined by acceleration. Is set to the default for every character in base SRB2.

Example: accelstart = 128

acceleration

Default: 40

The speed-dependent part of the player's acceleration. The acceleration is calculated as follows: thrustfactor * (accelstart + speed * acceleration). This means that acceleration determines how much the player's acceleration increases as they gain more speed. Is set to the default for every character in base SRB2.

Example: acceleration = 40

startcolor

Default: 96

Specifies the range of colors in the palette on the character's sprites that can be changed in multiplayer modes. This is a range of 16 colors, starting from the palette color index specified by this parameter. See List of skin colors for more information.

Example: startcolor = 192

prefcolor

Default: Green

Specifies the default skin color for the character. Only the color names listed below can be used unless you are defining a prefcolor for a custom character; numbers are not accepted. This is required for Single Player, where the character's color cannot be changed by the player. The possible values are as follows:

White Bone Cloudy Grey Silver Carbon Jet Black Aether Slate Bluebell Pink
Yogurt Brown Bronze Tan Beige Moss Azure Lavender Ruby Salmon Red Crimson
Flame Ketchup Peachy Quail Sunset Copper Apricot Orange Rust Gold Sandy Yellow
Olive Lime Peridot Apple Green Forest Emerald Mint Seafoam Aqua Teal Wave
Cyan Sky Cerulean Icy Sapphire Cornflower Blue Cobalt Vapor Dusk Pastel Purple
Bubblegum Magenta Neon Violet Lilac Plum Raspberry Rosy
Example: prefcolor = Black

supercolor

Default: Gold

Specifies the default skincolor for the character's Super form. Only the color names listed below can be used unless you are defining a supercolor for a custom character; numbers are not accepted. The possible values are as follows:

Silver Red Orange Gold Peridot Sky Purple Rust Tan
Example: supercolor = Tan

prefoppositecolor

Default: N/A

This specifies the skincolor for the character's signpost background, when you're using their prefcolor. Omitting this option, or using another color in multiplayer, will use the pre-defined opposite color for their skincolor. Only the color names listed below can be used unless you are defining a prefoppositecolor for a custom character; numbers are not accepted. The possible values are as follows:

White Bone Cloudy Grey Silver Carbon Jet Black Aether Slate Bluebell Pink
Yogurt Brown Bronze Tan Beige Moss Azure Lavender Ruby Salmon Red Crimson
Flame Ketchup Peachy Quail Sunset Copper Apricot Orange Rust Gold Sandy Yellow
Olive Lime Peridot Apple Green Forest Emerald Mint Seafoam Aqua Teal Wave
Cyan Sky Cerulean Icy Sapphire Cornflower Blue Cobalt Vapor Dusk Pastel Purple
Bubblegum Magenta Neon Violet Lilac Plum Raspberry Rosy
Example: prefoppositecolor = Red

jumpfactor

Default: 1.0

Sets the jump strength, measured as a factor of the default jump strength. The default setting is 1.0 (100% jump strength), while Knuckles uses 0.85 (85% jump strength), Fang uses 1.1 (110% jump height), and Amy uses 1.135 (113.5% jump height).

Example: jumpfactor = 1.0

radius

Default: 16

Sets the character's hitbox radius.

Example: radius = 32

height

Default: 48

Sets the character's hitbox height. Fang has this set to 60.

Example: height = 96

spinheight

Default: 32

Sets the character's hitbox height while they are in the rolling/spinning state.

Example: spinheight = 8

shieldscale

Default: 1.0

Changes the size of the sprites of any shields on the player. Knuckles has this set to 1.1 (110% scale), and Fang has this set to 1.2 (120% scale).

Example: shieldscale = 0.9

camerascale

Default: 1.0

Changes the scaling of the camera positioning. This can be useful for smaller or bigger characters.

Example: camerascale = 0.5

highresscale

Default: 0.5

If the skin flag SF_HIRES is set, this parameter is used to set the scale at which the skin's sprites are drawn. Values between 0 and 1 allow you to shrink high-resolution sprites to show more detail, and values above 1 will upscale low-resolution sprites. The default value is 0.5, which renders sprites at half their regular dimensions. Note that this does not affect the character's overall size, only the resolution at which the sprites are drawn.

Example: highresscale = 0.5

thokitem

Default: -1

Sets the Object type of the Object that is spawned when the player thoks (or performs a similar special ability like homing attack or air drill). The default value is -1, which sets the Object type to MT_THOK, the translucent speed trail left behind by Sonic.

Example: thokitem = MT_THOK

spinitem

Default: -1

Sets the Object type of the Object that is spawned when the player spindashes or spins on the ground. The default value is -1, which sets the Object type to MT_THOK, the translucent speed trail left behind by Sonic, Tails and Knuckles.

Example: spinitem = MT_THOK

revitem

Default: -1

Sets the Object type of the Object that is spawned when the players charges a spindash. The default value is -1, which sets the Object type to MT_NULL. In previous versions, this was MT_THOK.

Example: revitem = MT_THOK

followitem

Default: 0

Sets the Object type of the Object that is always spawned when using the character. Tails sets this to MT_TAILSOVERLAY, while Metal Sonic uses MT_METALJETFUME. 0 will have no following object.

Example: followitem = MT_TAILSOVERLAY

contspeed

Default: 17

Changes the speed of the CNT1 and CNT4 animations on the Continue screen animation. This is set to 7 for Tails, and 4 for Amy, Fang and Metal Sonic.

Example: contspeed = 20

contangle

Default: 0

Sets the sprite angle to use initially on the Continue screen animation. This is set to 3 for Sonic, 7 for Knuckles, and 1 for Amy and Metal Sonic.

Example: contangle = 4

availability

Default: 0

Sets the Unlockable entry required to be achieved to play as this character. If set to 0, this character will be playable from the start. Characters who are unlockable will not appear in the log file as "added" when the file they are in is loaded.

Example: availability = 1

Custom sounds

As an optional feature, the S_SKIN lump is capable of replacing specific sounds (e.g., jumping, spinning, spilling rings) with alternative sounds exclusively for the corresponding character (i.e., the sound will be unchanged when played for other characters). The sounds to play can be located in any WAD or PK3 file loaded by SRB2, including existing sounds from srb2.pk3, sounds from another external file, or (most frequently) custom sounds provided in the file containing the character and S_SKIN lump itself. The new sound(s) will not take up any sound freeslots.

The S_SKIN lump defines custom sounds for a character by referring to the lump names of the original sound and the sound to replace it, such as in the example displayed below:

dsthok = dsmythok

This will cause any instance of the sound sfx_thok (lump name DSTHOK) to be replaced by a sound whose lump name is DSMYTHOK whenever the sound is played by the character defined in the S_SKIN.

Below is the full list of sounds that can have character-specific replacement sounds through a character's S_SKIN – any other sounds besides these will not be accepted in the S_SKIN:

Lump name Sound name Description
DSSPIN sfx_spin Sound made when going into a spin while moving
DSPUTPUT sfx_putput Tails flying
DSPUDPUD sfx_pudpud Tails exhausted from flying
DSTHOK sfx_thok Sonic thokking
DSSPNDSH sfx_spndsh Spindash charge
DSZOOM sfx_zoom Spindash release
DSGASP sfx_gasp Grabbing an air bubble
DSJUMP sfx_jump Jumping
DSSKID sfx_skid Skidding
DSALTOW1 sfx_altow1 Pain taunts #1–#4 1. Used when losing rings.
DSALTOW2 sfx_altow2
DSALTOW3 sfx_altow3
DSALTOW4 sfx_altow4
DSVICTR1 sfx_victr1 Victory taunts #1–#4 1. Used in ringslinger when

getting a kill or tagging somebody.

DSVICTR2 sfx_victr2
DSVICTR3 sfx_victr3
DSVICTR4 sfx_victr4
DSALTDI1 sfx_altdi1 Death taunts #1–#4 1. Used upon player death

(excluding drowning).

DSALTDI2 sfx_altdi2
DSALTDI3 sfx_altdi3
DSALTDI4 sfx_altdi4

1 Whenever a taunt is used, the game will randomly select one of the four taunt sounds to play. If you want to increase the chances of playing a specific sound compared to the others, place the same sound in more than one slot. If you want to use one taunt sound, place it in all four taunt slots.

Patching existing skins

By giving your lump the P_SKIN name instead, you can edit an existing skin. The name field will be used as the skin to modify, every other field (with the exception of availability) will modify it. Any missing fields will use the setting that was already there.

Example:

name = tails
realname = Miles
hudname = MILES

Related links