S_SKIN

From SRB2 Wiki
Jump to: navigation, 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 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. Text in the S_SKIN lump is not case-sensitive, e.g., the parameter "facename" could also be written as "FACENAME", "FaceName" or even "FaCeNaMe".

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
face = IDRALIFE
ability = CA_DOUBLEJUMP
ability2 = CA2_NONE
normalspeed = 36
thrustfactor = 3
accelstart = 112
acceleration = 42
startcolor = 200
prefcolor = Steel_Blue
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 = metalsonic

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.

Decimal Hexadecimal Flag name Description
1 0x01 SF_SUPER The character can turn Super in Single Player/Coop after collecting all Chaos Emeralds. Used only by Sonic in unmodified SRB2.
2 0x02 SF_SUPERANIMS The character uses the designated special ability animations (frames U–Z) for the character's Super form, much like Sonic does. This does not include the Super transformation, which has been separated and no longer requires this flag. If this flag is not set, the normal character animations are used while Super.

If set, then frames U and V are used for Super standing, frames W and X are used for Super running, frame Y is used for teetering on an edge, and frame Z is used for getting hurt while Super.

4 0x04 SF_SUPERSPIN The character's Super form will use the normal spinning animations when jumping, spindashing or otherwise rolling on the ground. If this flag is not set, the character will instead use standing, walking or running animations when performing these actions, as Super Sonic himself did in versions of SRB2 before v1.09.4.

This flag's effects are relevant only if SF_SUPERANIMS is also set; without it, its effects are redundant as the character's Super form will be able to use spinning animations regardless of whether this flag is set or not. If the character does not have ability2 set to CA2_SPINDASH, this flag is mostly irrelevant since the character will only use the spinning animations when forced to, for example in zoom tubes.

8 0x08 SF_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 sprites for your character.
16 0x10 SF_NOSKID The character does not display skid particles and play the skidding sound when braking or making sharp turns.
32 0x20 SF_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 0x40 SF_RUNONWATER Allows the character to run on top of water and goop FOFs.

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_SUPERANIMS|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 = METAL

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 = Metal_Sonic

charsel

Default: CHRSONIC

The lump name for the character portrait displayed for the character in Single Player's character select screen and the Record Attack screen. This image must be exactly 128×128 pixels in size, or 256×256 for high resolution. Although the value is not case-sensitive (e.g., values "CHRMETAL", "chrmetal", and "ChRmEtAl" all point to the lump "CHRMETAL"), it's highly recommended to write the name in all-caps to match the name of the lump. XWE automatically gives this lump offsets, but it should not have any.

Example: hudname = CHRMETAL

face

Default: MISSING

The lump name for the life icon used for the character. The life icon is a 32×32 pixel picture shown at the bottom-left of the screen as part of the HUD. Although the value is not case-sensitive (e.g., values "METALIFE", "metalife", and "MeTaLiFe" all point to the lump "METALIFE"), it's highly recommended to write the name in all-caps to match the name of the lump. XWE automatically gives this lump offsets, but it should not have any.

Example: face = METALIFE

superface

Default: MISSING

The lump name for the character's life icon when they turn Super. If this parameter is not supplied, the character's regular icon as supplied by face is used instead. Although the value is not case-sensitive (e.g., values "METALSUP", "metalsup", and "MeTaLsUp" all point to the lump "METALSUP"), it's highly recommended to write the name in all-caps to match the name of the lump. XWE automatically gives this lump offsets, but it should not have any.

Example: superface = METALSUP

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 Ability Description
CA_NONE No ability The character will not have a special ability. This is the default setting when this parameter is not supplied.
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.
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.

Frames U and V are used for the flying animation, and frames W–Z are used when the character is tired and cannot fly anymore.

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 that touch them while using this ability. When landing on the ground from gliding, the player will skid to a halt.

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 the Not Climbable flag 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 only be destroyed by characters with this ability.

Frames U and V are used for the gliding animation, frame W is used for attaching to a wall without moving, and frames X–Z are used for the climbing animation.

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, the player will home in towards the target Object until they touch/destroy it. If the character fails to reach the Object within 3 seconds, the homing attack is automatically cancelled.
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. Characters with this ability also automatically have the ability to run on water.
CA_DOUBLEJUMP Double jump Pressing jump a second time in mid-air will make the player perform a second jump.
CA_FLOAT Floating 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, similarly to Super Sonic's own floating ability but without the limitation of needing to move while doing so.
CA_SLOWFALL Floating 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. 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.
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.
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.
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.
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.
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.
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 Ability Description
CA2_NONE No ability The player will not have a secondary special ability. The player will jump with the springing/falling animation frames (P, `, and lowercase a).
CA2_SPINDASH Spindash The default secondary ability, which is used by Sonic, Tails and Knuckles. The player can use the Spin control to charge a spindash, or otherwise spin on the ground while moving. The player will also jump with the spinning animation (frames L–O).
CA2_MULTIABILITY Multiability Changes how the player's primary special ability (which is set by ability) works. In most cases, it allows the special ability to be used more than once per jump, but for some abilities it has other effects instead:
  • CA_FLY/CA_SWIMSonic Adventure-style flight: The character can fly upwards by holding down the jump button instead of pressing it repeatedly. Note that the overall strength of this is stronger than normal flight, so actionspd should be adjusted accordingly.
  • CA_DOUBLEJUMP – Increases the character's jump strength, instead of allowing repeated use of the ability per jump.
  • CA_FLOAT/CA_SLOWFALL – Increases the character's jump strength, in addition to allowing repeated use of the ability per jump.
  • CA_JUMPBOOST – Doubles the jump strength increase given to the character.

The player will jump with the springing/falling animation frames (P, `, and lowercase a).

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

mindash

Default: 15

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

Example: mindash = 15

maxdash

Default: 90

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 running speed. The top speed is doubled when Super or when using Super Sneakers and it is halved when flying or while underwater.

Example: normalspeed = 32
Defaults:
  • Sonic – 36
  • Tails – 32
  • Knuckles – 34

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.

Example: thrustfactor = 3
Defaults:
  • Sonic – 5
  • Tails – 3
  • Knuckles – 4

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.

Example: accelstart = 128
Defaults:
  • Sonic – 96
  • Tails – 192
  • Knuckles – 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.

Example: acceleration = 40
Defaults:
  • Sonic – 40
  • Tails – 50
  • Knuckles – 45

startcolor

Default: 160

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. This is required for Single Player, where the character's color cannot be changed by the player. The possible values are as follows:

White Silver Grey Black Cyan Teal Steel_Blue Blue Peach Tan Pink Lavender Purple Orange Rosewood Beige Brown Red Dark_Red Neon_Green Green Zim Olive Yellow Gold
Example: prefcolor = Blue

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).

Example: jumpfactor = 1.0

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. This allows you to use high-resolution sprites that show more detail. The default value is 0.5, which causes the sprites to be drawn at half-scale, allowing them to be twice as large. 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_THOK, the translucent speed trail left behind by Sonic, Tails and Knuckles.

Example: revitem = MT_THOK

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 file loaded by SRB2, including existing sounds from srb2.srb, sounds from another external file, or (most frequently) custom sounds provided in the WAD 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
DSALTOW2 sfx_altow2
DSALTOW3 sfx_altow3
DSALTOW4 sfx_altow4
DSVICTR1 sfx_victr1 Victory taunts #1–#4 1
DSVICTR2 sfx_victr2
DSVICTR3 sfx_victr3
DSVICTR4 sfx_victr4
DSALTDI1 sfx_altdi1 Death taunts #1–#4 1
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.

Related links