» Uncategorized Posts

get_hitstop_formula

Returns the resulting amount of hitpause a player would get if they were hit with the specified stats. Note that hitpause is not hitstun; hitpause is the freezeframes immediately after getting hit.

ArgumentTypeDescription
player damage:realThe current damage of the target before being hit
hitbox damage:realThe amount of damage the hitbox deals
hitbox base hitstop:realThe base hitpause the hitbox always deals
hitbox hitstop scale:realThe amount hitpause scales with damage
hitbox extra hitpause:realThe extra hitpause only dealt to the target

Example, called from article1_hit.gml:

// This simulates hitpause in an article as if it were a player, to be used elsewhere:
hitstop = get_hitstop_formula(damage, enemy_hitboxID.damage, enemy_hitboxID.hitpause, enemy_hitboxID.hitpause_growth, enemy_hitboxID.extra_hitpause);

get_synced_var

Returns the persistent global variable of that player slot.

ArgumentTypeDescription
player:realID of the player to get the synced variable of

Example, called from init.gml:

// This character gets a slower dash speed and higher jump if something has changed its synced variable to 1 before the match starts, likely as a custom menu option:
if (get_synced_var( player ) == 1) {
dash_speed -= 2;
jump_speed += 3;
}

set_synced_var

Sets the persistent global variable of that player slot. This value persists before and after matches, as well as being saved in replays.

ArgumentTypeDescription
player:realID of the player to get the synced variable of
value:intThe value to set the variable to

Example, called from css_update.gml:

// This character only sets their synced var to "true" when selecting a specific palette
if (get_player_color( player ) == 12) {
(set_synced_var( player, true)
} else {
(set_synced_var( player, false)
}

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