News

set_character_color_shading

Sets the intensity of the color slot’s shading, with 1 being normal shading. Setting it to 0 will make it completely flat, reminiscent of the Early Access palettes in the base game. (Note that you aren’t restricted to just 1 or 0.)

ArgumentTypeDescription
shade:realThe color slot to change
value:realThe intensity of the shading.

//This code sets the first color slot to have completely flat shading if they're set to a specific palette.
if get_player_color(player) == 12 {
set_character_color_shading( 0, 0 );
}

get_char_info

Returns with various values from the character’s main folder that are otherwise inaccessible.

ArgumentTypeDescription
player:realPlayer number to get info from
info:realThe type of info to get

Note that any property with STR in the name will return as a string. Everything else returns as a number.

The values you can get using this function can be the following macros:

Macro Associated file Description
INFO_HUD hud.png The normal sprite used in the character’s HUD bar during gameplay.
Returns a sprite index.
INFO_HUDHURT hud_hurt.png The hitstun sprite used in the character’s HUD bar during gameplay.
Returns a sprite index.
INFO_ICON icon.png The sprite used in the custom character select menu.
Returns a sprite index.
INFO_PORTRAIT portrait.png The large sprite used on the results screen when the character wins.
Returns a sprite index.
INFO_OFFSCREEN offscreen.png The icon that displays when the character itself is offscreen.
Returns a sprite index.
INFO_CHARSELECT charselect.png The sprite used in the character select screen when the character is selected and loaded.
Returns a sprite index.
INFO_STR_NAME name
(in config.ini)
The character’s name.
Returns a string.
INFO_STR_AUTHOR author
(in config.ini)
The author of the character.
Returns a string.
INFO_STR_DESCRIPTION description
(in config.ini)
The description of the character.
Returns a string.
INFO_PLURAL plural
(in config.ini)
Will return true if the character’s name refers to multiple characters.
Returns true or false.
INFO_VER_MAJOR major version
(in config.ini)
The whole number (before the decimal) in the character’s version number.
Returns a number.
INFO_VER_MINOR major version
(in config.ini)
The fractional number (after the decimal) in the character’s version number.
Returns a number.

Example, called from hit_player.gml:

// Grabs the name of the character you just hit and then adds it to a string that can be drawn later.
hit_text = "See ya, " + get_char_info( hit_player_obj.player, INFO_STR_NAME) + "!";

set_character_color_slot

Changes the color slot of the currently selected color profile, affecting only the character and leaving articles alone.

ArgumentTypeDescription
shade:realThe color slot to change
red:realThe Red value to set the color to.
Should be between 0 and 255.
green:realThe Green value to set the color to.
Should be between 0 and 255.
blue:realThe Blue value to set the color to.
Should be between 0 and 255.
alpha:realThe Alpha value to set the color to, with 0 being fully transparent and 1 being opaque.

Example, called from post_draw.gml:

//This code sets the player's first color slot to be a partially-transparent white if they're set to a specific palette.
if get_player_color(player) == 13 {
set_character_color_slot(0, 255, 255, 255, 0.5);
}

get_color_profile_slot_b

Returns the blue 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_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);