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!!!
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!!!