Jump to content

Crystal Switch Puzzle

Overview
Creator: A Link to Frustration Updated: 17 Dec 2014 Tags: FFC Downloads: 86
Rating[?]: Rating: 4.33/5 (2 ratings)
View Script Download Example
(863.85 KB)
Information

Description Setup Reviews Comments

Sparkster  

Edited 24 February 2015 - 01:03 PM
I'm running into a bug. I set all things up correctly but after I entered the screen with your script the secret is already active. I made a test screen inside my quest and I have 8 FFCs. The first one has "0" as D0 Argument.

Here's my code
const int SECRET_SOUND = 27; // Change to the number for the sound effect to play when secrets are triggered. Leave at 0 if you don't want one.
 
const int CRYSTAL_COMBO = 33312; // This should be the combo# of your first crystal color.
 
const int NUM_CRYSTAL_COMBOS = 8; // Set this to the maximum number of colors you can cycle.
 
// Change the above integers to reflect what they would be pointing to in YOUR quest. (Right now they are set to my specifications from the Demo Quest.)
// Combos should be in order, with the first combo as the first color (Color 0).
// Setup all of the combos with Strike->Next flags except for the last one on your list, which when hit should change to the screen's Under Combo.
// Set the screen's Under Combo to be the first combo (Combo 0) on your list, so that the colors loop back once they've run their course.
// Place the FFCs using this script onto your crystals, setting D0 to which color is the correct answer (the first color is 0), and set them to be "Translucent" and to "Run at Screen Init".
// Make sure to have a Secret Combo set for the screen so that the puzzle actually accomplishes something.
// I advise having the tiles used by each crystal be 8-Bit, so that they do not change along with the CSet, and remain uniform throughout your quest.
// The maximum number of crystals that can be used on-screen at any given time is 32.
 

ffc script CrystalSwitchFFC {
void run(){
 
        ffc f;
        int numCrystals = 0;
        int numCrystalsCorrect = -1;
 
        while(true){
              for(int i=1; i<=32; i++){
                     f=Screen->LoadFFC(i);
                     if( ( f->Data >= CRYSTAL_COMBO )&&( f->Data <= (CRYSTAL_COMBO+NUM_CRYSTAL_COMBOS-1) ) ){
                           numCrystals++;
                           if( f->Data == (f->InitD[0]+CRYSTAL_COMBO) )
                                 numCrystalsCorrect++;
                     }
              }
 
             if(numCrystals==numCrystalsCorrect+1){
                   Game->PlaySound(SECRET_SOUND);
                   Screen->TriggerSecrets();           
                   Screen->State[ST_SECRET]=true; // Change to false if you don't want the secret permanent.
                   Quit();
             } 
 
            numCrystals = 0;
            numCrystalsCorrect = -1;
 
           Waitframe();     
           }
     }
}
Note: I'm using DoR Hybrid and I have 8 colors the first one is blue.

EDIT: Ok forget it. I figured it out.
 

justin  

Posted 18 December 2014 - 12:58 AM
doesn't need to cycle to the under combo. can also just cycle to a combo that looks exactly like the first or last, and combo cycles back to 1st combo. that way you can still use your under combo for something else, and you don't need to set the undercombo for each screen you have the puzzle on.
 

A Link to Frustration  

Posted 17 December 2014 - 12:31 AM
Thanks for the heads up. This was my first upload so some sort of screwup was bound to happen. Just glad it was something I was able to figure out. Re-uploaded the quest with the "Unable to Open" bug fixed, and the password removed.
 

judasrising  

Edited 16 December 2014 - 09:25 PM
Hm intresting script but i cant try the demo i get a error on loading it and i cant take a look at the demo in ZQ either is passworded i wanted to see the setup
in the editor , i might can figure that one out.But nice script