Jump to content

Photo

A jump script


  • Please log in to reply
14 replies to this topic

#1 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 July 2016 - 09:11 PM

Hi

 

Could someone write me a script that when player stands on a specific combo

then the player can jump?

 



#2 idontknow8

idontknow8

    Senior

  • Members

Posted 18 July 2016 - 10:50 PM

I'm guessing the following:


ffc script Jump_While_On_Combo{
   void run(){
      while(Link->X == this->X + 8 && Link->Y == this->Y + 8){
           if (Link->PressA){
              Link->Jump = 4;
              Waitframes(15);
          }
       }
    }
}

If Link is standing on the center of this FFC and presses A, he'll jump.  You can change the value of 4 to whatever you want, with a high number being a higher jump.  You could also change the number next to Waitframes if you want to change the timing of how long the script waits to run again.




#3 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 18 July 2016 - 11:12 PM

That script will immediately quit if Link isn't standing exactly on the FFC the first frame he enters the room. And if he is, it'll immediately freeze the game instead.

Try this:

ffc script ComboJump
{
	void run(int combo, int jump_height)
	{
		while (true)
		{
			if (ComboAt(Link->X + 8, Link->Y + 8) == combo && Link->Z == 0 && Link->PressEx1)
			{
				if (jump_height > 0)
				{
					Link->Jump = jump_height;
				}
				else
				{
					Link->Jump = 2;
				}
			}
			Waitframe();
		}
	}
}
D0 is combo number, D1 is jump height (defaults to 2 if nothing is entered). Emphatically does not work in sideview.

#4 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 July 2016 - 11:14 PM

 

I'm guessing the following:


ffc script Jump_While_On_Combo{
   void run(){
      while(Link->X == this->X + 8 && Link->Y == this->Y + 8){
           if (Link->PressA){
              Link->Jump = 4;
              Waitframes(15);
          }
       }
    }
}

If Link is standing on the center of this FFC and presses A, he'll jump.  You can change the value of 4 to whatever you want, with a high number being a higher jump.  You could also change the number next to Waitframes if you want to change the timing of how long the script waits to run again.


It compiles and it somehow does not work at all , it dont even show when i use Show Current FFC on screen



#5 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 July 2016 - 11:35 PM

That script will immediately quit if Link isn't standing exactly on the FFC the first frame he enters the room. And if he is, it'll immediately freeze the game instead.

Try this:
 

ffc script ComboJump
{
	void run(int combo, int jump_height)
	{
		while (true)
		{
			if (ComboAt(Link->X + 8, Link->Y + 8) == combo && Link->Z == 0 && Link->PressEx1)
			{
				if (jump_height > 0)
				{
					Link->Jump = jump_height;
				}
				else
				{
					Link->Jump = 2;
				}
			}
			Waitframe();
		}
	}
}
D0 is combo number, D1 is jump height (defaults to 2 if nothing is entered). Emphatically does not work in sideview.

 

Hm does not jump



#6 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 18 July 2016 - 11:43 PM

You press Ex1 to jump. If you wanted it to act more like a trampoline instead, you should have specified.

#7 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 July 2016 - 11:46 PM

You press Ex1 to jump. If you wanted it to act more like a trampoline instead, you should have specified.

I changed it to B button but i wont jump at all , i see the script name at screen when i use show current FFC on screen



#8 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 19 July 2016 - 12:52 AM

You didn't set D0 to the combo number. That's important.

#9 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 19 July 2016 - 01:32 AM

You didn't set D0 to the combo number. That's important.

arr_zpsqibvpb1g.png



#10 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 19 July 2016 - 01:57 AM

The script reads combo position. I could change it to the number from the combo table itself, though. Then you could put any number of those combos in the room with only one copy of the script.

#11 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 19 July 2016 - 02:01 AM

The script reads combo position. I could change it to the number from the combo table itself, though. Then you could put any number of those combos in the room with only one copy of the script.

Yes that would be nice of you



#12 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 19 July 2016 - 02:09 AM

ffc script ComboJump
{
	void run(int combo, int jump_height)
	{
		while (true)
		{
			if (Screen->ComboD[ComboAt(Link->X + 8, Link->Y + 8)] == combo && Link->Z == 0 && Link->PressEx1)
			{
				Game->PlaySound(SFX_JUMP);
				if (jump_height > 0)
				{
					Link->Jump = jump_height;
				}
				else
				{
					Link->Jump = 2;
				}
			}
			Waitframe();
		}
	}
}
YUMP SOUND

Edited by Lejes, 19 July 2016 - 02:39 AM.

  • judasrising likes this

#13 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 19 July 2016 - 02:20 AM

ffc script ComboJump
{
	void run(int combo, int jump_height)
	{
		while (true)
		{
			if (Screen->ComboD[ComboAt(Link->X + 8, Link->Y + 8)] == combo && Link->Z == 0 && Link->PressEx1)
			{
				if (jump_height > 0)
				{
					Link->Jump = jump_height;
				}
				else
				{
					Link->Jump = 2;
				}
			}
			Waitframe();
		}
	}
}

Thank you

it works , could you add so it plays the jump sound also?



#14 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 19 July 2016 - 02:40 AM

Check the post again, edited it in.

#15 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 19 July 2016 - 02:46 AM

Check the post again, edited it in.

Thank you for your help Lejes

 

Now i say goodbye to roc"s feather




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users