Jump to content

Photo

Better Jumping?


  • Please log in to reply
3 replies to this topic

#1 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 27 November 2017 - 03:26 PM

When you jump in ZC with the feather, Link always jumps the same height. I'm wondering if it is possible to make a scripted jump that works more like jumping in Mario or any platformer where the length of the button press determines the height, and if you keep it pressed you reach your max height. Releasing the button before this height stops vertical movement and drops you back down. The max height in question is two tiles, or 32 pixels.

Has anyone made something like this? If not, oh well, it's not a huge deal, it's just a quality of life thing that's likely more complicated than it needs to be.

Thanks. :)

#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 27 November 2017 - 03:49 PM

In a sidescroller this would make it better, yeah. In a top-down view zelda i don't see it working well. But yeah, this should be rather simple to script, although lots of fine-tuning should go into it.


Edited by Avataro, 27 November 2017 - 03:50 PM.


#3 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 27 November 2017 - 04:11 PM

Oh, I should have mentioned, this will be in top-down view. :P

I see no reason why I couldn't use it in 2D sections, but I didn't really plan on having those.

Would this need to be a global script, or could it be an active item script?

#4 Saffith

Saffith

    IPv7 user

  • Members

Posted 27 November 2017 - 05:26 PM

It could be an item script that launches an FFC script, or it could be an item script and a global script working together. The way it's generally done is simply to immediately cut the jump value to 0 (or something close to 0) when the button is released.

Here's an untested version using ffcscript.zh. B button only. D0 is the value to cap Jump at when the button is released. If 0's too stiff, maybe try 0.2 or 0.3. I'm not sure what would be a good range, but probably not above 1.
item script HoldJump_item
{
    void run(float cap)
    {
        float args[]={ cap };
        int scriptName[]="HoldJump_ffc";
        RunFFCScript(Game->GetFFCScript(scriptName), args);
    }
}

ffc script HoldJump_ffc
{
    void run(float cap)
    {
        this->Flags[FFCF_CARRYOVER]=true;
        
        while(Link->Jump>cap)
        {
            if(!Link->InputB)
            {
                Link->Jump=cap;
                break;
            }
            Waitframe();
        }
        
        this->Flags[FFCF_CARRYOVER]=false;
    }
}

  • ShadowTiger and Anthus like this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users