» Uncategorized Posts

trigger_b_reverse

When used in attack_update.gml, it will check for b-reverse inputs on specified attacks.

Example, called from attack_update.gml:

if (attack == AT_NSPECIAL
|| attack == AT_FSPECIAL
|| attack == AT_FSPECIAL_AIR
|| attack == AT_DSPECIAL_AIR) {
trigger_b_reverse();
}

draw_debug_text

Draws text to the screen.

ArgumentTypeDescription
x:realThe x position the text will be drawn at
y:realThe y position the text will be drawn at
text:stringThe text to draw

Example, called from post_draw.gml:

// draws current character's state:
draw_debug_text( x, y - 20, string( state ));

asset_get

Returns the unique index (real) for any built-in game asset – including sounds, objects, and sprites. Can be used, for example, to assign a specific sound effect to a character attack.

To get the index of a custom (loaded with your character) asset, use

sprite_get( sprite )  Reference→
sound_get( sound )  Reference→

functions instead.

ArgumentTypeDescription
asset:stringThe name of the game asset to get the index of

Example, called from bair.gml:

// sets the sound effect assigned to the 3rd bair window:
set_window_value( AT_BAIR, 3, AG_WINDOW_SFX, asset_get( "sfx_swipe_medium1" ));

instance_destroy

Destroys the specified instance. Calling the function with no arguments will destroy the instance that is currently in scope and running the code, but you can target a specific instance if you provide its ID, or you can target all instances of a particular object by using an object_index.

Available objects list→

ArgumentTypeDescription
ID:realThe instance ID or object_index to destroy (optional, default is the calling instance)

Example, called from article1_update.gml:

// destroys articles outside of bottom room border:
if (y > room_height + 100) {
instance_destroy();
}

Example, called from update.gml:

// creates and then destroys an instance of article object:
var my_article = instance_create( x, y, "article1" );
// ...
instance_destroy( my_article );

instance_create

Creates a new instance of the specified object.

Available objects list→

ArgumentTypeDescription
x:realThe x position the object will be created at
y:realThe y position the object will be created at
object:stringThe name of the object to create an instance of
script_set:real(optional)
The script set the article uses. This argument is only used when spawning a stage article. Must be at least 0.

Example, called from attack_update.gml:

if (attack == AT_DSPECIAL) {
if (window == 2 && window_timer == 1){
instance_create( x, y, "obj_article1" );
}
}