Jump to content

Advanced Floor Switches Pack

Overview
Creator: Moosh Updated: 20 Sep 2020 Tags: FFC Downloads: 189
Rating[?]: Rating: 4.67/5 (5 ratings)
Download Package
(2.14 MB)
Information

Description Setup Reviews Comments

Constants for the SFX used by all scripts are at the top of the file. For all of these FFC scripts you'll want to check Run Script at Screen Init on the FFC so it runs before screen scrolling.

Some concepts shared by multiple scripts that you should be aware of:

Screen->D:
Screen->D is a set of 8 numbers unique to each screen of each DMap that are only used by scripts. This script uses portions of these numbers with a bit (huehuehue) of math to record which switches are pressed on which screens.
Switch ID:
This is a number between 1 and 128 that's assigned to a switch for keeping track of whether or not that switch has been triggered when re-entering the screen. ID 0 is for a temporary switch or a permanent switch using the screen's ST_SECRET state. Switch IDs are all combined together in groups of 16 into the 8 Screen->D values for the screen they're on. 1-16 go to D[0], 17-32 to D[1], ect. If another script is using Screen->D, use a switch ID that won't be within the same range to avoid conflict. If you're not using other scripts that reference Screen->D on screens with buttons, just remember to give each button a unique ID.

Remote Secret:
Some scripts will use scripted secrets to trigger events on a certain section of the screen. For these you specify a flag that's placed over those regions and when the secret is triggered, all combos in that region will be set to the next combo in the list, similar to how a lock block works. The flag used should be one without any properties, such as the script flags. You can also use 16-31 if there isn't a secret trigger on the screen.

Now onto the setup of the scripts themselves:

Switch_Secret
For this script, the FFC should have the combo for the unpressed switch. When the switch is stepped on, it will cycle to the next combo in the list, the pressed switch.

Arguments:
  • D0: Set to 1 to make the secret permanent
  • D1: Set to the switch's ID if the secret is tiered, 0 otherwise.
  • D2: If > 0, specifies a special secret sound. -1 for default, 0 for silent.
Switch_Remote
For this script, the FFC should have the combo for the unpressed switch. When the switch is stepped on, it will cycle to the next combo in the list, the pressed switch.

Arguments:
  • D0: Set to 1 to make the switch a pressure switch (a block or Link must stay on it to keep it triggered). Set to 2 to make it a pressure switch that only reacts to push blocks.
  • D1: Set to the switch's ID. 0 if the secret is temporary or the switch is pressure triggered.
  • D2: Set to the flag that specifies the region for the remote secret.
  • D3: If > 0, specifies a special secret sound. -1 for default, 0 for silent.
  • D4 (2.55 version only): Specifies the layer for the remote secret.
Switch_HitAll
For this script, all switches in the same group should share the same combo and be placed on layer 0. It should be the combo for the switch when it hasn't been pressed. When pressed, the combo will be set to the next in the list. Unlike the others, the FFC running this script is not one of the switches and should be invisible. You only need one FFC per set of switches.

Arguments:
  • D0: Set this to the combo number used for the unpressed switches.
  • D1: Set to 1 to make the switch a pressure switch (a block or Link must stay on it to keep it triggered). Set to 2 to make it a pressure switch that only reacts to push blocks.
  • D2: Set to 1 to make the secret that's triggered permanent.
  • D3: Set to the controller's ID. Set to 0 if the switch is temporary or you're using screen secrets.
  • D4: Set to the flag that specifies the region for the remote secret. If you're using screen secrets instead of remote ones, this can be ignored.
  • D5: If > 0, specifies a special secret sound. -1 for default, 0 for silent.
  • D6: If you want the script to remember which switches were pressed after leaving the screen, set to the starting ID for the group of switches. This will reference this ID as well as the next n-1 ID's after that where n is the number of switches in the group. Be careful to thoroughly test that this doesn't bleed into other switch ID's or Screen->D used by other scripts. If you don't want to save the switches' states or the switches are pressure switches, this should be 0.
  • D7 (2.55 version only): Specifies the layer for the remote secret. Switch combos themselves must still be placed on layer 0.
Switch_Trap
For this script, the FFC should have the combo for the unpressed switch. When the switch is stepped on, it will cycle to the next combo in the list, the pressed switch.

Arguments:
  • D0: Set to the ID of the enemy to drop in
  • D1: Set to the number of enemies to drop
Switch_Sequential
For this script, all switches should be the first of a pair of combos, the unpressed switch. Switches should all be placed on layer 0. Each switch should have a unique combo number. The order the switches have to be pressed goes by order of combo number, so the lower numbered switches in the order should have a lower combo number. Unlike the others, the FFC running this script is not one of the switches and should be invisible. You only need one FFC per set of switches.

Arguments:
  • D0: Set this to the flag marking all the switches on the screen. The order the switches have to be hit in will be determined by their combo numbers.
  • D1: Set to 1 to make the secret that's triggered permanent.
  • D2: If > 0, specifies a special secret sound. -1 for default, 0 for silent.
Hidden Switches:
For Secret, Remote, and Trap switches, you can hide them under combos by enabling the "Only Visible to Lens of Truth" flag. This will make the switch invisible (set to SWITCH_INVISIBLE_COMBO) until the combo underneath it matches the combo on the FFC, at which point the FFC will become visible and active. This doesn't work on Hit All or Sequential switches.

All scripts in this pack require std.zh.