Log inGet started
World

Bastion Works: Towers, Turrets and Targeting Kit

README.md

gallery.SwitchPad

Part of the Bastion Works showcase world's own content, not part of turretsKit or projectileKit. A glowing pad on the floor that changes one setting of a turret.

Step onto it (or press E, or tap the screen, while standing on it) and the turret named by turretName moves to the next value of field: its type, its tier, its targeting mode or its style. field = "styleAll" changes the style of every turret at once (the world default for auto turrets via TK.setStyle, and every turret's own synced style via TK.setStyleAll). Changes go through turretsKit.api, so they work from any player's machine and every player sees them.

The pad is local UI only: it is not synced, and it reads the turret's synced fields for its sign: two lines, the title and the current value, plus "E / tap: next" while you stand on the pad. The ring pulses on each press. In edit mode the sign still follows the turret's current value. The gallery scene places five of them from gallery.layout.

Public fields (all NoSync)

FieldTypeDefaultMeaning
turretNamestring"Workshop"Name of the turret entity this pad changes.
fieldenum def tier targeting style styleAll"def"Which setting it steps through (def = the turret type).
titlestring"TYPE"What the pad's sign says.
radiusnumber0.95How close (flat distance, metres) the local player must stand.
colorcolor{ r = 1, g = 0.8, b = 0.25, a = 1 }Colour of the glowing ring.
signHeightnumber0.95How high the sign floats over the pad, in metres.
signSizenumber0.42The sign's text height, in metres.

signSize and signHeight can change while the pad runs and the sign follows; gallery.PhoneFraming uses that to size and stack the signs on a phone held upright.