Skip to reading
Adventure Mechanics & Effects

Give the right words a consequence

Edition 0.86.3.4

Build authored boxing, camera moves, weather, attachments, inspectable objects, a radio and two-object puzzles using the existing adventure tools and scripts.

Download PDFView PDF page

SCRIPT TEXT / BELL

Use this block in a third native GDScript record named ring_signal. The parser calls it after recognizing the custom command. Replace station with your bell room’s actual ID. It shares the heard_signal value with the radio.

Code example
func run(_ctx: Dictionary = {}) -> void:
    var v = Runtime.variables
    var words = "There is no bell here."
    if Runtime.scene_id == "station":
        if v.get("porter_absent", false):
            words = "Only the pigeons answer this time."
        elif v.get("heard_signal", false):
            v["porter_absent"] = true
            words = "Two rings. The porter hurries down the platform."
        else:
            words = "The porter points to the radio. 'Listen first.'"
    await ShowMessage({"text":words})

Make the change visible in your own room#

01. The script above handles the response and remembers the result. For an immediate, simple disappearance, insert the following line just after v["porter_absent"] = true. Indent it to match that line. Replace porter if your room instance uses a different ID.

Code example
            await SetObjectVisible({"entityId":"porter", "visible":false})

02. For a more natural exit, play a walk-away movement or cutscene before hiding the porter. In the room’s recurring entry logic, check porter_absent and hide him again when it is true. If the door itself blocks the player, make its Use action accept this flag as well.

03. Save and test in this order: ring before listening, listen at 1140, ring again, leave the room, return and ring a final time. You should get a hint, one successful departure, then an already-solved response. Check visually on return that the porter stays gone and the door stays usable.

Page 29 of 29Permalink
Go to page