Requires:
std,zh,
ffcscript.zh,
Set-Up
Configuration Settings
Ordinarily, you may use the default settings included with the file, however, sould you wish to modify anything, you may do so by changing the values applied to the constants defined as setting values. Boolean settings are off if set to '0', and on if set to '1' or any non-zero value.
MSG_SWITCHSHOT_PICKUP
The default ID of a Screen_>Message to display when the user picks up the switchshot item. If set to '0', no message will appear.
SWITCHHOOK_USE_LAYER_0
SWITCHHOOK_USE_LAYER_1
SWITCHHOOK_USE_LAYER_2
Enable the layers on which you wish to allow the switchhook to swap Link with combos, by setting any combination of these to '1'.
SWITCHHOOK_ENEMIES_REQUIRE_SPECIAL_DEFS
Leave this set to '1', to use enemy editor defence properties to control what npcs are affected.
SUPPORT_GHOSTED_ENEMIES
If you use
ghost.zh, this should be set to '1'.
__GHI_GHZH_DATA_INDEX
This must match the value of
__GHI_GHZH_DATA ; this is usually 15.
SWITCHHOOK_SUPPORT_NORMAL_FFCS
Set to '1' to allow swapping with an ffc in general (not ghosted enemies)
CF_SWITCHHOOK
Set this to the ID of the combo flag that you wish to use to indicate a valid
switchhook target.
SFX_SWITCHHOOK
Set this to the sound effect that you wish to use when Link is swapped with any target (combo, ffc, npc, ghosted enemy).
CMB_SWITCHHOOK_UNDERCOMBO_D_LAYER_*
CMB_SWITCHHOOK_UNDERCOMBO_S_LAYER_*
CMB_SWITCHHOOK_UNDERCOMBO_C_LAYER_*
Default undercombo ComboD, ComboS, and ComboC (combo ID, combo solidity, combo CSet) used for layers 0, 1, and 2. Set as desired.
NPCDT_SWITCHHOOK
The NPD Defence type
default used if no special type is defined int he item editor arguments.
Compiling
Be sure that you import
std.zh, and
ffcscript.zh, and include this script in your buffer, or otherwise import it.
Compile.
Assign the
ffc script '
SwitchHook' to an ffc script slot.
Assign both
item scripts, '
SwitchHookItem' and 'PickupSwitchShot' to item script slots.
Item Configuration- Create a new item, and name it SwitchHook, SwitchShot, or whatever you fancy.
- Set its pick-up script to 'PickupSwitchShot'
- Set its action script to 'SwitchHookItem'
- Configure the item arguments as follows:
D0: Message, if you wish to use something other than the default defined by MSG_SWITCHSHOT_PICKUP.
D1: The Combo Inherent Flag for the Switchshot combos. Defaults to CF_SWITCHSHOT if set to '0'.
D2: The sound to play when switching. Defaults to SFX_SWITCHSHOT if set to '0'.
D3: The NPCDT used to define switchshot specific enemies, or enemies affected by the switchshot's moving power. Default value: 12.
Note: This is only used if SWITCHHOOK_ENEMIES_REQUIRE_SPECIAL_DEFS is enabled.
Enemy Configuration
If
SWITCHHOOK_ENEMIES_REQUIRE_SPECIAL_DEFS is enabled:
Set the npc defence 'Hookshot' to 'Ignore if < 1', or whatever value you configured as the required defence, if you changed the default.