Character creation tutorial/S_SKIN
|Character creation tutorial||[view]|
S_SKIN lump may possibly be the easiest place to start when designing a custom character. If you already know how fast you want your character to run, what ability it has, how high it can jump, etc., you can start by making an
S_SKIN lump to set the appropriate attributes. This chapter explains how to set up the
S_SKIN lump – some parts will require you to have already created some sprites for your character, which is covered in the next chapter.
One can directly make
S_SKIN by creating a new lump in your character's WAD file with your chosen lump editor and typing the details out. Another way is to write it with an external text editor such as Notepad and then import it into the WAD file. This can be done by saving the text file, and then, using a lump editor, importing it into the WAD file for your character with the name "
S_SKIN's placement in the WAD file is very important:
S_SKIN must be placed immediately before the character's first sprite. The reason for this is that once SRB2 reads an
S_SKIN lump, it automatically tries to look for all of the character's frames — in order — directly after that lump. If they're not directly after
S_SKIN, and another type of lump is there instead (e.g.
OBJCTCFG), the game will crash. Note that if your character's sprites appear between the sprite markers
S_END, you can place
S_SKIN in-between these lumps; as long as
S_SKIN appears directly before the first sprite, SRB2 will still recognise them as your character's sprites.
The format of text within
S_SKIN is very similar to that of a SOC lump; for instance, text in the
S_SKIN lump is not case-sensitive. That means "facename" can be identified as "facename", "FACENAME", "FaceName", or even "FaCeNaMe", and it will still be recognised as the same thing.
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 in a row (
//) at the start of a line.
This is a typical example of what an
S_SKIN lump may look 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
There are many parameters that can be supplied in the
S_SKIN lump; not all of them have to be supplied for a character however. Whatever is left out will fall on a set of default stats. The full list of parameters is located at S_SKIN > Parameters.
This section explains how to create an
S_SKIN lump for your custom character from scratch.
Step 1: Identification
S_SKIN lump should start off with the following parameters, which are required for the game to identify or represent the character with:
- name: This is the name of the skin for your character, which is used internally for identifying the character within the game – e.g. the
SKINcommand will require you to type this name out to switch to this character. For this reason, you should choose a unique name that is memorable and can also be easily typed out (if possible). Spaces are not allowed however; use underscores (
_) instead. If another skin of the same name is added to the game, the game will automatically give the latter skin a number onto the end of it's name – ensure your skin name is completely unique to avoid this, possibly tagging it with your own username (or an abbreviation of it).
- face: The lump name for the life icon graphic displayed for the character, normally displayed at the bottom-left of the screen as part of the HUD. This is generally expected to be 32×32 pixels in size. In multiplayer gametypes, this graphic will also be displayed in the Rankings/Scores HUD and the results screen to identify the character.
- charsel: The lump name for the character portait 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.
Custom graphics will need to be imported into the WAD file for both the face and charsel parameters; both of these should have no offsets whatsoever.
By default, the name parameter's value will also determine the name displayed for the character everywhere in the game. If this is not wanted — for instance, if your character's name parameter has your username in it to prevent clashes with other custom characters — the following parameters can be used to deal with this:
- realname: this determines the "real" name of your character to be displayed by the game in general, e.g. on intermission screens, the multiplayer character select screen, etc.
- hudname: this determines the name of your character to be displayed next to the life icon on the HUD. For example, the hudname for Knuckles is K.T.E. It is recommended to keep this name length low to fit with the standard five letter lives icons, if possible.
If either one of the two character name parameters above is given but not the other, the game will automatically copy the value for the one you have given to the one you have not included. Neither of them are required to be unique, unlike with the name parameter.
Step 2: Statistics and abilities
Next, you should determine what statistics and abilities your character will have; these are important as they define how the character plays through levels in SRB2. At this stage it is recommended to regularly test out your custom character in-game, and experiment with different stats to find what works best for your character. If you have not yet prepared any actual sprites for your character, use placeholder sprites in the character's WAD file for the time being.
The following parameters should normally be set to determine the character's speed statistics:
- normalspeed: This detemines the character's "top speed" – i.e. the maximum speed in fracunits/tic your character can move up to.
- acceleration: This determines how quickly your character reaches their top speed.
- accelstart: This determines how quickly your character moves from a standing start.
- thrustfactor: This determines the character's thrust factor – i.e. all other speed values are multiplied by this parameter's value to give a "complete" picture of the character's speed. The higher this is, the more speedy the character is.
These parameters determine the character's abilities:
- ability: This determines the character's primary ability – this usually determines the action your character uses on pressing the Jump button in mid-air. Examples of a primary ability include Sonic's thok, Tails' flight and Knuckles' glide and climb abilities, which would each be given as
CA_GLIDEANDCLIMBrespectively for this parameter. If the character should not have a primary ability,
CA_NONEis to be used here. A full list of primary abilities, along with full details on each, can be found at S_SKIN > ability.
- ability2: This determines the character's secondary ability, such as whether to spindash (
CA2_SPINDASH) or not (
CA2_NONE). A full list of secondary abilities, along with full details on each, can be found at S_SKIN > ability2.
- actionspd: For some primary abilities, this parameter determines the speed the character moves at when performing the ability. The exact effect of actionspd on the character may differ depending on the ability you chose for your character; some may not use this parameter at all, in which case this parameter can be left out.
These parameters are optional, but you can apply them to your character also if you wish:
- jumpfactor: if given, this determines the character's jump speed – more specifically, this determines the percentage of the default thrust the character will have at the start of a jump, expressed as a decimal (i.e. 1.0 equals 100%). For instance, Knuckles has a jumpfactor value of 0.85, which gives 85% of the full default jump thrust, while a jumpfactor of 1.5 would give 150% instead. The default value for jumpfactor is 1.0 (or 100% the default jump thrust) – if the character is meant to jump at the default speed, this parameter can be left out.
- mindash and maxdash control the minimum and maximum speeds that the character can spin at after charging a spindash up. Sonic, Tails and Knuckles all set these to 15 and 90 respectively, for example (these are also the defaults for the two parameters). These require ability2 to be set to
CA2_SPINDASH; if this is not the case, these parameters can be left out.
Step 3: Appearance
Lastly, if you have already made significant progress with your character's sprites, you can start configuring how your character appears in the game via the
S_SKIN. Ideally you should plan this part of the
S_SKIN well in advance of adding the character's sprites, so that you can design them around the expected values you will set in the character's
S_SKIN – this in theory would save you from from having to make tweaks to the sprites later on.
The following parameters control how your character's sprites appear in-game:
- prefcolor: This specifies your character's default skin color. This is required for Single Player, where the character's color cannot be changed under normal circumstances. Note that this parameter accepts the name of the color itself as the value – e.g. Blue, Orange, or Red – though two-word color names such as "Steel Blue" require an underscore (
_) character in place of a space (resulting in "Steel_Blue", for instance). See S_SKIN > prefcolor for the full list of color name strings that this parameter can take.
- startcolor: This specifies the range of colors in the palette on the character's sprites that will be replaced with the palette colors of the character's skin color. 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.
Step 4 (Optional): Custom sounds
As a optional feature, the
S_SKIN also allows you to give your character custom sounds – these replace any one of a selection of existing sounds in SRB2, but will play only for your character if they originate from them. For more details on setting custom sounds up for your character, see S_SKIN > Custom sounds.
|Character creation tutorial||[view]|