Scripts

Init scripts

 * – 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.
 * - Called when the item is unloaded. This is where you want to clear out anything that wouldn't be unloaded automatically.
 * – Used to generate the alternate color palettes for the character.
 * – Called once the player object is created. This is where you want to initialize most of the player variables.
 * – 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.
 * – Called every time the  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 runs   when changing the character’s color for things like parrying or flashing during hitstun.

Animation and Draw scripts

 * – Called every frame. Used for animation purposes such as changing the character’s  and.
 * – Used to draw sprites other than the player’s sprite. Everything will be drawn behind the player character.
 * – Used to draw sprites other than the player’s sprite. Everything will be drawn in front of the player character.
 * – Used by opponent characters to draw sprites underneath themselves. Use  to reference your workshop character.
 * – Used by opponent characters to draw sprites on top of themselves. Use  to reference your workshop character.
 * – Used to draw debug text/sprites. Everything will be drawn in front of all game objects.
 * – Used to draw on top of the player’s HUD. To get the position of the HUD, use  and.
 * – Used to draw below every player's results screen portrait (as long as your workshop character is one of the winners).
 * – Used to draw above your player's results screen portrait. Use  and.
 * – Used to draw above every player's results screen portrait (as long as your workshop character is one of the winners).

Gameplay-related scripts

 * – Called every frame. Used for gameplay mechanics that usually update variables set in.
 * – Called every frame, but only if the character is performing an attack (attack type is stored inside the attack variable).
 * – Called when the character dies. Useful for resetting variables or deleting articles.
 * – Called at the beginning of every attack. Used to change things like  into   under certain conditions.
 * – Called after . 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   folder.
 * – Called when you hit another player with any hitbox. Use  to reference the player object that was hit. Use   to reference which player you hit (player 1, player 2, etc). Use   to reference the hitbox you hit them with. To change the knockback given, edit  . You can disable the purple kill effect by setting   to false.
 * – Called when you are hit by any hitbox. Use  to reference the player object that hit you. Use   to reference which player hit you (player 1, player 2, etc). Use   to reference the hitbox you were hit with. To change the knockback received, edit  . You can disable the purple kill effect by setting   to false.
 * – Called when you parry a hitbox. Use  to reference the player object whose hitbox you parried. Use   to reference which player owns the hitbox (player 1, player 2, etc). Use enemy_hitboxID to reference the hitbox you parried.
 * – Called when your hitbox is parried. Use  to reference the player object who parried your hitbox. Use   to reference which player parried your hitbox (player 1, player 2, etc). Use my_hitboxID to reference the hitbox that was parried.
 * – 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

 * – Called once the specified custom article object is created. For solid and platform articles, use  and
 * – Called every frame for the specified custom article object. For solid and platform articles, use  and
 * – Called when one of the character’s hitboxes is created. This script is called from the perspective of the hitbox.
 * – Called every frame for each of the character’s hitboxes. This script is called from the perspective of the hitbox.
 * – Used to draw things on custom article objects. Everything will be drawn behind the article running the script. For solid and platform articles, use  and.
 * – 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, use  and.

Character Select Screen scripts

 * – Called when the character is loaded on the character select screen.
 * – Called every frame on the character select screen while the character is selected.
 * – 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

 * – 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.
 * – 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).
 * – 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).