L
LawH
Guest
I'm not sure if posting my code will help, but here:
{if obj_spear.image_index > 6 && obj_spear.image_index < 8{
if place_meeting(x,y,obj_spear) == true {
obj_p1.att_ID = ID
if obj_p1.total_av > dv + ini_enum.hit.sure && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
dead = 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.easy && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
wound += 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.average && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
cut += 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.difficult && obj_p1.att_ID = ID {
// instance_create(x,y,obj_bloodsmall)
cut += 1;
obj_p1.att_ID = 0;
}
}
}}
So what is happening here should be, that once I pick up a spear and have it in my hand, and attack this object, this code will run. The problem is, that luckily I placed two spears from earlier tests, and for some reason, the other spear works, but the other does not. I have not yet added a generalized attack for all weapons, because I am still testing this out, so that is why I specify the spear as the object that checks the collision event. I will make it a parent thing once I get this to work.
I don't understand why attacks only work with the other spear, but not the other one. Even if I pick the other spear up first, it still does not work. Any ideas on why this could be?
{if obj_spear.image_index > 6 && obj_spear.image_index < 8{
if place_meeting(x,y,obj_spear) == true {
obj_p1.att_ID = ID
if obj_p1.total_av > dv + ini_enum.hit.sure && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
dead = 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.easy && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
wound += 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.average && obj_p1.att_ID = ID {
instance_create(x,y,obj_bloodsmall)
cut += 1;
obj_p1.att_ID = 0;
}
else if obj_p1.total_av > dv + ini_enum.hit.difficult && obj_p1.att_ID = ID {
// instance_create(x,y,obj_bloodsmall)
cut += 1;
obj_p1.att_ID = 0;
}
}
}}
So what is happening here should be, that once I pick up a spear and have it in my hand, and attack this object, this code will run. The problem is, that luckily I placed two spears from earlier tests, and for some reason, the other spear works, but the other does not. I have not yet added a generalized attack for all weapons, because I am still testing this out, so that is why I specify the spear as the object that checks the collision event. I will make it a parent thing once I get this to work.
I don't understand why attacks only work with the other spear, but not the other one. Even if I pick the other spear up first, it still does not work. Any ideas on why this could be?