Sort of like Ocarina of time. Is there a way this is possible?
Looking for a script that makes Link jump/climb up only certain mounta
Started by
Jared
, Dec 11 2010 06:54 PM
6 replies to this topic
#1
Posted 11 December 2010 - 06:54 PM
#2
Posted 11 December 2010 - 08:20 PM
Jump yes, climb no.
I believe it was by beefster, but it's not in the DB and wouldn't work in the newer builds (for me, anyways). Also, it was set up via FFCs, so it would be difficult to have an entire cliff face jumpable.
EDIT: Knock yourself out.
//Ledge
//Link will jump off the ledge only when in the specified direction
//D0: All acceptable directions in a masked format:
//Up = 1;
//Down = 2;
//Left = 4;
//Right = 8;
//D1: Minimum direction hold time
//D2: Sound to be played when hopping the ledge
//All other properties are absorbed from the ffc, namely EffectHeight and EffectWidth
const float GRAV=.16; //Insert your game's gravity constant here. (.16 by default)
ffc script Ledge{
void run(int dir, int hold, int SFX) {
bool canJump;
int counter=0;
while(true) {
if((dir & 0001b) != 0) {
canJump = Link->InputUp && !Link->InputDown;
canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
canJump &&= (Link->Y <= this->Y+this->EffectHeight+8) && (Link->X >= this->X+this->EffectHeight+4);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputUp && !Link->InputDown;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectHeight+8;i++) {
Link->Y--;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 0010b) != 0) {
canJump = Link->InputDown && !Link->InputUp;
canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
canJump &&= (Link->Y >= this->Y-16) && (Link->Y <= this->Y-12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputDown && !Link->InputUp;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectHeight+8;i++) {
Link->Y++;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 0100b) != 0) {
canJump = Link->InputLeft && !Link->InputRight;
canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
canJump &&= (Link->X <= this->X+this->EffectWidth+16) && (Link->X >= this->X+this->EffectWidth+12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputLeft && !Link->InputRight;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectWidth+16;i++) {
Link->X--;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 1000b) != 0) {
canJump = Link->InputRight && !Link->InputLeft;
canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
canJump &&= (Link->X >= this->X-16) && (Link->X <= this->X-12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputRight && !Link->InputLeft;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectWidth+16;i++) {
Link->X++;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
}
Waitframe();
}
}
}
Edit 2: Alternatively, there is this one in the DB, but I could never figure out how to get it to work.
I believe it was by beefster, but it's not in the DB and wouldn't work in the newer builds (for me, anyways). Also, it was set up via FFCs, so it would be difficult to have an entire cliff face jumpable.
EDIT: Knock yourself out.
CODE
//Ledge
//Link will jump off the ledge only when in the specified direction
//D0: All acceptable directions in a masked format:
//Up = 1;
//Down = 2;
//Left = 4;
//Right = 8;
//D1: Minimum direction hold time
//D2: Sound to be played when hopping the ledge
//All other properties are absorbed from the ffc, namely EffectHeight and EffectWidth
const float GRAV=.16; //Insert your game's gravity constant here. (.16 by default)
ffc script Ledge{
void run(int dir, int hold, int SFX) {
bool canJump;
int counter=0;
while(true) {
if((dir & 0001b) != 0) {
canJump = Link->InputUp && !Link->InputDown;
canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
canJump &&= (Link->Y <= this->Y+this->EffectHeight+8) && (Link->X >= this->X+this->EffectHeight+4);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputUp && !Link->InputDown;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectHeight+8;i++) {
Link->Y--;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 0010b) != 0) {
canJump = Link->InputDown && !Link->InputUp;
canJump &&= (Link->X >= this->X-4) && (Link->X <= this->X+this->EffectWidth-12);
canJump &&= (Link->Y >= this->Y-16) && (Link->Y <= this->Y-12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputDown && !Link->InputUp;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectHeight+8)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectHeight+8;i++) {
Link->Y++;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 0100b) != 0) {
canJump = Link->InputLeft && !Link->InputRight;
canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
canJump &&= (Link->X <= this->X+this->EffectWidth+16) && (Link->X >= this->X+this->EffectWidth+12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputLeft && !Link->InputRight;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectWidth+16;i++) {
Link->X--;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
} if((dir & 1000b) != 0) {
canJump = Link->InputRight && !Link->InputLeft;
canJump &&= (Link->Y >= this->Y-4) && (Link->Y <= this->Y+this->EffectHeight-12);
canJump &&= (Link->X >= this->X-16) && (Link->X <= this->X-12);
while(canJump && counter<hold) {
counter++;
Waitframe();
canJump &&= Link->InputRight && !Link->InputLeft;
}
counter = 0;
if(canJump) {
Link->Jump = ((this->EffectWidth+16)/2)*GRAV;
Game->PlaySound(SFX);
for(int i=0;i<this->EffectWidth+16;i++) {
Link->X++;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;
Waitframe();
}
}
}
Waitframe();
}
}
}
Edit 2: Alternatively, there is this one in the DB, but I could never figure out how to get it to work.
Edited by Molten Onyx, 11 December 2010 - 08:25 PM.
#3
Posted 11 December 2010 - 08:54 PM
Compiled the script, but nothing's happening. Do I need the Roc's Feather?
#4
Posted 11 December 2010 - 09:19 PM
not that i know of does he?
#5
Posted 12 December 2010 - 09:30 AM
I'm pretty sure completely confident that you don't need Roc's feather. That's an FFC script, so did you set up the FFC properly on the screen you want it on?
Edit: MO said that this script
Edit: MO said that this script
QUOTE
wouldn't work in the newer builds
, so why don't you try the other one he provided?
Edited by MoscowModder, 12 December 2010 - 09:32 AM.
#6
Posted 12 December 2010 - 02:20 PM
Theres a newer vone that work? Can I have it?
#7
Posted 13 December 2010 - 09:48 AM
I can't guarantee that any script will work, but MO pointed out another script in the DB at http://www.purezc.co...showtopic=43831.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users