» Uncategorized Posts

article_destroy

Prompts the article to despawn, but not immediately deleting it. Using this on a custom article only sets its destroyed variable to true, meaning the article might not be able to be destroyed.

ArgumentTypeDescription
instance_id:realThe Instance ID of the article to destroy.

Example, called from update.gml:

// This code attmpts to destroy the closest kragg rock to the player:
var near = instance_nearest(x, y, asset_get("rock_obj"));
article_destroy(near);

set_ui_element

Sets character-related UI sprites and sounds, such as the victory theme or their HUD icon.

Uses the following indexes

ArgumentTypeDescription
type:realThe type of UI element to set
value:intThe custom asset to set it to

Example, called from load.gml:

set_ui_element( UI_WIN_THEME, sound_get( "custom" ));

get_hitstun_formula

Returns the resulting amount of hitstun a player would get if they were hit with the specified stats. Note that hitstun is not hitstop; Hitstun is how long the player remains inactionable after being hit.

ArgumentTypeDescription
player damage:realThe current damage of the target before being hit
player knockback_adj:realThe target's knockback multiplier, usually under knockback_adj
KB mulitplier:realThe general KB multiplier, usually defined by match settings
hitbox damage:realThe amount of damage the hitbox deals
hitbox BKB:realThe hitbox's base knockback value
hitbox KB scale:realThe hitbox's knockback scaling

Example, called from article1_hit.gml:

// This simulates hitstun in an article as if it were a player, to be used elsewhere:
hitstun = get_hitstun_formula(damage, knockback_adj, 1.0, enemy_hitboxID.damage, enemy_hitboxID.kb_value, enemy_hitboxID.kb_scale);

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);
}