Sidescroll Ladder script needed.
#1
Posted 10 December 2007 - 01:54 PM
I want it to work like the ladders in Link's Awakening did: when Link is standing on the flagged (walkable) combo, he can move up and down without falling. But when he moves off the combo, he'll fall.
Does anybody have what it takes to script this?
(buld 679)
#2
Posted 10 December 2007 - 09:06 PM
#3
Posted 10 December 2007 - 09:11 PM
#4
Posted 10 December 2007 - 09:20 PM
Want a quick answer, you'll probably have to pester L about it. I'm doubting the implementation of ladder combos in 2.5 more and more these days.
Edited by Gleeok, 10 December 2007 - 09:22 PM.
#5
Posted 11 December 2007 - 03:00 AM
How would you go about doing that Gleeok? Changing Link's Y coordinate every frame?
It's a shame we don't have control of the screen flags.
#6
Posted 12 December 2007 - 01:51 AM
if(Link->InputUp){ Link->Y -= 0.3;}
would be the next thing i'd do, along with some ComboAt and canMove or ComboS acrobatics.
#7
Posted 12 December 2007 - 03:07 AM
I, personally, wouldn't try to move Link less than a pixel though, you can't just up the systems resolution because you want sidescrolling ladders =P
#8
Posted 12 December 2007 - 03:53 PM
...and it doesn't change the resolution silly, it just stores the data.
#9
Posted 12 December 2007 - 04:02 PM
#10
Posted 12 December 2007 - 05:20 PM
#11
Posted 12 December 2007 - 05:21 PM
Didn't work for Link in any case
#12
Posted 12 December 2007 - 05:26 PM
..well good luck with that then!
#13
Posted 12 December 2007 - 05:32 PM
#14
Posted 13 December 2007 - 12:58 PM
import "std.zh"
//Courtesy of Saffith, beefster09, and pkmnfrk
bool isSolid(int x, int y) {
if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x % 16 < 8)
mask &= 0011b;
else
mask &= 1100b;
if(y % 16 < 8)
mask &= 0101b;
else
mask &= 1010b;
int ret = Screen->ComboS[ComboAt(x, y)] & mask;
return (ret!=0);
}
ffc script ladder {
void run(int f) {
if(f == 0) f = 98;
while(true) {
if(Screen->ComboF[ComboAt(Link->X+8, Link->Y)] == f) {
if(Link->Jump < 0) Link->Jump = 0;
if(Link->InputDown) {
if(!isSolid(Link->X, Link->Y + 1)) Link->Y += 1;
}
if(Link->InputUp) {
if(!isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
}
}
Waitframe();
}
}
}
The way this script works is: On every screen where you have ladders, make an invisible FFC with this script. Then put flag 98 on every "ladder" combo on that screen.
Thank you, pkmnfrk!
#15
Posted 13 December 2007 - 07:34 PM
In case I update this (which has a non-zero chance), the script is hosted on my site:
http://zctut.com/ladder.php
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users