A complex (or not?) burn puzzle
#1
Posted 09 October 2012 - 09:09 AM
The thing is the torches are in different corners of the room, and they have to be accessed coming from different screens (which necessarily implies that the player leaves the screen in the meantime).
I have tried about all I've got messing with flags, screen flags, combo flags, and I can only either get a room where lighting a single torch reveals the secret immediately, or a room where you can light one torch at a time but they don't remain lit once you leave the room, thus making the puzzle impossible to solve.
Is it possible to do this without scripting?
#2
Posted 09 October 2012 - 09:25 AM
#3
Posted 09 October 2012 - 09:29 AM
#4
Posted 09 October 2012 - 10:50 AM
ffc script MultiTorch{
int torch_cap(ffc this){
int count=0;
for(int i=1; i<=32; i++){
ffc f=Screen->LoadFFC(i);
if(f->Script==this->Script&&this!=f){
count++;
}
}
return count;
}
bool AllLit(ffc this){
for(int i=0; i<=torch_cap(this); i++){
if(Screen->D[i]==0){
return false;
}
}
return true;
}
void run(int torch_number){
if(Screen->D[torch_number]==1){
Screen->ComboD[ComboAt(this->X+8, this->Y+8)]++;
}
else while(true){
if(AllLit(this)&&Screen->State[ST_SECRET]==false){
Screen->TriggerSecrets();
Screen->State[ST_SECRET]=true;
Game->PlaySound(SFX_SECRET);
}
for(int i=1; i<=Screen->NumLWeapons(); i++){
lweapon l=Screen->LoadLWeapon(i);
if(l->ID==LW_FIRE&&Distance(l->X, l->Y, this->X, this->Y)<16&&Screen->D[torch_number]==0){
Screen->ComboD[ComboAt(this->X+8, this->Y+8)]++;
Screen->D[torch_number]=1;
}
}
Waitframe();
}
}
}
A lot more complicated than I was expecting. Here's how you set it up:
- Each torch needs an ffc running the script placed directly on top of it
- Each unlit torch must have a lit torch as the combo directly after it in the list (so you'd for example have the unlit torch combo as combo 35 and the lit torch combo as combo 36)
- Each ffc needs the flag "Run Script on Screen Init" checked
- Each ffc needs a number on D0 starting with 0 for the first torch ffc you place and adding 1 for each consecutive one. It has just occurred to me that this can probably done automatically if I modify the script a bit. >_<
#5
Posted 09 October 2012 - 11:25 AM
Upon lighting a torch the secret is revealed immediately (and the torch doesn't appear to be lit, even though the next combo is a lit torch like you said).
Anything I need to know about screen flags and how they should be set up for this? I don't know what's preventing it from working.
#6
Posted 09 October 2012 - 11:28 AM
D'oh! Also, you did remember to remove the burn trigger flags from before the script was added, right?
Edited by Moosh, 09 October 2012 - 11:31 AM.
#7
Posted 09 October 2012 - 11:31 AM
I have set up all three.
#8
Posted 09 October 2012 - 11:33 AM
D'oh! Also, you did remember to remove the burn trigger flags from before the script was added, right?
No I hadn't.
I just did now but the result is that nothing triggers when I fire the candle?
Do the unlit torch combos need an inherent flag?
Edited by Jamian, 09 October 2012 - 11:35 AM.
#9
Posted 09 October 2012 - 11:34 AM
There are only three torches (does it matter that there are three instead of four? I can add a fourth one if it does)
I have set up all three.
It should work fine for three. I just assumed there were four because I'm a symmetry nutcase and will go out of my way to make important rooms symmetrical. I dunno what the problem is...works fine for me...
#10
Posted 09 October 2012 - 11:42 AM
#11
Posted 09 October 2012 - 11:47 AM
#12
Posted 09 October 2012 - 11:52 AM
Yes, each FFC has a different D0 number, 0.000, 1.000 and 2.000.
#13
Posted 09 October 2012 - 11:53 AM
#14
Posted 09 October 2012 - 12:18 PM
It's almost working now.
I light the first torch (0.00) and all is fine.
But then if I light the second torch (1.00), the secret is revealed even though the third torch hasn't been activated.
However if I light the first torch (0.00) and then the third torch (2.00) all seems fine.... except if I leave and reenter the room then the secret will be revealed.
Is this something in the script? Or something else?
#15
Posted 09 October 2012 - 01:22 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users