R
remmert
Guest
hey,
I have noticed that in one of my object the data is constantly being reset after some bug testing(very long and painful) and even re-writing my whole code again, I found out that the create event is run multiple times. I have no idea how this can be. I tested the other objects in my game and here it does not happen. Are there any setting or functions that can make this happen?
this is my create event code:
thank in advance for you guys help.
Remmert
I have noticed that in one of my object the data is constantly being reset after some bug testing(very long and painful) and even re-writing my whole code again, I found out that the create event is run multiple times. I have no idea how this can be. I tested the other objects in my game and here it does not happen. Are there any setting or functions that can make this happen?
this is my create event code:
Code:
//alarm[0] is ussed for attack delay
//-----zombie variables
hp = 100
moveSpeed = 5 + random(2)
dmg = 20
//------movement variables
myPath = path_add()
followObject = 0
shooterId = noone //stores the id of the human that shot him(first one)
//------squad variables
leader = false // keeps track if he is a leader or not
//creatorId = instance_nearest(x,y,obj_human_dead).killerId //id zombie that killed the human and created this zombie
leaderId = 999 //Id of his leader
show_debug_message("run setup")
leaderZone = 400 // the zone in which followers will attack humans
maxDisLeader = 1000 // farthest he will go away from leader
//state mashiene
enum zombieStates {
idle, //
hunting, //hunts a human
shot, //chases the shooter
called
}
//--checks if the player is calling the zombies
if(instance_exists(obj_player)){
if (obj_player.calling){ // if player is calling set state to called
currentState = zombieStates.called
}else{
currentState = zombieStates.hunting
}
}else{currentState = zombieStates.hunting}
Remmert