» Uncategorized Posts

Hit Particles

Hit particles appear whenever you land a hit on someone. Though they’re purely decorative, they can help sell what the attack hit them with; Base game characters use this for elemental-focused attacks.

Custom characters have 6 slots for custom hit particles. By default, these slots are automatically filled out with the files hit_particle1hit_particle6 in the sprites folder. (If those sprites don’t exist, an empty sprite is used instead.) You can change which sprite a particle uses by calling set_hit_particle_sprite( num:real, sprite_index:real ) in init.gml. For example:

set_hit_particle_sprite( 1, sprite_get( "custom_sprite" ) );

For more information on how sprites are loaded and animated in general, check the Sprites page.

The particles a hitbox spawns depends on the property HG_HIT_PARTICLE_NUM. By default this property is set to 0, which will use the regular “bullet”-shaped particles. Setting it to 1 – 6 will use the hit particles from that slot, and anything above that will behave the same as 0.

Hit particle sprites are stored and drawn slightly differently to normal sprites, and have a few important differences to keep in mind.
Due to the way hit particles are stored, they cannot be updated after init.gml runs, and will not update to match palette changes mid-match.
Transparency is handled differently; the color in the bottom left pixel of each frame is counted as transparency, and every other color will be completely opaque.

Skins

Skins are fairly self-explanatory if you’re familiar with the term already; they’re cosmetics that can potentially replace all of a characters’ sprites and sounds while keeping gameplay pretty much the same. When Workshop is enabled in the match rules, skins can be equipped by selecting a character, and then using the gear-shaped button that appears on the player window.

In terms of file structure as well as underlying behavior, they work similarly to a custom character. That means a lot of the Intruduction page applies here, as well. Same folders, same file structure.

The main difference here is the addition of a “character” property in the config.ini. This determines the character the skin is assigned to.

Templates

The following templates for every character contain all of the sprites they use, as well as scripts with every animation-related variable you can change and attack scripts for all of their attack properties. Most of the properties in the attacks folder won’t be changed unless an Advanced Skin is used, which is explained below.

Basic skins

Basic skins are meant to be purely cosmetic; changes are restricted to things that don’t affect actual gameplay, and can generally be safer to use in tournaments and a more competitive setting. (Though for tournament organizers, skins may still have terrible visual and audio clarity. That should be as bad as they get.) The scripts Basic skins run are:

  • load.gml – called right after the item is loaded into the game. This is where you would normally set sprites’ origins and bounding boxes. To help place origins correctly, use the Rivals Workshop Helper.
  • colors.gmlused to generate the alternate color palettes for the character.
  • init.gml – called once the player object is created. This is where you want to initialize most of the player variables. In basic skins, only certain animation-related variables will keep their changes from this script.

Basic skins also restrict the attack and hitbox properties you can set to the following:

  • AG_SPRITE
  • AG_AIR_SPRITE
  • AG_WINDOW_ANIM_FRAMES
  • AG_WINDOW_ANIM_FRAME_START
  • AG_WINDOW_HITPAUSE_FRAME
  • AG_WINDOW_HAS_SFX
  • AG_WINDOW_SFX
  • AG_WINDOW_SFX_FRAME
  • HG_VISUAL_EFFECT
  • HG_VISUAL_EFFECT_X_OFFSET
  • HG_VISUAL_EFFECT_Y_OFFSET
  • HG_HIT_SFX
  • HG_EXTRA_CAMERA_SHAKE
  • HG_PROJECTILE_SPRITE
  • HG_PROJECTILE_ANIM_SPEED
  • HG_PROJECTILE_DESTROY_EFFECT
  • HG_HIT_PARTICLE_NUM

Advanced skins

A skin can be switched to an Advanced skin by switching the “advanced” property in its config.ini to “1”. With this, you’re able to essentially create variants of the character with edited moves and properties.
The scripts Advanced skins run are:

  • load.gml – called right after the item is loaded into the game. This is where you would normally set sprites’ origins and bounding boxes. To help place origins correctly, use the Rivals Workshop Helper.
  • colors.gmlused to generate the alternate color palettes for the character.
  • init.gml – called once the player object is created. This is where you want to initialize most of the player variables.
  • update.gml – called every frame. Used for gameplay mechanics.
  • set_attack.gml – called at the beginning of every attack. Used to change things like Dspecial into Dspecial_air under certain conditions.
  • attack_update.gml – called every frame, but only if the character is performing an attack (attack type is stored inside the attack variable).
  • animation.gml – called every frame. Used for animation purposes such as changing the character’s sprite_index and image_index.
  • pre_draw.gml – used to draw sprites other than the player’s sprite. Everything will be drawn behind the player character.
  • post_draw.gml – used to draw sprites other than the player’s sprite. Everything will be drawn in front of the player character.

Advanced skins can also have any of their attack or hitbox properties changed. The templates have scripts for every attack the character uses (and then some), though they won’t necessarily be kept up to date with balance patches. If you want to use the base game’s current version of an attack property, simply delete the line that sets it, or use the // symbol to comment out the line.

Attack Names

Use these names when naming attack sprites and attack hurtbox sprites. For example, your dash attack should consist of dattack_strip10.png and dattack_hurt_strip10.png.

jab
dattack

nspecial
fspecial
uspecial
dspecial

fstrong
ustrong
dstrong

ftilt
utilt
dtilt

nair
fair
bair
dair
uair

taunt

These names should also be used when naming the default attack scripts, but any other scripts in the attacks folder will also be executed regardless of name, so you can have scripts like dspecial_air, fstrong2, or downward_angled_ftilt.

Animation Names

These are the names you will have to use when naming your sprites. For example, to automatically replace the double jump animation with a 9 frame sprite, you will name the sprite doublejump_strip9.png. Other names than those listed are acceptable for sprites, but will not be automatically used for any states.

idle
walk
walkturn
jump
jumpstart
walljump
to align this sprite to the wall correctly, the origin should be 22px from the edge of the sprite
doublejump

airdodge
airdodge_forward
airdodge_back
airdodge_up
airdodge_upforward
airdodge_upback
airdodge_down
airdodge_downforward
airdodge_downback
if any of the directional airdodge animations are not included, it will just use the normal “airdodge” animation instead

plat
used for the respawn platform. the origin should be at the top-center of the platform

dash
dashstart
dashstop
dashturn

land
landinglag
waveland
pratfall
crouch
tech
roll_forward
roll_backward
parry

hurt
bighurt
hurtground
bouncehurt
spinhurt
uphurt
downhurt
if any hurt animations are missing, it will just use the normal “hurt” animation instead

[attackname]
[attackname]_hurt
attack names list

Buddies’ Animation Names

idle
run
wait
ledge
taunt
turn

Sprites

A sprite should be a strip of animation frames, sequenced one after another from the left to the right. All frames should have the same dimensions. Sprites should be named in the following pattern: [name]_strip[frames].png. For example: walk_strip8.png, telling the parser the animation has 8 frames.

To convert a gif into a sprite sheet, you can either use Game Maker to import and export it as a .png or use an online converter like this one (use the “Stack Horizontally” option to make sure everything is on a single row).

If you want the sprite to replace one of the existing character states without any scripting, you should name it accordingly.

Hurtbox sprites for non-attack states (_hurtbox, _crouchbox, _hurtbox_air, _hitstun_hurtbox) use rectangular collision. Hurtbox sprites for attacks (_hurt sprites) use precise collision instead.

The origin for all sprites is set to top left (0, 0) by default. To help place origins correctly, use the Rivals Workshop Helper.

You can directly reference any custom sprite by calling sprite_get( name:string ) in animation.gml. For example, forcing walk animation to use the dash sprite instead:

if (state == PS_WALK) {
sprite_index = sprite_get( "dash" );
}

(reference on available player states).

You can also change offset and bounding boxes for your sprites in load.gml. For example:

// changing offset of the jump sprite to [94, 138]:
sprite_change_offset( "jump", 94, 138 );
// making it precise:
sprite_change_collision_mask( "jump", true, 0, 0, 0, 0, 0, 0 );

Hit Particles

Hit Particles have a couple differences to how normal sprites work; visit the page for Hit Particles to learn more about how to change those for your character.