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.
Code:
//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;
}
}
}