custom fall reactions in OpenBor

NED

Well-known member
Hello,
I have not coded something for several months now due to IRL stuffs.
I think I can possibly go on now. I'm trying to see if this is possible with this engine.
And more importantly, HOW, this can be done.
This is a very very very very very simplified version of what I had initially in my mind. To make it possible to be done without having one more break in my possible future project.

Basically : a fall anim with custom fall reactions based on interactions.
PD73ohB.png


I would really appreciate to have some support and help to code what this mockup shows.

If this is still too ambitious, or if it takes too much of your time, I would understand.
No problem. Thanks for your support.
 
Thanks for the support, guys! You are pure gold!
I hope it will not be too hard for you to adapt this script elements.

Anyway, for my future possible projects, I will definitly use new builds to avoid these kind of problems.
 
I've done some trial n errors and found the solution;
It was simply a change in wallhit2 function into this:

Code:
void wallhit2(int Dist, void Ani)
{// Checks if there is wall/platform at defined distance change animation
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int z = getentityproperty(self, "z");
   float H; float Hy;

   if(Direction == 0){ //Is entity facing left?                 
      Dist = -Dist; //Reverse Dist to match facing
   }

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

   if(H > 0 || Hy){
     changeentityproperty(self, "animation", openborconstant(Ani));
   }
}

Somehow that small change solves the problem :)
 
Bloodbane said:
I've done some trial n errors and found the solution;
It was simply a change in wallhit2 function into this:

Code:
void wallhit2(int Dist, void Ani)
{// Checks if there is wall/platform at defined distance change animation
   void self = getlocalvar("self");
   int Direction = getentityproperty(self, "direction");
   int x = getentityproperty(self, "x");
   int z = getentityproperty(self, "z");
   float H; float Hy;

   if(Direction == 0){ //Is entity facing left?                 
      Dist = -Dist; //Reverse Dist to match facing
   }

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

   if(H > 0 || Hy){
     changeentityproperty(self, "animation", openborconstant(Ani));
   }
}

Somehow that small change solves the problem :)

That's great my friend!
I just tried it and everything works perfect!

Thanks!

nedflandeurse said:
Thanks for the support, guys! You are pure gold!
I hope it will not be too hard for you to adapt this script elements.

Anyway, for my future possible projects, I will definitly use new builds to avoid these kind of problems.

No problem friend, happy to help you.
I just sent you a PM, with the Demo Link updated with all the corrections and with your build.
Everything works perfect!
 
Bloodbane Dantedevil, I just don't know what to say.
Thanks a lot for it! It's great to feel even a small community like ours is really helpful with each others.  :)

I'm giving a try now!
 
Back
Top Bottom