Weird script doesn't work.......

xyz555

Member
I have a script , it detects the appearance of four different entities, self will go to different follow.

anim idle
@script
{


void i=0;
for(i=0; i<openborvariant("ent_max"); i++) {
void ent = getentity(i);
if((getentityproperty(ent,"exists"))
&& (!getentityproperty(ent,"dead"))
&& (getentityproperty(ent,"TYPE") == openborconstant("TYPE_NONE"))
&& (getentityproperty(ent,"model") == "zhangfei-waiting")) {
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW1"));

}
}
void i=0;
for(i=0; i<openborvariant("ent_max"); i++) {
void ent = getentity(i);
if((getentityproperty(ent,"exists"))
&& (!getentityproperty(ent,"dead"))
&& (getentityproperty(ent,"TYPE") == openborconstant("TYPE_NONE"))
&& (getentityproperty(ent,"model") == "guanyu-waiting")) {
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW2"));

}
}
void i=0;
for(i=0; i<openborvariant("ent_max"); i++) {
void ent = getentity(i);
if((getentityproperty(ent,"exists"))
&& (!getentityproperty(ent,"dead"))
&& (getentityproperty(ent,"TYPE") == openborconstant("TYPE_NONE"))
&& (getentityproperty(ent,"model") == "huangzhong-waiting")) {
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW3"));

}
}

void i=0;
for(i=0; i<openborvariant("ent_max"); i++) {
void ent = getentity(i);
if((getentityproperty(ent,"exists"))
&& (!getentityproperty(ent,"dead"))
&& (getentityproperty(ent,"TYPE") == openborconstant("TYPE_NONE"))
&& (getentityproperty(ent,"model") == "zhaoyun-waiting")) {
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW4"));

}
}

void self = getlocalvar("self");
changeentityproperty(self,"direction",1);
changeentityproperty(self, "map", 1);
}@end_script
unsummonframe 0
custentity zhaoyun-name
summonframe 0 56 78 0 1
loop 1
delay 1
OffSet 1 1
frame data/bgs/black/zhaoyun-waiting.gif
frame data/bgs/black/zhaoyun-waiting.gif

The first entity ("zhangfei-waiting")
and the second ("guanyu-waiting")
The third ("huangzhong-waiting") entity, its detection is working fine


But to the fourth ("zhaoyun-waiting") entity. it won't work,
It does not detect ("zhaoyun-waiting") entities........

I spent a lot of time, but I can't find the reason why the fourth entity detection ("zhaoyun-waiting") does not work, so I put the problem here, I hope you can help me, thank you!!!
 
It's hard to tell just from your post. It's also unclear if this entity has FOLLOW4 or not.
You also doesn't tell us if zhaoyun-waiting entity exits in your module or not.

Also your script has plenty of redundancies. Try to make this script efficient.
 
Back
Top Bottom