THIS SCRIPT IS IN BETA
This is not officially submitted to the database, as it needs further testing before it's ready for the big time. Feel free to use this in your quest! Let me know if you find bugs or issues.
Lights Out Puzzle
Description
This script, used on a FFC placed in a room with switches (that are toggled by hitting them with the sword) spaced out with a full tile between them, will recreate the Lights Out puzzle game that some of you may have been familiar with in your childhoods! When you strike a switch with the sword, it is toggled from on to off or off to on along with up to four other switches directly adjacent to that switch (two tiles north, two tiles west, two tiles east, and two tiles south). This script will allow you to determine if you want the solution to the puzzle to be all switches turned on OR turned off. It's really up to you. Solving the puzzle triggers a temporary or permanent secret, depending on how you set the FFC arguments.
Screenshots and Demo
Example quest: http://www.speedysha...-lights-out.qst
Code
Setup
Just plop down a FFC set up to run scripts at screen init in a room with Lights Out puzzle switches (spaced out with a full tile between them) and set up the D arguments as follows:
D0: Layer that the switch combos are found on.
D1: The combo used by the switch in its on state.
D2: The combo used by the switch in its off state.
D3: The desired solution state: 0 for all off, 1 for all on.
D4: Is this a permanent secret? 0 for no, 1 for yes.
D5: Flag to use for switch combos that should be initially on when the screen is entered (when secret is not activated).
D6: The sound to play when Link's sword hits a switch.
D5 is IMPORTANT! You MUST place this flag on the switches that are already initially on when the player enters the screen. This is to allow the puzzle to reset when the player leaves and returns to the screen (if the secret is not permanently triggered).
Edited by Soga, 17 May 2013 - 06:36 PM.

