esn23
Active member
I was wondering if i could get my enemies to come after me when i jump up on platforms and such.. Here is my example..
Im on top of the barrels, they just attack the barrels and run into them... I want them to be able to chase after me and get on barrels too.. I had a script that was supposed to do it am i using it worng...
anim walk
@script
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");
int z = getentityproperty(self, "z");
int Dir = getentityproperty(self, "direction");
int Sx = 50; int Py; int PH;
if(Dir==0){
Sx = -50;
}
void Plat = checkplatformbelow(x+Sx, z, y+40);
if(Plat){
PH = getentityproperty(Plat, "grabforce");
Py = getentityproperty(Plat, "a");
if(Py+PH <= b+40 && Py >= b){
changeentityproperty(self, "velocity", 0, 0, 0);
performattack(self, openborconstant("ANI_FOLLOW8"));
}
}
@end_script
bbox 51 45 24 48
offset 67 114
loop 1
delay 20
frame data/chars/primefem/w1.png
frame data/chars/primefem/w2.png
frame data/chars/primefem/w3.png
anim follow8
delay 3
offset 75 153
landframe 5
jumpframe 1 4 1 0
drawmethod 256 256 0 0 0 6 0 0 0 0
sound data/chars/emma/fireball.wav
frame data/chars/primefem/tel1.png
frame data/chars/primefem/tel2.png
frame data/chars/primefem/tel1.png
frame data/chars/primefem/tel2.png
frame data/chars/primefem/tel3.png
frame data/chars/primefem/a4-2.png
and here is my platform
name tin
type obstacle
onspawnscript data/scripts/carspawn.c
projectilehit enemy obstacle
cantgrab 1
antigrab 31 # platform width
grabforce 35 # platform height
knockdowncount 9999
nodrop 2
falldie 1
anim idle
loop 0
offset 18 51
delay 10
platform 18 51 0 0 38 53 0 51
frame data/bgs/subway/tin.png
anim walk
@script
void self = getlocalvar("self"); //Get calling entity.
changeentityproperty(self, "velocity", 0, 0);
setidle(self, openborconstant("ANI_IDLE"));
@end_script
delay 10
offset 18 51
bbox 19 36 34 33
platform 18 51 0 0 38 53 0 51
frame data/bgs/subway/tin.png
frame data/bgs/subway/tin.png
TY for the help
Im on top of the barrels, they just attack the barrels and run into them... I want them to be able to chase after me and get on barrels too.. I had a script that was supposed to do it am i using it worng...
anim walk
@script
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int b = getentityproperty(self, "base");
int z = getentityproperty(self, "z");
int Dir = getentityproperty(self, "direction");
int Sx = 50; int Py; int PH;
if(Dir==0){
Sx = -50;
}
void Plat = checkplatformbelow(x+Sx, z, y+40);
if(Plat){
PH = getentityproperty(Plat, "grabforce");
Py = getentityproperty(Plat, "a");
if(Py+PH <= b+40 && Py >= b){
changeentityproperty(self, "velocity", 0, 0, 0);
performattack(self, openborconstant("ANI_FOLLOW8"));
}
}
@end_script
bbox 51 45 24 48
offset 67 114
loop 1
delay 20
frame data/chars/primefem/w1.png
frame data/chars/primefem/w2.png
frame data/chars/primefem/w3.png
anim follow8
delay 3
offset 75 153
landframe 5
jumpframe 1 4 1 0
drawmethod 256 256 0 0 0 6 0 0 0 0
sound data/chars/emma/fireball.wav
frame data/chars/primefem/tel1.png
frame data/chars/primefem/tel2.png
frame data/chars/primefem/tel1.png
frame data/chars/primefem/tel2.png
frame data/chars/primefem/tel3.png
frame data/chars/primefem/a4-2.png
and here is my platform
name tin
type obstacle
onspawnscript data/scripts/carspawn.c
projectilehit enemy obstacle
cantgrab 1
antigrab 31 # platform width
grabforce 35 # platform height
knockdowncount 9999
nodrop 2
falldie 1
anim idle
loop 0
offset 18 51
delay 10
platform 18 51 0 0 38 53 0 51
frame data/bgs/subway/tin.png
anim walk
@script
void self = getlocalvar("self"); //Get calling entity.
changeentityproperty(self, "velocity", 0, 0);
setidle(self, openborconstant("ANI_IDLE"));
@end_script
delay 10
offset 18 51
bbox 19 36 34 33
platform 18 51 0 0 38 53 0 51
frame data/bgs/subway/tin.png
frame data/bgs/subway/tin.png
TY for the help