PDA

View Full Version : [Request]Lifting Gate



Majora
04-11-2014, 04:56 PM
Should be simple I hope. I think I'll even take a crack at it. In the meantime, can someone whip up a script wherein:

The player plays a specific whistle item that the script checks for on the trigger flag. Player input is disabled while a solid FFC vibrates, plays a sound, then starts to move as it plays another sound. It moves a certain distance at a certain speed and plays a third and final sound when it stops, after which player input is restored. Then the FFC stops being solid and becomes overhead. The FFC remains permanently open.

D0 First of three sequential SFX
D1 X distance
D2 Y distance
D3 X Speed
D4 Y Speed
D5 Whistle item #. (My quest uses multiple for different songs.)
D6
D7

This all kind of hinges specifically on whether or not it is possible to check that a SPECIFIC whistle item has been played. Or to put it in layman's terms, a specific song is required.

Majora
04-16-2014, 06:04 PM
Yeah I can't figure it out.

So to recap:

One FFC which rumbles and lifts up after the player stands on another FFC and uses/plays a specific whistle item (my quest has multiple, for multiple songs). The FFC that moved never resets, is initially solid, and finishes as a non-solid overhead.


This is as far as I got before giving up.
//An attempt at a script that causes an FFC to move in a specified direction at a//specified speed for a specified distance after a specified item has been used
//while standing on a specified FFC. In short: A gate that lifts after playing the whistle
//on a "pedestal". The FFC is also solid until it moves, after which it becomes overhead.


//int DisY; //How far to move
//float VelY; //How fast
//int RmblSFX; //sequential
//int REQ_SONG; // item ID
bool OnTarget; // is link standing on the thing
bool IsPlaying; // is link playing the thing




ffc script LiftingGate {void run (int DisY, int VelY, int RmblSFX)


{ int tho = (this->TileHeight*16-16); //2
{ if ((Abs(Link->X - this->X) < 10) && (Link->Y <= this->Y+tho + 12) && (Link->Y > this->Y+tho+8))
{Link->Y = this->Y+tho+12;}
if ((Abs(Link->Y - this->Y-tho) < 10) && (Link->X >= this->X - 12) && (Link->X < this->X-8))
{Link->X = this->X-12;}
if ((Abs(Link->X - this->X) < 10) && (Link->Y >= this->Y+tho - 12) && (Link->Y < this->Y+tho-8))
{Link->Y = this->Y+tho-12;}
if ((Abs(Link->Y - this->Y-tho) < 10) && (Link->X <= this->X + 12) && (Link->X > this->X+8))
{Link->X = this->X+12;}
}


{
int delay = 180;
int posX = this->X;
if (OnTarget == true && IsPlaying == true){
while(delay) {
delay--;
this->X = posX + Rand(2);
Game->PlaySound(RmblSFX);
Waitframe();
}




}}}
}


ffc script WhistlePad { // 1
void run(int ReqSong)
{if ((GetEquipmentB() == ReqSong && Link->InputB) || (GetEquipmentA() == ReqSong && Link->InputA)) IsPlaying = true;
{if ((Abs(Link->X - this->X) < 8 ) && (Abs(Link->Y - this->Y) < 8)) OnTarget = true;
}
}


}

Zim
07-21-2014, 06:29 PM
There are ffc key doors in zim.qst that would be the same thing, you'd just have to change the required item to whistle, add the sounds, and adjust the parameters for where Link has to be standing, as it works with directly in front of the doors as is.

SUCCESSOR
07-21-2014, 08:44 PM
Should be simple I hope. I think I'll even take a crack at it. In the meantime, can someone whip up a script wherein:

The player plays a specific whistle item that the script checks for on the trigger flag. Player input is disabled while a solid FFC vibrates, plays a sound, then starts to move as it plays another sound. It moves a certain distance at a certain speed and plays a third and final sound when it stops, after which player input is restored. Then the FFC stops being solid and becomes overhead. The FFC remains permanently open.

D0 First of three sequential SFX
D1 X distance
D2 Y distance
D3 X Speed
D4 Y Speed
D5 Whistle item #. (My quest uses multiple for different songs.)
D6
D7

This all kind of hinges specifically on whether or not it is possible to check that a SPECIFIC whistle item has been played. Or to put it in layman's terms, a specific song is required.

Sorry, I missed this. I took a prolonged break from ZC. Now that I started dicking around with ZScript again I'll take a crack at it if you still need it. It doesn't seem hard to do. Will there potentially be enemies on screen that need to be frozen or do you just want Input disabled?

Just realized you were going to use a custom item. My reedin Rn't to good! Can you explain the custom item and does it have a script attached?

Majora
09-26-2014, 11:59 AM
No script on the custom item. It's just a higher-leveled Whistle item that plays a different WAV.

There was a single enemy on the screen but I can get rid of it. Just a random moblin.