» Uncategorized Posts

Stage Scripts

Avoid including empty scripts, since that will result in a crash when the item is loaded.
  • 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.
  • init.gml – called once the main stage object is created.
  • other_init.gml – called by all other players on the stage. This is where you want to initialize variables that you can change on other players.
  • draw_hud.gml – used to draw HUD for custom game modes. Draws over every other player’s HUD.
  • match_end.gml – called the moment the match ends.
  • article[index]_init.gml – called once the specified custom article object is created.
  • Article[index]_update.gml – called every frame for the specified custom article object.
  • article[index]_draw.gml – used to draw things on an article. Everything will be drawn in front of the article.
  • hit_player.gml – called when you hit another player with any hitbox. Use hit_player_obj to reference the player object that was hit. Use hit_player to reference which player you hit (player 1, player 2, etc). Use my_hitboxID to reference the hitbox you hit them with. To change the knockback given, edit hit_player_obj.orig_knock. You can disable the purple kill effect by setting hit_player_obj.should_make_shockwave to false.
  • got_parried.gml – called when your hitbox is parried. Use hit_player_obj to reference the player object who parried your hitbox. Use hit_player to reference which player parried your hitbox (player 1, player 2, etc). Use my_hitboxID to reference the hitbox that was parried.
  • player_death.gml – called whenever a player dies. use hit_player_obj to reference the player object that just died.
  • anything under the “/scripts/attacks” folder

get_article_script

Returns the script set used by the stage article. Will return -1 if the instance is not a stage article.

ArgumentTypeDescription
instance_id:realthe article ID to get the script set of.

Example, called from a stage’s update.gml:

 

//This code will destroy any normal stage article that uses scripts like "article4_update.gml", but leave ones that use other scripts (article3_update.gml, article5_update.gml, etc) intact.
if (wave_timer <= 0) {
with ( obj_stage_article ) {
if ( get_article_script( id ) == 4 ) {
instance_destroy();
}
}
}

is_aether_stage

Returns true if the current stage is set to Aether, and false if it’s Basic.

Example, called from a stage’s article1_update:

//This code will make a stage article shoot out a hitbox every 1/2 second (30 frames), but only if Aether mode is turned on.
if (shot_cooldown <= 0 && is_aether_stage() ) {
shot_cooldown = 30;
create_hitbox( AT_JAB, 0, x, y);
}

get_player_hud_color

Returns the hex value of the specified player’s HUD color.

ArgumentTypeDescription
player:realThe player slot to check. Should be between 1 and 4.

Example, called from update.gml:

//This code changes the player's outline to the same color as their HUD.
var _col = get_player_hud_color( player );
outline_color = [
color_get_red( _col ),
color_get_green( _col ),
color_get_blue( _col )
];

is_player_on

Checks whether the player slot is active or not.

ArgumentTypeDescription
setting:realThe player slot to check. Must be between 1 and 4.

Example, called from a stage’s other_init.gml:

//This code adds to a total player count in obj_stage_main for every active player in the match.
if ( player_is_on( player ) ) {
other.total_player_count += 1;
}