Bloodbane said:@ned: I have a script which flips enemy when blocked by platform. The script already has height limit when detecting platforms so it could be modified to create auto climb on platform
nedflandeurse said:Do you have used this in some of your technical demo (double dragon or something else?)
I would like to try this code!
anim walk
@script
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int Dir = getentityproperty(self, "direction");
int Sx = 20; // checking distance
int Sy = 115; // checking height
if(Dir==0){
Sx = -20;
}
void Plat = checkplatformbelow(x+Sx, z, y+Sy);
if(Plat){
changeentityproperty(self, "velocity", 0, 0, 0);
performattack(self, openborconstant("ANI_FOLLOW1"));
}
@end_script
...
Script error: data/chars/rachel/rachel.txt, line 6539: Unknown error 'void' (in production 20)
void Plat = checkplatformbelow(x+Sx, z, y+Sy);
^
Script compile error in 'animationscript': Plat line 6539, column 9
anim walk
@script
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int Dir = getentityproperty(self, "direction");
int Sx = 20;
int Sy = 115;
void Plat;
if(Dir==0){
Sx = -Sx;
}
Plat = checkplatformbelow(x+Sx, z, y+Sy);
if(Plat){
changeentityproperty(self, "velocity", 0, 0, 0);
performattack(self, openborconstant("ANI_FOLLOW1"));
}
@end_script
...
Bloodbane said:That's strange... but try changing the script to this:
Code:anim walk @script void self = getlocalvar("self"); int x = getentityproperty(self, "x"); int y = getentityproperty(self, "a"); int z = getentityproperty(self, "z"); int Dir = getentityproperty(self, "direction"); int Sx = 20; int Sy = 115; void Plat; if(Dir==0){ Sx = -Sx; } Plat = checkplatformbelow(x+Sx, z, y+Sy); if(Plat){ changeentityproperty(self, "velocity", 0, 0, 0); performattack(self, openborconstant("ANI_FOLLOW1")); } @end_script ...
anim FOLLOW15 # (WALKOFF)
idle 1 #like idle anim you can iterrupt it
landframe 3
loop 1
delay 12
offset 50 87
bbox 44 24 26 42
frame data/chars/leo/walkoff01.gif
bbox 29 29 31 39
frame data/chars/leo/walkoff02.gif
bbox 25 31 31 37
frame data/chars/leo/walkoff03.gif
bbox 30 30 34 39
frame data/chars/leo/walkoff02.gif