This script allows you to place lock blocks that use a custom key type to open them. You may place up to four unique lock blocks per screen, that use the same key type, but work independently.
This ffc script allows placing up to four custom (scripted) lock blocks per screen, in addition to the normal, single lock block allowed by ZC.
Combo Set-Up
Create eight combos, as follows:
1. Lock block tile, combo type 'none', solid. Note down the combo ID for this one, as you will need it later.
2. Unlocked lock block tile, combo type 'none', no solidity.
3. Same as 1
4. Same as 2
5. Same as 1
6. Same as 2
7. Same as 1
8. Same as 2
These combos must be sequential. See the combo page used in the test quest.
Assign the ID of (1) to the constant 'CMB_LOCKBLOCK2' in the script.
Assign an unlock sound from Quest->Audio->SFX to the constant 'SFX_SPEC_LOCKBLOCK' in the script file. The default is the 'Shutter' sound in the Classic tileset.
The constant 'TIMER_WALK_UNLOCK' is used to determine the number of frames that Link must push against the lockblock, to try to open it. The default is 50 frames, but you may adjust this as you deem necessary.
The constant 'SCREEN_D_SPECIALLOCKBLOCK' is assigned to the index of Screen->D[n] used by the ffc to track opened locks. The default is '7', but if you already use Screen->D[7] for something else, change the value assigned to this constant to an unused Screen->D[] index.
If you wish to use custom keys...
Enable custom keys by setting the script constant 'USE_CUSTOM_KEYS' to a value of '1'.
Create a new item, with a key tile. Assign its counter ref to CR_SCRIPT1, or if you are using that for something else, pick a different script counter and assign the constant 'CR_LOCKBLOCK' key (in the script) to the value of that counter (see std_constants.zh).
Set it's type to a custom item class type.
Set it's counter 'increase' and 'not above' values' to whatever you want as the cap. I used 99.
FFC Usage
Compile the script, and assign the ffc script to a slot. The included item script is not used.
Place the ffc on a screen on which you intend to use the special lockblocks.
Set the ffc combo to combo ID '1', or a combo with a blank tile that is not Combo 0.
Set the script of the ffc to 'SpecialLockBlock'.
Set the ffc flag 'Run on screen init.'
Place custom lockblocks on the screen.