Jump to content

Photo

Lights Out Puzzle

FFC

  • Please log in to reply
15 replies to this topic

#1 Soga

Soga

    Secretly Alive

  • Members

Posted 14 May 2013 - 04:52 PM

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
 

http://pastebin.com/M1WFA14D

 

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.


#2 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 14 May 2013 - 05:43 PM

Ooh, this'll go really good in either my Ice or Spirit Temple dungeons, if I can get them to work right. If no one else has tested them by the time I start puzzle planning for those dungeons, I'll be happy to report on any bugs I find :)



#3 Soga

Soga

    Secretly Alive

  • Members

Posted 14 May 2013 - 08:19 PM

Appreciate it, Lineas!



#4 Mr. Z

Mr. Z

    Old Bastard is back!

  • Members
  • Real Name:Erik
  • Location:The Netherlands

Posted 15 May 2013 - 02:13 AM

<3

Can you add a delay between triggering? When you swing the sword and hit multiple targets they change more than once.


  • Avaro likes this

#5 Avaro

Avaro

    >w<

  • Members

Posted 15 May 2013 - 07:57 AM

Do you need one ffc for each trigger?

And why exactly does it have to be a changer ffc? (I'm just curious)



#6 justin

justin

    Adept

  • Members

Posted 15 May 2013 - 09:08 AM

could be interesting to modify this such that instead of them being strike triggers they are step triggers.  you could make a frustrating variation to the Hamiltonian floor puzzles from the Oracle games.



#7 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 15 May 2013 - 11:31 AM

could be interesting to modify this such that instead of them being strike triggers they are step triggers.  you could make a frustrating variation to the Hamiltonian floor puzzles from the Oracle games.

 

I had actually thought the same thing. Or, really, any kind of trigger variation could make the puzzles exponentially more complex.



#8 Soga

Soga

    Secretly Alive

  • Members

Posted 15 May 2013 - 12:01 PM

<3

Can you add a delay between triggering? When you swing the sword and hit multiple targets they change more than once.

 

Certainly, Mr. Z. I've made a few corrections so that switches are not re-processed during the same attack, even if they were the triggered neighbors of struck switches. That was why it was toggling the same switches multiple times.

 

However, PureZC is reporting my post is too long with this code, so here is a pastebin.

 

http://pastebin.com/PdJ9pp5U

 

 

Do you need one ffc for each trigger?

And why exactly does it have to be a changer ffc? (I'm just curious)

 

It doesn't have to be one, but a changer is invisible (unless you want to disguise the FFC as a part of the room decoration). You just use one FFC for a room and place switch combos on the screen (you probably will want it on a layer so that the switch tiles' backgrounds are transparent against the floor). You do not need one FFC for each switch, just one FFC for each room with this puzzle.

 

The reasoning for this is Jamian requested the script, and he wanted something more user-friendly than the Lights Out script that already existed here (installing that is a whole lot of trouble).



#9 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 17 May 2013 - 06:13 AM

Here are my reports on this very nice piece of work:

 

1) It apparently doesn't work if the switches are on layer 0 (the secret is activated immediately). Not a problem at all for me, so it doesn't need a fix. I just figured I'd mention it.

2) For some reason the sfx plays once upon entering the room.



#10 Soga

Soga

    Secretly Alive

  • Members

Posted 17 May 2013 - 11:25 AM

Thanks for the report, Jamian. I've updated the original post in this thread with a link to the fixed script. It will work for layer 0 now, and the sound should no longer play once upon entering the room.



#11 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 17 May 2013 - 11:38 AM

Ah, one more thing that is more problematic:

 

The script requires you to be well aligned with the switches in order to trigger all the adjacent ones.

 

(edit: wrong example)

 

If you're using slash you have to make sure the proper switch is being hit first.


Edited by Jamian, 17 May 2013 - 12:00 PM.


#12 Soga

Soga

    Secretly Alive

  • Members

Posted 17 May 2013 - 11:44 AM

If you're using slash you have to make sure the proper switch is being hit first.

 

This is intended to prevent slash from causing switches to behave unpredictably when multiple switches are struck at once.


Edited by Soga, 17 May 2013 - 01:06 PM.


#13 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 01 June 2013 - 06:31 AM

Would it be possible to add something so that diagonal sword strikes are not taken into account?



#14 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 01 June 2013 - 03:28 PM

Can this script be adjusted to use the hammer instead of the sword?

#15 Soga

Soga

    Secretly Alive

  • Members

Posted 01 June 2013 - 03:57 PM

Jamian and NewJourneysFire: Sure! I'll whip up customized flavors of the script for both of you.





Also tagged with one or more of these keywords: FFC

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users