enemy stuck inside platforms and obstacles

jonsilva

New member
hello
ive notice enemies no longer jump on top of platforms
the way an enemy jumps to a wall doesn't seem to work on platforms and obstacles
in the manual in animation jump it stakes
Plays when a player presses jump or when an enemy approaches a platform.

is there a command to and to jump animation to make enemies jump on top of platforms ?
I have enemies all over the game spawning inside obstacles and getting stuck walking behind obstacle...

 
Did you have changed to a newer Openbor build to have this problem?
-Just asking, I don't pretend to know a solution about builds problem
 
the way an enemy jumps to a wall doesn't seem to work on platforms and obstacles

That's true. JUMP animation for enemies only work on walls

is there a command to and to jump animation to make enemies jump on top of platforms ?

Only with script though and you need some workaround to check platform's height after acquiring platform entity with checkplatformbelow . Or you can just make enemy jump if platform is found within defined range (crude but works well if you don't have overlapping platforms)
 
ive made this script... don't know if its the best way
but it seems to be working
@script
  void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int a = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
int Dir = getentityproperty(self, "direction");
int Sx = 10;  //----distance from platform
int jp = 1;  //----jump velocity
float Hy;

    if(Dir==0){
      Sx = -10;
      jp = -1;
    }

  Hy = checkplatformbelow(x+Sx,z, 70);

  if(Hy > 1 && a <= 7)
  {
    performattack(self,openborconstant("ANI_JUMP"));
    tossentity(self, 4, jp, 0);
  }
@end_script
 
Well, this line:

Code:
Hy = checkplatformbelow(x+Sx,z, 70);

Value you get for Hy is entity handle for platform you found below defined coordinate. The value will simply be empty if no platform is found. So this line also work:

Code:
...
if(Hy && a <= 7)
...
 
Back
Top Bottom