Cant get enemies to jump onto walls

ABK

Well-known member
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.
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
 
I remember this driving me crazy i had a fake wall and the enemy would not jump on it i managed to get it working in the end but i can not remember what i had to do.

I will track it down the enemy file and post the solution i found.


Edit: sorry i could only get enemy to jump on the wall from front or back too.
 
bWWd said:

To jump onto a wall along Z axis, all you have to do is enable the Z jumping flag in the model's jump settings. It will take care of the rest. I used to have a manual scripted version, but it's not needed at all.

One thing though - the AI will never jump ONLY along Z axis. It always attempts a diagonal X & Z jump instead. So it's possible for it to whiff by platforms if they are narrow along the X axis. If you want a straight jump that only covers Z space, then you will have to do it with script. It isn't nearly as complicated as you've made it though. Just an onblockz event coupled with jumping animation of your choice will do. Or in the jump itself, look for any Z movement, and if there is any, stop all X movement. That would be even simpler actually.

DC
 
Back
Top Bottom