check the edge of the platform , it is possible ? help

monomartin

Active member
checks the distance to the edge of the platform and change the animation, is that possible?
http://s2.subirimagenes.com/imagen/previo/thump_9626414ejemo.gif

thump_9626414ejemo.gif
[/URL][/img]
 
nedflandeurse said:
I don't want it to be done from run
Ex : run from far, contact with ring -> NO climb to the ring

I think Beastie's suggestion for using Foward+Attack is easier and much easier to do in game. OTOH F F is more likely to trigger run instead of climb platform so even if it could be coded, you might have conflict with run

Can you get rid of it by using Y position stuff?

I know the problem, give me time to fix it :)

[couple hours later]

I've updated the script to this:

Code:
anim	walk
@script
    void self = getlocalvar("self");
    int x = getentityproperty(self, "x");
    int y = getentityproperty(self, "a");
    int z = getentityproperty(self, "z");
    int Dir = getentityproperty(self, "direction");
    int Sx = 36;
    int Sy = 80;

    if(Dir==0){
      Sx = -Sx;
    }

    void Plat = checkplatformbelow(x+Sx, z, y+Sy);

    if(Plat){
      int Ph = getentityproperty(Plat, "grabforce");
      int Py = getentityproperty(Plat, "a");

      if(Ph+Py-y <= Sy && Ph+Py > y){
        changeentityproperty(self, "velocity", 0, 0, 0);
        performattack(self, openborconstant("ANI_FOLLOW1"));
      }
    }
@end_script
...

However, this script only work properly if you set platform's height with grabforce. If your obstacle/platform's height is 100, then set grabforce 100 in its header
 
I think Beastie's suggestion for using Foward+Attack is easier and much easier to do in game. OTOH F F is more likely to trigger run instead of climb platform so even if it could be coded, you might have conflict with run

It could also work by using the invisible area and detecting the current animation.  So you can still fight near that area, but running/walking into the right spot triggers the climbing into the ring animation.
 
Thanks for your reply guys.
This is a lot of stuffs!

I'll give it a try.

So, if I understand well, in order to make the script working correctly, I have to put a grab force value on the platform/obstacle using the same value as the height?

I'm thinking of something.
Perhaps, I'll make it possible only for the ring and no other obstacles.

I'll try various things, and ladder system as well and see what works the best. :)
 
Back
Top Bottom