Tune an FM station
On this page
WORKED EXAMPLE / FM RADIO
Make each press change exactly one station step. Start on 96.0 MHz and let the player tune across a 20 MHz band.
In Variable Designer, add a number variable with ID frequency and starting 1 value 96. In your GUI, add a Knob. In its rotary dialog choose Knob, set Face caption to FM and Value suffix to a space followed by MHz. Enable Show primary readout.
Scroll to Hand 1. Keep the Handle ID as value. Type the following settings and 2 choose OK. Use the hand editor for the fractional step.
Two fields, two jobs#
Step controls how much the player moves per nudge. Write value to variable tells the rest of the game which reading changed.
The radio’s Hand 1 record in the rotary inspector.
| Minimum | Maximum | Step | Initial value | Write value to variable |
|---|---|---|---|---|
| 88 | 108 | 0.2 | 96 | frequency |
Keep Start angle at −135°, Sweep at 270° and Wrap at full turn off. One 3 division on the drawn scale does not have to equal one step. Ten divisions give a readable face while each keypress still moves 0.2 MHz.
Check the exact station#
After three Right presses the readout is 96.6 MHz. Start a Trace capture. In Debug & Profile → State, evaluate global.frequency. If a puzzle rewards a narrow station, compare a small range around its center to accommodate decimal arithmetic.
