» Uncategorized Posts

get_player_damage

Returns the amount of damage the specified player has.

ArgumentTypeDescription
player:realID of the player to get the damage of

Example, called from update.gml:

// this character has higher gravity when over 100%:
if (get_player_damage( player ) >= 100) {
gravity_speed = 1.0;
} else {
gravity_speed = 0.5;
}

get_player_color

Returns the color slot being currently used by the specified player.

ArgumentTypeDescription
player:realID of the player to get the color of

Example, called from post_draw.gml:

// this character's 3rd color slot has an aura drawn over it:
if (get_player_color( player ) == 3) {
draw_sprite(sprite_get( "aura_particles" ), aura_timer, x, y );
}

set_player_stocks

Sets the number of stocks for the specified player.

ArgumentTypeDescription
player:realID of the player to set the stocks of
value:realThe value to set

Example, called from attack_update.gml:

// gives your character another stock at the end of window 2:
if (window == 2 && window_timer == 200) {
set_player_stocks( player, get_player_stocks( player ) + 1 );
}

get_player_stocks

Returns the number of stocks the specified player has.

ArgumentTypeDescription
player:realID of the player to get the stocks of

Example, called from got_hit.gml:

// this character takes half knockback if the opponent has only 1 stock left:
if (get_player_stocks( hit_player ) == 1) {
old_hsp *= .5;
old_vsp *= .5;
}

set_player_team

Sets the team for the specified player.

ArgumentTypeDescription
player:realID of the player to get the team of
value:realThe value to set. Should be either 1 or 2

Example, called from attack_update.gml:

// changes teams at the beginning of your taunt:
if (attack == AT_TAUNT && window == 1 && window_timer == 1) {
if (get_player_team( player ) == 1) {
set_player_team( player, 2 );
} else {
set_player_team( player, 1 );
}
}