Jump to content

Photo

Jump with button script...


  • Please log in to reply
19 replies to this topic

#16 Joe123

Joe123

    Retired

  • Members

Posted 24 January 2008 - 04:57 PM

Oh yeah, well what you'd do is just script it so that when you press the L button, Link's upwards acceleration is set to 1 for a few frames, then leave it for the game to set it untill he hits the floor.

It's probably what C- did, and it's much simpler than any of that 'trying to make him use the Roc's Feather' nonsense.

#17 LostInHyru1e

LostInHyru1e

    Can you take me as far as PureZC?

  • Members
  • Real Name:Lost
  • Location:Refer to Screename

Posted 24 January 2008 - 04:58 PM

Shows how little I know about scripting. icon_smile.gif

#18 Joe123

Joe123

    Retired

  • Members

Posted 24 January 2008 - 05:00 PM

Heh icon_shrug.gif

No-one knows anything about anything before they start learning, I knew nothing in september of scripting.

Edited by Joe123, 24 January 2008 - 05:00 PM.


#19 ElLibertador

ElLibertador

    Love and Peace

  • Members

Posted 24 January 2008 - 05:36 PM

Thanks anyway. I don't really like C's script because it doesn't fit Mario. I'll just live with an equipable jump.

Edited by LinkMystro, 24 January 2008 - 05:37 PM.


#20 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 27 January 2008 - 10:25 AM

Is it really that hard to do? You only need 1 line of code to make Link jump. Then just a few more to make sure Link can't Jump in midair.
This would be the whole script:
CODE
global script Jump {

    void run() {

        //This variable you from jumping constantly from holding L down.
        bool noJumpRep = false;

        while(true) {

            //this part checks solidity and button presses
            if(Link->InputL && (isSolid(Link->X+4,Link->Y+16) || isSolid(Link->X+12,Link->Y+16)) && !noJumpRep) {

                Link->Jump = 3; //a jumping power of 3 should get about 2-1/2 tiles
                Game->PlaySound(45);
                noJumpRep = true;

            } else if(Link->InputL) {

                //this prevents you from jumping constantly from holding L down.
                noJumpRep = true;

            }
            //This allows Link to jump again
            if(noJumpRep && !(Link->InputL))
                noJumpRep = false;
        }
    }
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users