Crimsondeath
Well-known member
Hi to everyone, I want an NPC change its animation each time a specific enemy is knocked down.
I'm using 'knockdowncount 15' for all my entities, so I wrote this script:
I don't know what I'm doing wrong, but when I use "iKnockdowncount == 15" (Which means that the specific enemy isn't knocked down) the condition is fulfilled (I test it an the NPC show it's animation), but applying any other operator : <, >, != (Which means that the specific enemy is knocked down) the NPC don't do anything (just keep idle).
So, what I want is that the NPC change its animation each time the specific enemy is knocked down
.
Thanks.
I'm using 'knockdowncount 15' for all my entities, so I wrote this script:
Code:
anim idle
loop 1
delay 1
offset 1 1
@script
if(frame == 1){
void vEntity;
int iEntity;
char iName;
int iMax = openborvariant("count_entities");
int iKnockdowncount;
void self = getlocalvar("self");
for(iEntity=0; iEntity<iMax; iEntity++){
vEntity = getentity(iEntity);
iName = getentityproperty(vEntity, "name");
iKnockdowncount = getentityproperty(vEntity, "knockdowncount", "current");
if (iName == "Loco_Mat" && iKnockdowncount < 15) { // here is my issue x.x
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
}
}
}
@end_script
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
I don't know what I'm doing wrong, but when I use "iKnockdowncount == 15" (Which means that the specific enemy isn't knocked down) the condition is fulfilled (I test it an the NPC show it's animation), but applying any other operator : <, >, != (Which means that the specific enemy is knocked down) the NPC don't do anything (just keep idle).
So, what I want is that the NPC change its animation each time the specific enemy is knocked down
Thanks.