Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[982] Screen->State[ST_SECRET] does not apply immediately

6 replies · 1,021 views · Started 24 March 2009

ffc script HiddenPassage {
void run() {
Trace(1);
if(Screen->State[ST_SECRET]) {
Trace(2);
this->X += 16;
Quit();
}

Trace(3);
while(!Screen->State[ST_SECRET])
Waitframe();

Trace(4);
Link->Action = LA_FROZEN;

Trace(5);
for(int i = 0; i < 16; i++) {
this->X++;
Game->PlaySound(SFX_PUSHBLOCK);
Waitframes(8);
}

Trace(6);

Link->Action = LA_NONE;

}
}

This script is supposed to wait until Link solves a puzzle, and then move the FFC over to reveal a hidden passage (whose passability is handled by Secret flags that don't matter to this bug). If the secrets have already been triggered (eg, Link is returning to the screen after having solved the puzzle), the FFC should already be moved over.

However, this does not happen. According to the Trace statements, it gets stuck on #3, which is the while loop that looks for the secrets being triggered. This seems to indicate that the State flag is not being set, even though the secrets are being triggered.

Hopefully this made some kind of sense...

(Side question: What is the proper way of making a screen in a Dungeon DMap preserve secrets? I tried the "Treat as Interior Room" flag, but it did not preserve secrets after leaving the screen and coming back)

const int ST_SECRET = 13; // Screen Secrets have been made permanent

If secrets cannot be made permanent, then this will never be true.

pkmnfrk wrote:I tried the "Treat as Interior Room" flag, but it did not preserve secrets after leaving the screen and coming back
Hmm, really? ...That doesn't look right.

That is what I suspected. So, the bug is that Treat as Interior Room is not working.

---

Test case

The starting DMap (DMap 2) is currently set to be a BS Overworld, but change the DMap type to play around with it.

The starting screen has three secret triggers: a "Block Trigger" "puzzle", an old-style push block, and a "Step->Secret (Sens, permanent)" combo. On all map types, including interior, the blocks do not permanentize the secrets. The Step->Secret combo does.

It may, in fact, be that I'm just doing it wrong, and/or expecting the wrong things of permanent secrets. If this is the case, please enlighten me.

Well, just look at the wiki:
[quote="ZC Wiki"]
"Secrets" Screen State

The "Secrets" Screen State ... will always be set whenever Screen Secrets are triggered, unless:
...
* The Screen Secrets were triggered by Link pushing a Trigger Push Block (even if it was onto a lonely Block Trigger flag) whose combo type was not "Push (Heavy)" or "Push (Heavy, Wait)" or "Push (Very Heavy)" or "Push (Very Heavy, Wait)"
[/quote]In closing: not a bug!

Okay... Is there any way to make such exceptions permanent? Those seem like pointless restrictions.

Make the secrets into permanent switches that you know Link will be under. It'll set the ST_SECRET flag without actually triggering more secrets.

Ok, I got it, through a delicate balance of scripting, secrets, inherent flags and the blood of a virgin.

Fun trivia fact: Even if you force Screen->State[ST_SECRET] on with a script, if you don't have "Treat as Interior Room" (or a DMap that implies such), it'll forget that it was set! Fun!