Roulette wheel. Step on FFC and press EX1 to spin it. You need to meet counter requirements to do this. Roulette itself is d360 and does not do anything, only set it`s InitD[7] to result angle. While roulette is spinning, InitD[7] is set to -1. You need other scripts that can read FFC`s InitD[7] to determine and resolve various events depending on wheel spin result.
Roulette wheel event resolver. Has up 4 events, one of them can happen after spinning the wheel.
Roulette wheel combination lock. Keep spinning wheel until it lands on correct angle or within tolerance sector to open secrets.
Update 15.01.2022
- FFC`s combo now changes to next in list until roulette wheel finishes spinning, then changes back.
- Counter cost can be subtracted per spin. See setup instructions.
-
1. Set up combo that points to top-left corner of 3*3 tile sheet of wheel.
2. Set up 2 consequtive combos for trigger button.
3. Import and compile the script. ghost.zh is needed.
//Roulette wheel.
Place FFC with 1st combo from step 2 on the at activation button.
D0 - combo position where the wheel will be located. Size is 3*3.
D1 - combo used to render roulette wheel
D2 - counter required to spin the wheel
#####.____ - counter ID;
_____.#### - counter cost, not subtracted on spin, if D3==0.
D3 - if > 0 - subtract cost.
//Roulette wheel event resolver.
Has up 4 events, one of them can happen after spinning the wheel. Each event has minimum angle value (0-359) that roullete must stop at for event to happen. Only 1 event happens per spin. Each event is evaluated in sequence, in order: D1, D3, D5, D7. So for 4th event to happen, the following inequality must be true: D1 > D3 > D5 > D7. If Roulette result is lower than D7, in that instance, nothing happens.
Place invisible FFC anywhere in the screen.
D1, D3, D5, D7 - angles used to determine event chances.
D0, D2, D4, D6 - events to occur
#####.[0-31] - counter affected, in positive or negative way. #####.____ amount, _____.#### - counter to affect.
_____.0033 - Trigger permanent screen secrets
#####.0034 - Spawn 1 enemy. High value - Enemy ID.
#####.0035 - Positive - give Link item #####. Negative - take away item ##### from Link`s inventory.
//Roulette wheel combination lock.
Keep spinning wheel until pointer on the right lands on correct angle or within tolerance sector to open secrets. Unlike normal roulette wheel, it does not cause Link to freeze in place until spinning wheel stops.
Place FFC with 1st combo from step 2 on the at activation button.
D0 - combo position where the wheel will be located. Size is 3*3.
D1 - combo used to render roulette wheel
D2 - counter required to spin the wheel
#####.____ - counter ID;
_____.#### - counter cost, not subtracted on spin, if D5 ==0.
D3 - target angle, or bisect of target sector.
D4 - Tolerance value. Higher the value, the wider is target sector to land into and open secrets.
D5 - if > 0 - subtract cost.