Jump to content

Photo

revert secrets?


  • Please log in to reply
6 replies to this topic

#1 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 21 January 2017 - 11:06 PM

can someone tell me how to revert a screen secret when the player is no longer stepping on the pressure plate?

I also need a way of check if every pressure plate is down

 

here is my script

 
const int STEP_COMBO_TYPE = 192;
 
ffc script PressurePlate_Timed
{
int timer = 0;
int index;
void run( int combo, int time, bool all, bool pushblock)
{
while(true)
{
 
if((!LinkCollisionExt(this, -6, -12, -8, -8)) || (pushblock && PushBlockAtLoc(ComboAt(this->X, this->Y))))
{
timer -= 1;
if (timer <= 0)
{
//Check if all flag is set
//Check if all ffc's running this script are pressed
//revert secrets
index = ComboAt(this->X, this->Y);
Screen->ComboD[index] = combo;
}
}
else
{
//trigger secrets
index = ComboAt(this->X, this->Y);
Screen->ComboD[index] = combo+1; 
timer = time;
}
Waitframe();
}
}
}
 
bool LinkCollisionExt(ffc this, int top, int bottom, int left, int right)
{
int ffcRect[4]  = {HitboxLeft(this) - left, HitboxTop(this) - top, HitboxRight(this) + right, HitboxBottom(this) + bottom};
int linkRect[4] = {HitboxLeft(),     HitboxTop(),     HitboxRight(),     HitboxBottom() };
Screen->Rectangle(6, ffcRect[0], ffcRect[1], ffcRect[2], ffcRect[3], 21, -1, 0, 0, 0, false, 128);
Screen->Rectangle(6, linkRect[0], linkRect[1], linkRect[2], linkRect[3], 21, -1, 0, 0, 0, false, 128);
 
if (linkRect[0] > ffcRect[2] || ffcRect[0] > linkRect[2])
return false;
if (linkRect[1] > ffcRect[3] || ffcRect[1] > linkRect[3])
return false;
return true;
}
 
bool PushBlockAtLoc(int loc){
 bool re = false;
 if( Screen->ComboF[loc]==CF_PUSHUPDOWN ||
     Screen->ComboF[loc]==CF_PUSH4WAY ||
     Screen->ComboF[loc]==CF_PUSHLR ||
     Screen->ComboF[loc]==CF_PUSHUP ||
     Screen->ComboF[loc]==CF_PUSHDOWN ||
     Screen->ComboF[loc]==CF_PUSHLEFT ||
     Screen->ComboF[loc]==CF_PUSHRIGHT ||
     Screen->ComboF[loc]==CF_PUSHUPDOWNNS ||
     Screen->ComboF[loc]==CF_PUSHLEFTRIGHTNS ||
     Screen->ComboF[loc]==CF_PUSH4WAYNS ||
     Screen->ComboF[loc]==CF_PUSHUPNS ||
     Screen->ComboF[loc]==CF_PUSHDOWNNS ||
     Screen->ComboF[loc]==CF_PUSHLEFTNS ||
     Screen->ComboF[loc]==CF_PUSHRIGHTNS ||
     Screen->ComboF[loc]==CF_PUSHUPDOWNINS ||
     Screen->ComboF[loc]==CF_PUSHLEFTRIGHTINS ||
     Screen->ComboF[loc]==CF_PUSH4WAYINS ||
     Screen->ComboF[loc]==CF_PUSHUPINS ||
     Screen->ComboF[loc]==CF_PUSHDOWNINS ||
     Screen->ComboF[loc]==CF_PUSHLEFTINS ||
     Screen->ComboF[loc]==CF_PUSHRIGHTINS )
  re = true;
 if( Screen->ComboI[loc]==CF_PUSHUPDOWN ||
     Screen->ComboI[loc]==CF_PUSH4WAY ||
     Screen->ComboI[loc]==CF_PUSHLR ||
     Screen->ComboI[loc]==CF_PUSHUP ||
     Screen->ComboI[loc]==CF_PUSHDOWN ||
     Screen->ComboI[loc]==CF_PUSHLEFT ||
     Screen->ComboI[loc]==CF_PUSHRIGHT ||
     Screen->ComboI[loc]==CF_PUSHUPDOWNNS ||
     Screen->ComboI[loc]==CF_PUSHLEFTRIGHTNS ||
     Screen->ComboI[loc]==CF_PUSH4WAYNS ||
     Screen->ComboI[loc]==CF_PUSHUPNS ||
     Screen->ComboI[loc]==CF_PUSHDOWNNS ||
     Screen->ComboI[loc]==CF_PUSHLEFTNS ||
     Screen->ComboI[loc]==CF_PUSHRIGHTNS ||
     Screen->ComboI[loc]==CF_PUSHUPDOWNINS ||
     Screen->ComboI[loc]==CF_PUSHLEFTRIGHTINS ||
     Screen->ComboI[loc]==CF_PUSH4WAYINS ||
     Screen->ComboI[loc]==CF_PUSHUPINS ||
     Screen->ComboI[loc]==CF_PUSHDOWNINS ||
     Screen->ComboI[loc]==CF_PUSHLEFTINS ||
     Screen->ComboI[loc]==CF_PUSHRIGHTINS )
  re = true;
 else if( Screen->ComboT[loc]==CT_PUSHHEAVY ||
          Screen->ComboT[loc]==CT_PUSHHEAVY2 ||
          Screen->ComboT[loc]==CT_PUSHHEAVY2WAIT ||
          Screen->ComboT[loc]==CT_PUSHHEAVYWAIT ||
          Screen->ComboT[loc]==CT_PUSHWAIT )
  re = true;
 return re;
}

Edited by Shadowblitz16, 21 January 2017 - 11:29 PM.


#2 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 21 January 2017 - 11:57 PM

Just use the Reset combo?



#3 Alucard648

Alucard648

    Wizard

  • Members
  • Location:castle Dracula

Posted 22 January 2017 - 07:46 AM

Just use the Reset combo?

Reset combo will also undo lockblocks. It`s not a good thing to have lockrlock and reset combos in one screen. Unlock lockblock and then step on reset combo. Hyrule is doomed.



#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 22 January 2017 - 10:35 AM

Unfortunately, while you can unset the Screen->State[ST_SECRET] flag, the only ways to undo the secrets immediately are to a) Warp to the same room (like a Reset combo), or b) Manually change the combos back.

 

Edit: You can also set lockblocks in the "No Reset" flags in Screen Data.


Edited by MoscowModder, 22 January 2017 - 10:35 AM.

  • Deedee likes this

#5 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 22 January 2017 - 02:31 PM

what about detecting if all the pressure plates with this ffc over them are down?



#6 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 22 January 2017 - 03:00 PM

I'd recommend having one ffc that scans every combo in the room and checks the combos where you have a script flag.



#7 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 23 January 2017 - 06:00 PM

wait is this possible with combo cycling?

if so then I could just make combo's to handle this a scripts to play the sound effects


Edited by Shadowblitz16, 23 January 2017 - 06:01 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users