IT looks like it works only when they are in front or behind the wall, it doesnt work if theyre under it or behind it so they wont jump up or down in Z axis, any clue how to solve this? I gave up on making it work straight away with whats hardcoded in jump logic and Im tryin to get my own jump and im detecting player a with enemy a , then if player is higher enemy can jump but this makes him jump even if i performjumpattacks, i dont want that, i set anim ID != constant jump etc but that doesnt help.So i changed anim id to walk, so when player is walking and has higher altitude then it will work but it doesnt work at all and jump (follow7)is not performed.
I would prefer to solve this normally without this kind of scriptarounds, any clue how to do it ?
I have range in jump and it works but like i said - only when enemy is in front or behind you in the same Z axis, if hes a bit too low or high (different z axis) he wont jump, rangez dont help, rangea doesnt helpt too, or maybe im using them wrong, dont know.
Also when im on wall enemies keep attacking me with their attacks like if i was not on the wall at all, thty just stand below me attacking with close attacks, i disabled this by rangea but this should be hardcoded and playuer being on wall taken into consideration by default when enemies attack, only some special attacks should ignore player altitude by script request .
Would be great to see update to enemies logic when player is on wall but for now i have to figure something out.
Code:
@script
void self = getlocalvar("self");
void target = getentityproperty(self, "opponent");
int tary = getentityproperty(target, "a");
int tars = getentityproperty(self, "a");
int aid = getentityproperty(target , "aiflag");
int r = rand()%3;
if(frame == 1 && r == 1){
changeentityproperty( self , "speed", 2.8);
} else if(frame == 1 && r == 2 ){
changeentityproperty( self , "speed", 2.9);
} else if(frame == 1 && r == -1 ){
changeentityproperty( self , "speed", 3.0);
} else if(frame == 1 && r == -2 ){
changeentityproperty( self , "speed", 3.1);
} else if(frame == 1 && r == 0 ){
changeentityproperty( self , "speed", 3.2);
}
if( (frame==3 )&& (tary > tars) && ( aid == "walking") ){
settextobj(1, 370 , 140 , 2, -1, tars , openborvariant("elapsed_time")+400);
settextobj(3, 370 , 440 , 2, -1, tary , openborvariant("elapsed_time")+400);
changeentityproperty( self , "velocity", 0 , 0 , 0 );
performattack(self, openborconstant("ANI_FOLLOW7"));
}
@end_script
I would prefer to solve this normally without this kind of scriptarounds, any clue how to do it ?
I have range in jump and it works but like i said - only when enemy is in front or behind you in the same Z axis, if hes a bit too low or high (different z axis) he wont jump, rangez dont help, rangea doesnt helpt too, or maybe im using them wrong, dont know.
Also when im on wall enemies keep attacking me with their attacks like if i was not on the wall at all, thty just stand below me attacking with close attacks, i disabled this by rangea but this should be hardcoded and playuer being on wall taken into consideration by default when enemies attack, only some special attacks should ignore player altitude by script request .
Would be great to see update to enemies logic when player is on wall but for now i have to figure something out.
Code:
anim jump
loop 0
bbox 0 0 0 0
offset 114 230
delay 6
range -900 900
jumpframe 0 12 4
landframe 11
sound data/sounds/jump.wav
frame data/chars/foot/foj1.gif
frame data/chars/foot/foj2.gif
frame data/chars/foot/foj3.gif
frame data/chars/foot/foj4.gif
frame data/chars/foot/foj5.gif
frame data/chars/foot/foj6.gif
frame data/chars/foot/foj7.gif
frame data/chars/foot/foj8.gif
frame data/chars/foot/foj9.gif
frame data/chars/foot/foj10.gif
frame data/chars/foot/foj11.gif
delay 2
frame data/chars/foot/foj11.gif