Scripts
From Rivals of Aether Unofficial Workshop Manual
Init scripts[edit | edit source]
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.unload.gml
- Called when the item is unloaded. This is where you want to clear out anything that wouldn't be unloaded automatically.colors.gml
– Used 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.other_init.gml
– Called by all other players in a match that includes your character. This is where you want to initialize variables that you can change on other players.init_shader.gml
– Called every time theinit_shader()
function is run, either by the game or when the function is called by the user. Used for refreshing the character’s shader values after changing them. The game itself runsinit_shader()
when changing the character’s color for things like parrying or flashing during hitstun.
Animation and Draw scripts[edit | edit source]
animation.gml
– Called every frame. Used for animation purposes such as changing the character’ssprite_index
andimage_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.other_pre_draw.gml
– Used by opponent characters to draw sprites underneath themselves. Useother_player_id
to reference your workshop character.other_post_draw.gml
– Used by opponent characters to draw sprites on top of themselves. Useother_player_id
to reference your workshop character.debug_draw.gml
– Used to draw debug text/sprites. Everything will be drawn in front of all game objects.draw_hud.gml
– Used to draw on top of the player’s HUD. To get the position of the HUD, usetemp_x
andtemp_y
.results_pre_draw.gml
– Used to draw below every player's results screen portrait (as long as your workshop character is one of the winners).results_draw_portrait.gml
– Used to draw above your player's results screen portrait. Useportrait_x
andportrait_y
.results_post_draw.gml
– Used to draw above every player's results screen portrait (as long as your workshop character is one of the winners).
[edit | edit source]
pre_update.gml
- Called every frame, before all other per-frame update scripts. Can override state transition variables likecan_attack
in any state.update.gml
– Called every frame. Used for gameplay mechanics that usually update variables set ininit.gml
.attack_update.gml
– Called every frame, but only if the character is performing an attack (attack type is stored inside the attack variable).death.gml
– Called when the character dies. Useful for resetting variables or deleting articles.set_attack.gml
– Called at the beginning of every attack. Used to change things likeAT_DSPECIAL
intoAT_DSPECIAL_AIR
under certain conditions.set_state.gml
- Called upon enterring any non-attacking state. Can override state transition variables likecan_attack
in non-attacking states./attacks/[attack_name].gml
– Called afterinit.gml
. This is where you want to use the attack/hitbox grid functions to modify attack grids and hitbox grids for every attack type; the list of attack names can be seen Attack Indexes. Note that all attack scripts should be placed inside the/attacks
folder.hit_player.gml
– Called when you hit another player with any hitbox. Usehit_player_obj
to reference the player object that was hit. Usehit_player
to reference which player you hit (player 1, player 2, etc). Usemy_hitboxID
to reference the hitbox you hit them with. To change the knockback given, edithit_player_obj.orig_knock
. You can disable the purple kill effect by settinghit_player_obj.should_make_shockwave
to false.got_hit.gml
– Called when you are hit by any hitbox. Usehit_player_obj
to reference the player object that hit you. Usehit_player
to reference which player hit you (player 1, player 2, etc). Useenemy_hitboxID
to reference the hitbox you were hit with. To change the knockback received, editorig_knock
. You can disable the purple kill effect by settingshould_make_shockwave
to false.parry.gml
– Called when you parry a hitbox. Usehit_player_obj
to reference the player object whose hitbox you parried. Usehit_player
to reference which player owns the hitbox (player 1, player 2, etc). Use enemy_hitboxID to reference the hitbox you parried.got_parried.gml
– Called when your hitbox is parried. Usehit_player_obj
to reference the player object who parried your hitbox. Usehit_player
to reference which player parried your hitbox (player 1, player 2, etc). Use my_hitboxID to reference the hitbox that was parried.user_event[0 – 15].gml
– Called only by running the corresponding user_event() function. Used for whatever the user wants, though usually it’s for any blocks of code that would be run in multiple different scenarios.
Article and Hitbox scripts[edit | edit source]
article[index]_init.gml
– Called once the specified custom article object is created. For solid and platform articles, usearticlesolid_init.gml
andarticleplatform_init.gml.
article[index]_update.gml
– Called every frame for the specified custom article object. For solid and platform articles, usearticlesolid_update.gml
andarticleplatform_update.gml.
hitbox_init.gml
– Called when one of the character’s hitboxes is created. This script is called from the perspective of the hitbox.hitbox_update.gml
– Called every frame for each of the character’s hitboxes. This script is called from the perspective of the hitbox.article[index]_pre_draw.gml
– Used to draw things on custom article objects. Everything will be drawn behind the article running the script. For solid and platform articles, usearticlesolid_pre_draw.gml
andarticleplatform_pre_draw.gml
.article[index]_post_draw.gml
– Used to draw things on custom article objects. Everything will be drawn in front of the article running the script. For solid and platform articles, usearticlesolid_pre_draw.gml
andarticleplatform_pre_draw.gml
.article[index]_hit.gml
– Called when the specified custom article object is hit by any hitbox whileis_hittable
is set to true. Usehit_player_obj
to reference the player object that hit the article. Usehit_player
to reference which player hit the article (player 1, player 2, etc). Useenemy_hitboxID
to reference the hitbox the article was hit with. For solid and platform articles, usearticlesolid_hit.gml
andarticleplatform_hit.gml
.
Character Select Screen scripts[edit | edit source]
css_init.gml
– Called when the character is loaded on the character select screen.css_update.gml
– Called every frame on the character select screen while the character is selected.css_draw.gml
– Used to draw things on the character select screen when the character is selected. in this script, x and y will refer to the top left corner of the player’s character profile.
AI scripts[edit | edit source]
ai_init.gml
– Called when a CPU version of the character is created. This script should populate the listed arrays with attack indexes. The arrays can be any size. Each entry in the array has the same probability of being selected. The entries in the arrays should only be the default attacks values – AT_DSPECIAL_AIR is not valid, for instance, and should just be AT_DSPECIAL.far_up_attacks[]
far_down_attacks[]
far_side_attacks[]
mid_side_attacks[]
close_up_attacks[]
close_down_attacks[]
close_side_attacks[]
neutral_attacks[]
ai_update.gml
– Called every frame for a CPU version of the character. Used for special cases like recovery and complex special moves. Use ai_target to reference the player object the CPU is currently targeting. Use ai_recovering to check if the CPU is recovering or not. Use temp_level to reference the CPU’s difficulty level (1-9).