Sprite names up to 64 character long and 256 frames per sprite
This introduces the new LongSprites/
PK3 folder, which lets modders add sprites with names longer than 4 characters (up to 64).
Here is a screenshot showing the basic folder structure:
- The name of the sprite is defined by the name of the folder containing the graphics. Here, we have two sprites:
CrawlaStatue
andEggmanStatue
, with their respective constantsSPR_CRAWLASTATUE
andSPR_EGGMANSTATUE
. - The sprite folders can be organised into any number of parent folders, including none, if desired. In this example, the
Statues/
folder is simply ignored by SRB2. - The graphics lumps are defined in a very similar fashion to regular sprites, but they must be named after the following pattern:
<frame number>_<rotation>
, where<rotation>
is the same as usual (0-7, L/R, etc) andframe_number
is the frame number represented as any number of digits up to 4. Examples:0_0
,0024_R
,3_7
,01_2
. - Missing rotations are automatically mirrored from their opposite rotation (
00_3
<=>00_7
00_4
<=>00_6
, etc.). - If a frame needs to be mirrored from a different frame, the following alternate pattern can be used instead:
<frame number>_<rotation>+<frame number 2>_<rotation 2>
. Examples:027_3+028_3
,2_L+4_L
. - The sprites are allocated the same way as before, using the
freeslot()
function in Lua orFreeslot
blocks in SOC. - Instead of being limited to 64 frames, the maximum is now 256.
Because sprites and frames are already exposed as numbers to Lua, this system is entirely backward compatible with existing scripts and can both frame notations be used interchangeably in both Lua and SOC.
Example PK3:
Edited by LJ Sonic
Merge request reports
Activity
added Enhancement Refactoring labels
added 1 commit
- 49fa4503 - Fix error report when some frames are missing
changed milestone to %2.2.14
added 5 commits
- f406e9bb - Throw a Lua error when R_Frame2Char is called with a frame number without character representation
- 32a3683e - Fix error message when a patch is missing
- eaf0ba66 - Error out when a sprite definition contains a subfolder
- 245a8211 - Make rotation optional for long sprites
- 22106ef8 - Fix short sprite names triggering an error
Toggle commit listadded 1 commit
- 8a6b5d7c - Support setting two frames per lump for long sprites
mentioned in commit 32a8652c
mentioned in issue #1231 (closed)
mentioned in issue #1255 (closed)
added Feature label
mentioned in merge request !2526 (merged)
added Wiki to-do label
Please register or sign in to reply