» Uncategorized Posts

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" );
}
}

Hit Effects

Hit effects are animations that play in a specific position for a set amount of time. The game has many built-in visual effects, but you can also create your own.


You can create an effect from a custom sprite using

hit_fx_create( sprite_index, animation_length )  Reference→

and then either assign it to the hitbox grid by calling

set_hitbox_value( attack, hitbox, index, value )  Reference→

or manually spawn it:

spawn_hit_fx( x, y, hit_fx_index )  Reference→


You can also access the hit_fx_object directly to change the following variables:

Variable Description
hit_fx The index of the hit effect.
pause_timer Set to 0 to pause the effect
pause The amount of frames to pause when you set pause_timer to 0
draw_angle The angle at which to draw the effect
spr_dir The direction the effect is facing
1 = right
-1 = left

Hitbox Grid Indexes

Manual HomeProgramming

These values affect the properties of a specific hitbox. Using these indexes to set values will only apply the values once the hitbox is created. To change the properties of a hitbox after it has been created, you will have to manually edit the variables of the pHitBox object (noted in the pHitBox Variable column).

To help place origins correctly, use the Rivals Workshop Helper.

Index pHitBox Variable Description
HG_PARENT_HITBOX If HG_PARENT_HITBOX is anything other than 0, then it will inherit all values from the hitbox with index: HG_PARENT_HITBOX for all properties except the following

HG_HITBOX_TYPE type 1 = Physical attack
2 = Projectile
HG_WINDOW The attack window in which the hitbox is created
HG_WINDOW_CREATION_FRAME The frame in which the hitbox is created, relative to the start of the attack window
HG_LIFETIME length The duration of the hitbox, in frames
HG_HITBOX_X x_pos The x position of the center of the hitbox, relative to the center of the player
HG_HITBOX_Y y_pos The y position of the center of the hitbox, relative to the bottom of the player
HG_WIDTH image_xscale*200 The width of the hitbox, in pixels
HG_HEIGHT image_yscale*200 The height of the hitbox, in pixels
HG_SHAPE sprite_index 0 = Circle (hitbox_circle_spr)
1 = Rectangle (hitbox_square_spr)
2 = Rounded Rectangle (hitbox_rounded_rectangle)
HG_PRIORITY hit_priority Ranges from 1 to 10, with a priority 10 hitbox taking priority over a priority 1 hitbox if both hit at the same time
HG_DAMAGE damage The damage dealt by the hitbox
HG_ANGLE kb_angle The angle at which the hitbox sends opponents. 0 is straight horizontally forward, 90 is upward, 270 is downward. A value of 361 will send at 45 for aerial opponents and 40 for grounded opponents. Can be overwritten or modified by HG_ANGLE_FLIPPER
HG_BASE_KNOCKBACK kb_value The amount of knockback the move applies to an opponent regardless of their damage
HG_KNOCKBACK_SCALING kb_scale The amount of knockback to add to HG_BASE_KNOCKBACK relative to the opponent’s damage
HG_EFFECT effect 1 = Burn
2 = Burn consume

3 = Burn stun (extra hitpause on burning opponents. Used to guarantee the final hit on Zetterburn’s empowered strong attack)
4 = Wrap
5 = Freeze
6 = Mark
8 = Auto Wrap
9 = Polite (only deals hitstun if already in hitstun)
10 = Poison
11 = Plasma Stun
12 = Crouch armors through it

HG_BASE_HITPAUSE hitpause The amount of hitpause the move applies to an opponent regardless of their damage
HG_HITPAUSE_SCALING hitpause_growth The amount of hitpause to add to HG_BASE_HITPAUSE relative to the opponent’s damage
HG_VISUAL_EFFECT hit_effect The visual effect to create when the hitbox hits something
HG_VISUAL_EFFECT_X_OFFSET hit_effect_x Normally, the visual effect is created between the center of the hitbox and the opponent’s position. The value here adds an offset to the center of the hitbox in that calculation
HG_VISUAL_EFFECT_Y_OFFSET hit_effect_y Normally, the visual effect is created between the center of the hitbox and the opponent’s position. The value here adds an offset to the center of the hitbox in that calculation
HG_HIT_PARTICLE_NUM fx_particles The hit particle slot to use. Should be between 1 and 6 for custom particles. 0 will use normal hit particles.
HG_HIT_SFX sound_effect The index of the sound effect to play when the attack hits
HG_ANGLE_FLIPPER hit_flipper 0 = Sends at the exact knockback_angle every time
1 = Sends away from the center of the enemy player
2 = Sends toward the center of the enemy player
3 = Horizontal knockback sends away from the center of the hitbox
4 = Horizontal knockback sends toward the center of the hitbox
5 = Horizontal knockback is reversed
6 = Horizontal knockback sends away from the enemy player
7 = Horizontal knockback sends toward the enemy player
8 = Sends away from the center of the hitbox
9 = Sends toward the center of the hitbox
HG_EXTRA_HITPAUSE extra_hitpause Extra hitpause to apply to the opponent only. Can be negative
HG_GROUNDEDNESS groundedness 0 = Can hit both aerial and grounded opponents
1 = Can only hit grounded opponents
2 = Can only hit aerial opponents
HG_EXTRA_CAMERA_SHAKE camera_shake -1 = No camera shake
0 = Normal camera shake. Only applied if knockback speed is above 1
1 = Force camera shake, even if knockback speed is lower than 1
HG_IGNORES_PROJECTILES proj_break 0 = Can break projectiles
1 = Cannot break projectiles
HG_HIT_LOCKOUT no_other_hit The number of frames after this hitbox connects where another hitbox belonging to the same player cannot hit the opponent
HG_EXTENDED_PARRY_STUN When this hitbox is parried, the amount of parry stun inflicted on the opponent will be relative to the distance between you
HG_HITBOX_GROUP hbox_group Only one hitbox per group can hit an opponent until the attack ends. This can be overwritten by calling attack_end() to manually reset all hitbox group flags. Hitboxes in group -1 can always hit an opponent. Projectiles always belong to group -1
HG_HITSTUN_MULTIPLIER hitstun_factor The value by which hitstun is multiplied after being calculated normally. A value of 0 results in default hitstun (the same as a value of 1)
HG_DRIFT_MULTIPLIER dumb_di_mult Causes the acceleration of the opponent’s drift DI to be multiplied by this value
HG_SDI_MULTIPLIER sdi_mult-1 Causes the distance of the opponent’s SDI to be multiplied by this value.
HG_TECHABLE can_tech 0 = Can tech
1 = Cannot tech
2 = Goes through platforms (used by Etalus Uair)
3 = Cannot tech or bounce
HG_FORCE_FLINCH force_flinch 0 = Does not force flinch
1 = Forces grounded opponents to flinch
2 = Cannot cause opponents to flinch
3 = Causes crouching opponents to flinch
HG_FINAL_BASE_KNOCKBACK bkb_final If this is greater than 0, the base knockback of the hitbox will progress linearly from HG_BASE_KNOCKBACK to HG_FINAL_BASE_KNOCKBACK over the span of the hitbox’s lifetime
HG_THROWS_ROCK throws_rock 0 = Breaks rock
1 = Throws rock
2 = Ignores rock

Projectile-Only Properties

These values only affect the hitbox if the HG_HITBOX_TYPE property is 2.

Index pHitBox Variable Description
HG_PROJECTILE_SPRITE sprite_index The sprite to loop for the projectile’s animation
HG_PROJECTILE_MASK mask_index The sprite to use for the projectile’s collision (uses precise collision). Set to -1 to use normal hitbox collision with HG_SHAPE
HG_PROJECTILE_COLLISION_SPRITE collision_sprite The sprite used for colliding with terrain only. Defaults to 0, in which case it will use the sprite_index instead.
HG_PROJECTILE_ANIM_SPEED img_spd The speed at which the projectile’s sprite will animate
HG_PROJECTILE_HSPEED hsp The initial horizontal speed of the projectile in pixels per frame
HG_PROJECTILE_VSPEED vsp The initial vertical speed of the projectile in pixels per frame
HG_PROJECTILE_GRAVITY grav The downward acceleration applied to the projectile every frame
HG_PROJECTILE_GROUND_FRICTION frict The decrease in horizontal speed per frame when the projectile is grounded
HG_PROJECTILE_AIR_FRICTION air_friction The decrease in horizontal speed per frame when the projectile is aerial
HG_PROJECTILE_WALL_BEHAVIOR walls 0 = Stops at walls
1 = Goes through walls
2 = Bounces off walls
HG_PROJECTILE_GROUND_BEHAVIOR grounds 0 = Stops at ground
1 = Goes through ground
2 = Bounces off ground
HG_PROJECTILE_ENEMY_BEHAVIOR enemies 0 = Stops at enemies
1 = Goes through enemies
HG_PROJECTILE_UNBASHABLE unbashable Whether a projectile can be caught by Ori’s bash
HG_PROJECTILE_PARRY_STUN projectile_parry_stun Whether parrying the projectile will cause the owner to go into parry stun or not
HG_PROJECTILE_DOES_NOT_REFLECT does_not_reflect If true, the projectile will not reflect or change ownership when parried
HG_PROJECTILE_IS_TRANSCENDENT transcendent If true, the projectile will not be breakable by other hitboxes
HG_PROJECTILE_DESTROY_EFFECT destroy_fx The visual effect to use when the projectile is destroyed
HG_PROJECTILE_PLASMA_SAFE plasma_safe If true, the projectile will not break when inside Clairen’s plasma field.

Hitbox Variables

You can access these variables within the hitbox object. There are additional hitbox variables that correspond to the hitbox grid indexes.

To help place origins correctly, use the Rivals Workshop Helper.

Variable Description
player_id The id of the hitbox’s original owner
player The player number of the hitbox’s current owner (changes when parried)
orig_player The player number of the hitbox’s original owner
attack The attack index of the hitbox
hbox_num The index of the hitbox
hitbox_timer The number of frames the hitbox has been active
destroyed Setting this to true will destroy the hitbox (projectiles only)
was_parried Whether the hitbox has been parried or not
in_hitpause Whether the hitbox is in hitpause or not
proj_angle The angle of rotation applied to a projectile’s sprite
through_platforms When greater than 1, the projectile will not stop at the top of platforms. Decreases by 1 automatically every frame
free Whether the projectile is in the air or not