Since you're using 2.55, I think combodata scripts are your friend for this room. The implementation should be fairly simple - you basically just need a "half sensitive" Step->Secrets combo. Let's whip something up:
const int BTRIGGER_SFX = 0; //Set to the SFX ID of a sound that plays when you step on the trigger
combodata script BetterTrigger {
void run() {
while(true) {
if ((BetterTriggerDetect(this->X,this->Y) and (Hero->Z == 0)) {
Screen->TriggerSecrets();
Audio->PlaySound(BTRIGGER_SFX);
}
Waitframe();
}
}
}
bool BetterTriggerDetect(int comboX, int comboY) {
int heroX = Round(Hero->X);
int heroY = Round(Hero->Y);
if (
((heroX - comboX) < 8) and
((comboX - heroX) <= 8) and
((heroY - comboY) < 8) and
((comboY - heroY) <= 8)
){
return true;
}
return false;
}
EDIT: Fixed sound effect oversight (thanks Emily) and added check for Z as well.
This script:
- Rounds the player's position when it checks so that it's compatible with New Hero Movement.
- Checks the player's position on a grid-based system so that only one of these combos may be triggered per frame.
- Has a configurable sound effect that you set globally when it triggers.
This is not tested and may need some tweaks, particularly if the quicksand collision is more or less sensitive than these. But it should compile and it's simple enough that I don't predict major issues, except that the current latest 2.55 alpha has several combodata script bugs that may affect this script. I have worked with the dev team to try to identify and fix these and they should be completely fixed in the next released build. Let me know if there are any issues and I should be able to tell if this is an engine bug or a script bug.
Edited by Mitchfork, 14 June 2021 - 01:49 PM.