S
Squirtle Plays
Guest
when I attack this happens
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object object0:
local variable hitID(100004, -2147483648) not set before reading it.
at gml_Script_PlayerState_Attack_Stab (line 23) - if (ds_list_find_index(hitByAttack,hitID) == -1)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_PlayerState_Attack_Stab (line 23)
called from - gml_Object_object0_Step_0 (line 66) - case PLAYERSTATE.ATTACK_STAB: PlayerState_Attack_Stab(); break;
heres my code
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object object0:
local variable hitID(100004, -2147483648) not set before reading it.
at gml_Script_PlayerState_Attack_Stab (line 23) - if (ds_list_find_index(hitByAttack,hitID) == -1)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_PlayerState_Attack_Stab (line 23)
called from - gml_Object_object0_Step_0 (line 66) - case PLAYERSTATE.ATTACK_STAB: PlayerState_Attack_Stab(); break;
heres my code
Code:
hspeed = 0;
vspeed = 0;
//Start of the attack
if (sprite_index != sprite6)
{
sprite_index = sprite6;
image_index = 0;
ds_list_clear(hitByAttack);
}
//Use attack hitbox & check for hits
mask_index = sprite61;
var hitByAttackNow = ds_list_create();
var hits = instance_place_list(x,y,object2,hitByAttackNow,false)
if (hits > 0)
for (var i = 0; i < hits; i++)
//if this instance has not yet been hit by this attack
var hitID = hitByAttackNow[| i];
if (ds_list_find_index(hitByAttack,hitID) == -1)
ds_list_add(hitByAttack,hitID);
with (hitID)
ds_list_destroy(hitByAttackNow);
mask_index = sprite01;
if (Animation_End())
{
sprite_index = sprite01;
state = PLAYERSTATE.FREE;
}