Jump to content

Photo

Scripted Ex1 Jump not working on Sideview Gravity Screens

2.55 Alpha 85

  • Please log in to reply
5 replies to this topic

#1 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 19 December 2020 - 05:32 AM

Found this script, it's working fine in regular (overhead) screens, but not working with sideview gravity.


...can someone help me, figuring out what's the problem...?
I guess it's got something to do with the "OnSidePlatform(0,0)" declaration.

 

const int JUMP_POWER = 2; //Adjust this if you want.


void UpdateFeather()
{
	if(Link->Item[I_ROCSFEATHER]) {
		if(IsSideview()) {
			if (Link->PressEx1 && OnSidePlatform(0,0)) Link->Jump = JUMP_POWER;
           	}
           	else if (Link->PressEx1 && Link->Z == 0) Link->Jump = JUMP_POWER;
	}
}

Hope somebody can help me.

  
Thanks

Bagu



#2 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 19 December 2020 - 07:23 AM

OnSidePlatform(0,0)
This is your problem. It is using coordinate 0,0 on the screen as the position of the sprite it referenced.

You will want this instead:

OnSidePlatform(Link->X, Link->Y); //This uses Link's position.

  • ShadowTiger and Bagu like this

#3 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 19 December 2020 - 07:46 AM

I tried this
 

void UpdateFeather()
{
	if(IsSideview()) {
		if (Link->PressEx1 && OnSidePlatform(Link->X,Link->Y)) Link->Jump = JUMP_POWER;
           	}
           else if (Link->PressEx1 && Link->Z == 0) Link->Jump = JUMP_POWER;
}

...but it still didn't work

BTW 
I removed the first line, cause I don't want the script to depend on the feather.


Can this be an issue with the "New Hero Movement" or "Sprite Coordinates are Float" settings?


I checked it out, but it still don't work if "New Hero Movement" and "Sprite Cordinates are Float" is disabled.



#4 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 19 December 2020 - 08:45 AM

OnSidePlatform(0,0)
This is your problem. It is using coordinate 0,0 on the screen as the position of the sprite it referenced.

You will want this instead:
OnSidePlatform(Link->X, Link->Y); //This uses Link's position.

I don't know why this wasn't working.

OnSidePlatform(Link->X, Link->Y)

But I did it like this, now
 

const int JUMP_POWER = 2; //Adjust this if you want.
const int JUMP_POWER2 = 3; //Adjust this if you want.
const int S_PLAT = 162;

void UpdateFeather()
{
	if(IsSideview()) {
		if (Link->PressEx1 && ComboFI(Link->X+8, Link->Y+16, S_PLAT)) Link->Jump = JUMP_POWER2;
           	} 
           else if (Link->PressEx1 && Link->Z == 0) Link->Jump = JUMP_POWER;
}

Works fine...
...I also added a lil' Boost to the Sideview Gravity Jump (Jump_Power2), cause otherwise it was a bit difficult to jump on a 16x16 block.

 



#5 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 December 2020 - 12:47 AM

The power of a Roc's Feather item in engine is ((POWER + 2) * 80) / 100. So a Power 1 Roc's Feather would use 'Link->Jump = 2.4;'.

...at least, if memory serves. For each increment of power you give it, add 0.8- so a Power 2 Roc's feather would be 'Link->Jump = 3.2;'


  • Bagu likes this

#6 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 20 December 2020 - 05:24 AM

The power of a Roc's Feather item in engine is ((POWER + 2) * 80) / 100. So a Power 1 Roc's Feather would use 'Link->Jump = 2.4;'.

...at least, if memory serves. For each increment of power you give it, add 0.8- so a Power 2 Roc's feather would be 'Link->Jump = 3.2;'

I did not know the exact velocity meassures
...Thank for the clue.
I'm gonna fix it in my script.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users