anim idle
@script
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
void Plat = checkplatformbelow(x, z, y+1);
void PlatA; void PlatB;
int C = 16; // detection range
if(Plat){ // on a platform
if(Dir==1){
PlatA = checkplatformbelow(x+C, z, y+2);
PlatB = checkplatformbelow(x+C, z, y-2);
} else {
PlatA = checkplatformbelow(x-C, z, y+2);
PlatB = checkplatformbelow(x-C, z, y-2);
}
if(PlatA==PlatB){
changeentityproperty(self, "animation", openborconstant("ANI_IDLE2"));
}
}
@end_script
...
anim idle
@script
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int Wall = checkwall(x, z);
int C = 20;
int WallC;
if(Wall>0){ // on a platform
if(Dir==1){
WallC = checkwall(x+C, z);
} else {
WallC = checkwall(x-C, z);
}
if(WallC < y){
changeentityproperty(self, "animation", openborconstant("ANI_IDLE2"));
}
}
@end_script
...
Bloodbane said:However, the bug with this script is for some reason after changing animation, IDLE2 is not played properly. Can't figure out why :-\
I choose to change to another IDLE animation cause usually player can move and act normally in that animation
setidle(self);
changeentityproperty(self, "aiflag", "idling", 1);
setidle(self, openborconstant("ANI_IDLE2"));
nedflandeurse said: