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

Screen->State[ST_ITEM] && Screen->State[ST_SPECIALITEM]

1 replies · 1,390 views · Started 04 October 2008

I cannot understand how these work, because for some reason, the script I have, (Thanks to Elmensajero on PureZC) will always play the sound, regardless of if the item is there or not.

ffc script gbcompass {
void run(int level, int mode, int sfx) {
bool hascompass = false;
if ((Game->LItems[level]&LI_COMPASS) == LI_COMPASS) {
//If Link has compass, set variable to true
hascompass = true;
}
if (hascompass && mode == 0 && !Screen->State[ST_SPECIALITEM]) {
//If Link has not gotten special item, play sound
Game->PlaySound(sfx);
}
else if(hascompass && mode == 1 && !Screen->State[ST_ITEM]) {
//If Link has not gotten regular item, play sound
Game->PlaySound(sfx);
}
}
}

Now, I know there's an issue with treasure chests and not updating Screen->State[ST_SPECIALITEM] that was just reported and fixed. However, Screen->State[ST_ITEM] doesn't appear to update for me as well, if I was to grab a key that would be just sitting there through the normal item dialog.

What's up with this?