Gameboy Style Cliffs (With Dungeon Mod)

SubmittedDecember 12, 2016

Featured Screenshot

Author

Moosh

Description

Jumping off of cliffs and somehow not breaking any bones has always been a staple of the Zelda series. Now you too can do this in ZC, provided you're using EZGBZ, Pure, or any other Gameboy inspired tileset. I've also provided a slightly modified version of the script for use in dungeons.

Script Setup Details

Overworld Version

Set the CT_CLIFF and CLIFF_PAUSE constants in the script
Set up your jump point combos to have whatever combo type CT_CLIFF is set to and be sure that they're half solid with the solid half pointing in the direction the player will jump off them.
Place down an FFC with this script and it should do its magic

Note: Jump points going left, right, or up can only be one tile thick and jump points can not go over screen boundaries.

Dungeon Version

Set up four new wall combos you can jump down in the order of Up, Down, Left, Right
Place down an FFC with this script
Set D0 on the FFC to the combo number of the first of the four combos

Note: Unlike the overworld version, the combos here can be any type. It might be a good idea to do something to make them stand out from your regular walls when editing and testing the quest, though. CSet2 in the combo editor could be useful for this.

If anything here is unclear, try looking at how it's set up in the example quest.

Script Contents

const int CT_CLIFF = 142; //This is the combo type used for the cliffs. Look in std_constants.zh for reference. It's Script 1 (142) by default.
const int CLIFF_PAUSE = 15; //This is the number of frames (60ths of a second) Link must walk into the cliff before jumping

ffc script GBCliff{
bool CheckCliffDirection(int Combo){
int Dir;
if(Screen->ComboS[Combo]==0101b)
Dir = DIR_UP;
else if(Screen->ComboS[Combo]==1010b)
Dir = DIR_DOWN;
else if(Screen->ComboS[Combo]==0011b)
Dir = DIR_LEFT;
else if(Screen->ComboS[Combo]==1100b)
Dir = DIR_RIGHT;
else
return false;
if(Dir==Link->Dir)
return true;
return false;
}
void run(){
int PushCounter = 0;
while(true){
if(Link->Dir==DIR_UP&&!CanWalk(Link->X, Link->Y, DIR_UP, 1, false)&&Link->InputUp&&Screen->ComboT[ComboAt(Link->X+8, Link->Y+14)]==CT_CLIFF&&CheckCliffDirection(ComboAt(Link->X+8, Link->Y+14))&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int Y = Link->Y;
for(int i=0; iY = Y;
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_DOWN&&!CanWalk(Link->X, Link->Y, DIR_DOWN, 1, false)&&Link->InputDown&&Screen->ComboT[ComboAt(Link->X+8, Link->Y+12)]==CT_CLIFF&&CheckCliffDirection(ComboAt(Link->X+8, Link->Y+12))&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 1;
int Combo = ComboAt(Link->X+8, Link->Y+12);
int CliffHeight = 1;
for(int i=1; iisSolid(ComboX(Combo)+8, ComboY(Combo)+8+16*i))
CliffHeight++;
else
break;
}
Link->Z = CliffHeight*16;
Link->Y += CliffHeight*16;
while(Link->Z>0){
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_LEFT&&!CanWalk(Link->X, Link->Y, DIR_LEFT, 1, false)&&Link->InputLeft&&Screen->ComboT[ComboAt(Link->X+4, Link->Y+8)]==CT_CLIFF&&CheckCliffDirection(ComboAt(Link->X+4, Link->Y+8))&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int X = Link->X;
for(int i=0; iZ += 16;
Link->Y += 16;
}
Link->X = X;
WaitNoAction();
}
while(Link->Z>0){
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_RIGHT&&!CanWalk(Link->X, Link->Y, DIR_RIGHT, 1, false)&&Link->InputRight&&Screen->ComboT[ComboAt(Link->X+12, Link->Y+8)]==CT_CLIFF&&CheckCliffDirection(ComboAt(Link->X+12, Link->Y+8))&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int X = Link->X;
for(int i=0; iZ += 16;
Link->Y += 16;
}
Link->X = X;
WaitNoAction();
}
while(Link->Z>0){
WaitNoAction();
}
PushCounter = 0;
}
}
else{
PushCounter = 0;
}
Waitframe();
}
}
}

ffc script GBDungeonCliff{
void run(int CliffCombo){
int PushCounter = 0;
while(true){
if(Link->Dir==DIR_UP&&!CanWalk(Link->X, Link->Y, DIR_UP, 1, false)&&Link->InputUp&&Screen->ComboD[ComboAt(Link->X+8, Link->Y+7)]==CliffCombo&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int Y = Link->Y;
for(int i=0; iY = Y;
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_DOWN&&!CanWalk(Link->X, Link->Y, DIR_DOWN, 1, false)&&Link->InputDown&&Screen->ComboD[ComboAt(Link->X+8, Link->Y+16)]==CliffCombo+1&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 1;
int Combo = ComboAt(Link->X+8, Link->Y+12);
int CliffHeight = 1;
for(int i=1; iisSolid(ComboX(Combo)+8, ComboY(Combo)+8+16*i))
CliffHeight++;
else
break;
}
Link->Z = CliffHeight*16-8;
Link->Y += CliffHeight*16-8;
while(Link->Z>0){
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_LEFT&&!CanWalk(Link->X, Link->Y, DIR_LEFT, 1, false)&&Link->InputLeft&&Screen->ComboD[ComboAt(Link->X-1, Link->Y+8)]==CliffCombo+2&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int X = Link->X;
for(int i=0; iX = X;
WaitNoAction();
}
PushCounter = 0;
}
}
else if(Link->Dir==DIR_RIGHT&&!CanWalk(Link->X, Link->Y, DIR_RIGHT, 1, false)&&Link->InputRight&&Link->InputRight&&Screen->ComboD[ComboAt(Link->X+16, Link->Y+8)]==CliffCombo+3&&Link->Action==LA_WALKING){
PushCounter++;
if(PushCounter>=CLIFF_PAUSE){
Game->PlaySound(SFX_JUMP);
Link->Jump = 2;
int X = Link->X;
for(int i=0; iX = X;
WaitNoAction();
}
}
}
else{
PushCounter = 0;
}
Waitframe();
}
}
}

This entry has no reviews.

Recent Resources