Results are now in.
It works (only for diagonal Z3 Link movements), but Link wasn't animating as he climbs and descends, and this could eliminate the need of a climbing script (mentioned in another thread). I'll tell you, he WAS animating before. Can you make Link animate while climbing/descending?
Still, the problem with the classic (4-directional) Link movement still exists. When he steps on the ladder (the flag 98), he wouldn't get through. I had to move him alot of directions to get him through.
EDIT 6:34 PM PDT 7/31/08: I was able to make him animate as he only climbs, making the movement like the "Super Mario Bros. 2" style. I changed this part from 'false' to 'true':
if(Link->InputUp) {
Link->InputUp = [highlight]true[/highlight];
Link->Action = LA_WALKING;
if(!isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
}
But, can you still make him animate while descending, or moving side to side
while he still faces up?Can you also fix the problem relating to the classic Link movement (Tell me if you need a test quest).
I found another flaw. The 'Scroll: Spin Attack' item can be a problem when he is on the ladder. If Link charges up for spin attack and he moves, his sword disappears and he will be stuck in that position (he can still move) until he moves to another screen or gets hit by enemy. EDIT 11:54 PM PDT 7/31/08: I had resolved that issue myself, tested and worked. EDIT 8:41 PM PDT 8/3/08: Another flaw with 'Scroll: Quake Hammer' item. If he is charging up while on ladder, he will still move and will be frozen if he gets off the ladder. I carefully add another disablement to the script, but will not test it because I know it is the same result as removing the hover boots.
The script with my modifications, how is it? (Remember, dependant only on diagonal Link movements)
EDIT_Note: Even if he is charging for spin attack while off ladder, if he steps on the ladder, he will be stuck in position. The script only takes away the 'Scroll: Spin Attack' item, preventing him to charge up after sword swing until he is off the ladder.
import "std.zh"bool has_hover = false;
bool has_spinattack = false;
bool has_quakescroll = false;
bool on_ladder = false;
global script ladder {
void run() {
while(true) {
ladder(98);
Waitframe();
}
}
//Courtesy of Saffith/beefster09
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);
}
void ladder(int f) {
int lc;
lc = ComboAt(Link->X+8, Link->Y+15); //for speed
if(Screen->ComboF[lc] == f || Screen->ComboI[lc] == f) {
if(!on_ladder) {
on_ladder = true;
has_hover = Link->Item[I_HOVERBOOTS];
Link->Item[I_HOVERBOOTS] = false;
has_spinattack = Link->Item[I_SPINSCROLL1];
Link->Item[I_SPINSCROLL1] = false;
has_quakescroll = Link->Item[I_QUAKESCROLL1];
Link->Item[I_QUAKESCROLL1] = false;
}
Link->Jump = 0;
Link->Z = 0;
Link->Dir = DIR_UP;
if(Link->InputDown) {
Link->InputDown = false;
Link->Action = LA_WALKING;
if(!isSolid(Link->X, Link->Y + 16)) Link->Y += 1;
}
if(Link->InputUp) {
Link->InputUp = true;
Link->Action = LA_WALKING;
if(!isSolid(Link->X, Link->Y - 1)) Link->Y -= 1;
}
if(Link->InputLeft) {
Link->InputLeft = false;
Link->Action = LA_WALKING;
if(!isSolid(Link->X - 1 , Link->Y)) Link->X -= 1;
}
if(Link->InputRight) {
Link->InputRight = false;
Link->Action = LA_WALKING;
if(!isSolid(Link->X + 16, Link->Y)) Link->X += 1;
}
} else {
if(on_ladder) {
Link->Item[I_HOVERBOOTS] = has_hover;
Link->Item[I_SPINSCROLL1] = has_spinattack;
Link->Item[I_QUAKESCROLL1] = has_quakescroll;
on_ladder = false;
}
}
}
}
- Can you still make him animate while descending, or moving side to side
while he still faces up?- Please check what needs improvement for compatibility with classic Link movements or you may need to create a separate script specifically for that movement.