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.
 * – 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.
 * – 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 [list of attack names]. 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).