» Uncategorized Posts

Stage Articles

Stage articles behave similarly to normal articles, and this page will explain the differences between the two. For a reference on how articles work, check the Articles page.

Each custom stage has access to 3 types of stage articles: obj_stage_article, obj_stage_article_platform, and obj_stage_article_solid. The type of article created as well as the script set it uses (article1_init, article1_update, etc.) is dependent on spawners placed in the stage editor; the script set used is determined by the spawner number and the type of article is changeable in the editor’s properties menu. You can check which script set an article is using with the get_article_script function.

In addition to all of the variables shown in the normal articles page, stage articles also have these variables:

Variable Description
spawn_variables  an array of 8 variables passed from the spawner in the stage editor (ARG0 – ARG7).
parallax_x horizontal parallax, centered on the center of the stage.
parallax_y vertical parallax, centered on the center of the stage.

If you’re spawning a stage article using the instance_create function, you can add an optional argument to the end of it to change which script set the spawned article uses. For example, if you want to spawn a stage platform that uses article5_init, the function would look like this:

instance_create(x, y, “obj_stage_article_platform”, 5);

create_deathbox

Creates a hitbox that instantly K.O.s any player that touches it.

ArgumentTypeDescription
x:realThe x coordinate of the center of the deathbox's desired position
y:realThe y coordinate of the center of the deathbox's desired position
w:realThe width of the deathbox, in pixels
h:realThe height of the deathbox, in pixels
player:realUsed to make the deathbox only hit a specific player.
Set to -1 if you want it to be able to hit all players.
Set to 0 if you want it to be able to hit all players except yourself
free:realIf set to false, it will only hit grounded players
shape:realThe sprite to use for the deathbox (same as the HG_SHAPE property in the hitbox grid):
0 = circle
1 = rectangle
2 = rounded rectangle
lifespan:realThe number of frames the deathbox stays active
bg_type:real[optional]
The screen effect to play when the deathbox hits someone:
0 = no screen effect
1 = purple screen effect
2 = red screen effect

Example, called from attack_update.gml:

// this attack creates a deathbox on top of the player that was hit by an earlier hitbox of the attack. This deathbox can only kill the hit player and will show the red screen effect on hit:
if (window == 3 && window_timer == 10 && has_hit_player) {
create_deathbox(
has_hit_id.x, // x
has_hit_id.y, // y
100, // w
100, // h
has_hit_id.player, // player
true, // free
1, // shape
3, // lifespan
2 // bg_type
);
}

create_hitbox

Creates a hitbox at (x, y) pulling from the attack data of the specified hitbox.

ArgumentTypeDescription
attack:realThe attack to get the hitbox data from
hitbox_num:realThe index of the hitbox to get the data from
x:realThe x coordinate to create the hitbox at
y:realThe y coordinate to create the hitbox at

Example, called from article1_update.gml:

// this article creates a hitbox (the owner's 1st Dspecial hitbox) any time it's close to its owner:
if (point_distance( x, y, owner.x, owner.y ) < 32 && cooldown_timer == 0) { create_hitbox( AT_DSPECIAL, 1, x, y - 40 );
cooldown_timer = 60;
}

get_hitbox_angle

Returns the angle that the hitbox sends. The function takes the current object’s position into account for angle flippers.

ArgumentTypeDescription
hitbox_id:realThe ID of the hitbox to get the angle of

Example, called from article1_update.gml:

// this non-player object has a custom KB formula when hit by a hitbox:
var temp_angle = get_hitbox_angle( enemy_hitboxID );
var force = enemy_hitboxID.kb_value + enemy_hitboxID.kb_scale * 12;
hsp = lengthdir_x( force, temp_angle );
vsp = lengthdir_y( force, temp_angle );

destroy_hitboxes

Destroys all physical hitboxes for the character.

Example, called from attack_update.gml:

// in this example, window 2 is a diving attack with a long-lasting hitbox that goes away when landing into window 3:
if (window == 2 && !free){
window = 3;
window_timer = 0;
destroy_hitboxes();
}