# Init and Attack scripts
These are the easy scripts to write, because they contain data rather than behavior. Writing them is a bit like filling out a form.
These scripts run once, at the beginning of the game.
# Initializing Variables
init.gml initializes your character's variables.
Many of them are built-in variables to do with movement or animation, but you can also initialize any variables you need
for your complex behavior, such as
laser_charge = 0.
Need guide for choosing movement attributes
other_init.gml is called by all other characters at the start of the game.
This is useful for setting other character's up to be compatible with your complex behavior.
Prefixing variables with your character's name helps to avoid "name collisions", using variable names that the other character is already
using, which can lead to bugs. Mr. Example's
other_init.gml might contain
mr_example_debuff_active = false.
# Initializing Graphics
load.gml looks like:
sprite_change_offset("idle", 29, 70) sprite_change_offset("crouch", 25, 66) // ... many more lines
sprite_change_offset(sprite_name, x_offset, y_offset) for each sprite to tell Rivals where to draw the sprite.
If they're wrong, you may find them floating or clipping into the floor.
The origin point should be at the bottom center of your character. You can find the right offset by opening the final sprite
.png in your editor or
using Dan Fornace's workshophelper (opens new window)
Note that the offset point in your
.aseprite file may not be the same as the final
.png file, because many sprites are scaled up, to x2, or even x4 for SSL (opens new window).
Used to generate the alternate color palettes for the character.
You can use RoaColorsGmlHelper (opens new window) to generate and test this file more easily.
Characters have 6 palette slots by default, but that can change to up to 16 by
set_num_palettes (opens new window).
init_shader.gml is called when the character's colors change, such as when parrying or in hitstun, and whenever you
Used for refreshing the character’s shader values after changing them.
I don't know what to say here. I haven't worked with shaders much. What are the use cases exactly?
# Initializing Attacks
Unlike all other scripts, you need to place these in
Names are typically from the standard attack names (opens new window), such as
The files typically look like a long series of function calls setting attack, window, and hitbox values:
make_hitbox(AT_DAIR, 1, HG_LIFETIME, 3, HG_HITBOX_X, -6, HG_HITBOX_Y, -44, // ... Many more lines )
Or, without the assistant's functions:
set_hitbox_value(AT_DAIR, 1, HG_LIFETIME, 3); set_hitbox_value(AT_DAIR, 1, HG_HITBOX_X, -6); set_hitbox_value(AT_DAIR, 1, HG_HITBOX_Y, -44); // ... Many more lines
This will need a much larger guide to talk about how to design an attack.
Will also need integration with .atk file processing.
Not mentioned in the manual Called at the end of each match, and is used to destroy any persistent 'ds_' data structures.