your script doesn't load the chests state before you see that it's closed even with with run script as init checked
edit: also I have been trying to get the chest to appear when the puff is on its 3rd frame and allow the puff to animate to the 4th frame before stopping
but I can't seem to get the puff of smoke to draw after the chest appears
I do this because the 3rd frame of the puff of smoke is mostly transparent and it doesn't look right to have the chest appear after the whole smoke animation ends
here is my code
ffc script PushSecret
{
void run(int screen, int sfx, int combo, int x, int y, int delay, int puff, int cset)
{
//if(Screen->D[screen]>0)
//{
// Screen->ComboD[ComboAt(this->X, this->Y)] = combo;
// Quit();
//}
int delay1 = delay;
int delay2 = delay1 + 60;
bool chest = false;
Waitframes(4);
if(delay1<=0)delay1=60;
if(delay2<=0)delay2=120;
while(true)
{
if(Screen->ComboT[ComboAt(x, y)]!=CT_PUSHWAIT)
{
if(delay1>0) delay1--;
else
{
Screen->ComboD[ComboAt(this->X, this->Y)] = combo;
Game->PlaySound(sfx);
Screen->D[screen]=1;
chest = 1;
break;
}
}
if (chest)
if(delay2>0)
{
delay2--;
Screen->FastCombo(3, this->X, this->Y, puff, cset, 128);
}
Waitframe();
}
}
Edited by Shadowblitz16, 27 December 2016 - 06:13 PM.