Help with floating after jump

Skull Kingz

Active member
Wassup everyone, I need help with trying to make my character float/land slowly. Best example gameplay wise that I can think of is Super Mario with his cape on Super Mario World. How can I mimic that?


Sorry, I'm on mobile right now.
 
I usually use functions for this but to simplify my answer, this will do:

anim freespecial
@script
  if(frame==1){
    void self = getlocalvar("self");
    changeentityproperty(self, "antigravity", Ratio);
  }
  if(frame==2){
    void self = getlocalvar("self");
    changeentityproperty(self, "antigravity", Ratio);
  }
@end_script
...

This script will alter gravity in second frame and in third frame. Change defined frame to suit your animation
Replace Ratio with desired value
 
a custom animation script would be better suited for this.

I was thinking to use stop then floater for anti gravity then dasher with a small value like 0.1 to float down.
 
Honestly? I'm reworking the mod you helped me with before.  :-[
I've removed the ladders because a key component to some of the planned game play, required the ability to attack and jump to, and from, ladders/ropes/chains/etc. I did keep the ability to wall jump, but it had to be changed.  It's wouldn't be a useful feature if it can't work with both walls, platforms, and other entities. Especially since i'm using breakable platforms.  As such, It made sense at the time to break the wall/platform  jump down into parts:

1. regular jump, then -
2. freespecial#X in-air (collision detector), then -
3. follow anim wall grab/land (ONLY IF freespecial#X connects to wall/platform/enemy/etc) Press J during this anim to cancel into -
4. freespecial#Y wall jump facing opposite direction. (press Jump to cancel into freespecial#X again.)
    If walls/platforms are close enough together,  a wall jumping character can reach areas that a double jumping character cannot.

What I'm trying to do is have the character stick to the wall for the duration of the delay, of only the first frame, of the follow anim. If J is pressed while the character is still in that first frame, they will perfom the freespecial#Y wall jump. If J is not pressed, the character will perform the remainder of its follow anim instead. Letting go of the wall, and falling straight down.

The problems I'm having right now are that:
A - follow anim wall grab immediately slides downward at normal fall speed. I'd like him to just stick for a moment.
B - wall/platform jumping from a previous wall/platform jump does not work anymore. freespecial#X does connect into its follow anim, but pressing J
      again will not cancel into freespecial#Y.

 
Oh sorry, I thought you were talking about new mod
Anyways, I've updated that mod and wall jump works better now i.e it can be performed against platforms as well :D
Check your PM

For others, Vyck's problem can be solved with this function:

Code:
void floater(int Time )
{// Floats in Time centiseconds
    void self = getlocalvar("self");
    int eTime = openborvariant("elapsed_time");

    changeentityproperty(self, "tosstime", eTime + Time*2);
}

This function will make caller unaffected by gravity for defined time (in centiseconds). If the caller is attacked while floating, the FX will be gone
It's much cleaner than altering gravity
 
Bloodbane said:
One way I know is to alter antigravity during floating then reset antigravity after landing (in any way) with script
isn't this really dangerous? I fiddled with it on MFA mod, but while it does seem to produce the best looking results, I had to toggle gravity back on on a lot of animations, like cancels, and getting hit mid air... there were just too many loopholes to be effective. I'd love to see it work though.
 
Yes, it is unstable. If you really insist, resetting antigravity could be done with script in takedamagescript and keyscript

[couple hours later]

I decided to think outside the box and look for alternate solutions. After some trial n errors, I got a simple and great solution. Instead of toying with unstable antigravity, I played with velocity instead, here's an example:

anim freespecial
loop 1 3 7
cancel 0 5 0 a2 freespecial2
cancel 0 5 0 a4 freespecial3
delay 13
sound data/sounds/jump.wav
offset  114  114
bbox  107  71  12  22
@cmd keyglide 0.1
frame data/chars/char/31.gif
@cmd keyglide 0.1
frame data/chars/char/32.gif
@cmd keyglide 0.1
frame data/chars/char/33.gif
@cmd keyglide 0.1
frame data/chars/char/34.gif
@cmd keyglide 0.1
frame data/chars/char/35.gif
@cmd keyglide 0.1
frame data/chars/char/36.gif #
@cmd keyglide 0.1
frame data/chars/char/33.gif
@cmd keyglide 0.1
frame data/chars/char/34.gif
@cmd keyglide 0.1
frame data/chars/char/35.gif
@cmd keyglide 0.1
frame data/chars/char/36.gif #

This Charlotte Aurin's double jump animation. The added functions allow her to glide in this animation by holding Jump key
keyglide 0.1 means falling velocity is reduced to 0.1 or 10%
That animation is looped to ensure the glide FX works while she's on air
Here's the keyglide function:

Code:
void keyglide(float Ratio)
{// Floats hero if Jump button is held or released
    void self = getlocalvar("self");
    int iPIndex = getentityproperty(self,"playerindex"); //Get player index
    void iRKey = playerkeys(iPIndex, 0, "jump");
    float Vy = getentityproperty(self,"tossv");

    if(iRKey && Vy < 0){// Jump is held?
      changeentityproperty(self, "velocity", NULL(), NULL(), Vy*Ratio);
    }
}
 
Back
Top Bottom