» Uncategorized Posts

get_color_profile_slot_g

Returns the green component of a character’s color slot, with a value from 0 to 255. Note that this does not take into account changes made by set_character_color_slot or set_article_color_slot.

ArgumentTypeDescription
color:realThe color profile to check
shade:realThe specific color of the profile to check

Example, called from post_draw.gml:

//This code draws a custom sprite tinted to the exact color of the player's first color slot.
var col_R = get_color_profile_slot_r( get_player_color(player), 0);
var col_G = get_color_profile_slot_g( get_player_color(player), 0);
var col_B = get_color_profile_slot_b( get_player_color(player), 0);

var col_final = make_color_rgb(col_r, col_g, col_b);

draw_sprite_ext(sprite_get("custom_sprite"), image_index, x, y, image_xscale, image_yscale, image_angle, col_final, image_alpha);

get_color_profile_slot_r

Returns the red component of a character’s color slot, with a value from 0 to 255. Note that this does not take into account changes made by set_character_color_slot or set_article_color_slot.

ArgumentTypeDescription
color:realThe color profile to check
shade:realThe specific color of the profile to check

Example, called from post_draw.gml:

//This code draws a custom sprite tinted to the exact color of the player's first color slot.
var col_R = get_color_profile_slot_r( get_player_color(player), 0);
var col_G = get_color_profile_slot_g( get_player_color(player), 0);
var col_B = get_color_profile_slot_b( get_player_color(player), 0);

var col_final = make_color_rgb(col_r, col_g, col_b);

draw_sprite_ext(sprite_get("custom_sprite"), image_index, x, y, image_xscale, image_yscale, image_angle, col_final, image_alpha);

shake_camera

Sets the camera shake.

ArgumentTypeDescription
intensity:realThe intensity of the camera shake
time:realThe time it should shake for, in frames

Note that this will override any other camera shake currently happening.

Example, called from update.gml:

//Makes the camera shake for 6 frames when the player lands.
if (state == PS_LAND or state == PS_LANDING_LAG) && state_timer == 1 {
shake_camera( 8, 6 )
}

get_player_name

Returns the name being currently used by the specified player, returning “P1”, “P2”, etc. if the player has no name set.

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

Example, called from post_draw.gml:

// This draws the current player name as debug text under the character:
draw_debug_text(x, y+10, get_player_name( player ));

get_kb_formula

Returns the resulting amount of knockback a player would get if they were hit with the specified stats. Usually used in tandem with get_hitbox_angle()  Reference→

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 knockback in an article as if it were a player, to be used elsewhere:
orig_knock = get_kb_formula(damage, knockback_adj, 1.0, enemy_hitboxID.damage, enemy_hitboxID.kb_value, enemy_hitboxID.kb_scale);