Solved Wall check change animation

Question that is answered or resolved.

dantedevil

Well-known member
It's aniway to create a script for check distance to wall, then change the animation.

I want use for the Raiden torpedo, when he hit a enemy, pushes him to the edge of the screen, and then released.

The problem is when a wall is in front because the Raiden torpedo flying in front of the wall with the enemy gabbed, when realese the enemy sometime pass through the wall.
I try setting the antiwall script, but in this animation always fail.

With a script for check wall and change with a certain animation the problem is solved, because Raiden release the enemy crushing with the wall.
This way look much better.
 
void wallhit2(int Dist, void Ani)
{// Checks if there is wall/plat at defined distance change animation
  void self = getlocalvar("self");

  int x = getentityproperty(self, "x");
  int z = getentityproperty(self, "z");

  float H = checkwall(x+Dist,z);
  float Hy = checkplatformbelow(x+Dist,z, 5000);

  if(H > 0 || Hy > 1)
  {
  performattack(self, openborconstant(Ani));
  }
}

------------//---------
@cmd wallhit2 70 "ANI_FOLLOW15"
--------//-------

this will check a wall and platform and change animation
but its better to leave the distance below 70 in the platform case other wise there will be an empty space when you re 0 pixel far from platform you need to move back for the script check the platform...
if you don't want the platform you can remove the lines (Hy) in the script...

 
Back
Top Bottom