Jump to content

Photo

Double Jump


  • Please log in to reply
4 replies to this topic

#1 VideoGameKraz

VideoGameKraz

    Doyen(ne)

  • Members

Posted 05 June 2009 - 11:27 AM

VGK here, and I have a request for all you scripters out there.

I have no experience with scripting, and I needed someone to help me make a script for an item (i.e. Roc's Feather LV2) that will allow Link to jump once, then again in midair. Both jumps could be the same height, maybe the second one could be half or three quarters height. I wouldn't really know how to go about this, although I do plan to learn scripting.

Thanks for the help.

#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 16 June 2009 - 02:42 AM

Okie Dokie Artichokieeee...ahem.sorry.

Give this a shot.

CODE

const int FALSE = 0;const int TRUE = 1;
int height = 5; // adjust this
int dj=0;

item script djump{
void run(){
if(Link->Z=0){dj =FALSE;Link->Jump = height;}
else if ( !dj )
    {  Link->Jump = height; dj =TRUE; }
}}

Edited by Gleeok, 16 June 2009 - 02:43 AM.


#3 Joe123

Joe123

    Retired

  • Members

Posted 16 June 2009 - 04:10 AM

Tut tut Gleeok, 'if(Link->Z=0)'?
And that script looks disgusting, can't you just use a bool?
'!dj' will give you a compiler warning too; this isn't C++ you know.

EDIT:
Oh, and 5's a pretty excessive value to set Link's jump to.

EDIT2:
And for that script to work, you have to use the item while Link's on the floor each time after you jump, which isn't exactly desirable...

#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 19 June 2009 - 05:44 AM


jeez dude, alright, alright.

CODE


int height = 3; // adjust this
bool dj;

item script djump{
void run(){
if(Link->Z==0 || Link->Jump == 0){dj =false;Link->Jump = height;}
else if ( !dj )
    {  Link->Jump = height; dj =true; }
}}


I don't see why that shouldn't work.

#5 Joe123

Joe123

    Retired

  • Members

Posted 19 June 2009 - 06:08 AM

QUOTE(Gleeok @ Jun 19 2009, 11:44 AM) View Post

jeez dude, alright, alright.


Heh sorry =P


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users