Voxel Game Maker

Docs Tutorials

Scripts: events and actions

Your first script graph: an event, a wait, and actions that happen in order.

Build · about 20 minutes · Advanced mode

What you'll make: a lamp that says something when you touch it, waits, then says something else.

Before you start: finish Level 2, up to Capstone: a small adventure with a quest. Switch to Advanced with Basic | Advanced on the toolbar.

In the editor: Welcome ▸ Tutorials ▸ 3.1 ▸ ▶ Start goes on in your My Playground project with this lesson's checklist (and switches to Advanced).

#1. A script for an object

  1. Place the Lamp post and click it with Select (1).
  2. Choose Create ▸ New Script…. The Scripts tab opens with a new script for the lamp: an Event, an Action and an End, wired in a row.

#2. When it happens

Click the Event node and set it to Player touches / steps on it.

#3. What it does

Click the Action node and pick Show text (popup). Type The lamp flickers.

#4. Wait, then do more

  1. With the Action picked, click + Add node ▸ Add Wait. It's wired in after the Action. Set it to 2 seconds.
  2. With the Wait picked, click + Add node ▸ Add Action: Show text (popup), Something stirs in the dark.

Play it now: press ▶ Play (F5) and walk into the lamp.

#Try it yourself

  • Change the Event to Player presses E (the use key).
  • Make the same thing as a Rule in Properties instead, then compare: which one could do the Wait?

#Learn more

#Next

Your first Quick code.