LerpworksAcademy
On this page

World and levels › Space and combat

Level scripting: triggers, doors and scenes

Know first: Blockout: a world of boxes

This lesson is about how a level responds to the player: zones that start events when the player walks in, doors and elevators, enemies that arrive on cue, short scenes. At the center of it is one question: how to make a script survive a player who comes the wrong way. In the demo you’ll choose where a trigger for an ambush goes and send the player along two routes.

Why this matters

A level built from walls and floors is a stage with no performers. Scripts make things happen in it. A door opens when a fight ends, a bridge falls behind the player, a guard says a line as the player passes. They also cause some of the worst bugs a level can have. A player who comes in through a window instead of the door may never start the fight that unlocks the exit, and then they are stuck for good. A script is only as good as its handling of the players who don’t do what the designer expected.

Further in the article

  1. Cues in a theater
  2. What level designers script
  3. How a trigger works
  4. When the player comes the wrong way
  5. Doors are harder than they look
  6. Short scenes
  7. When scripts collide
  8. Planning a script
  9. Where it breaks
  10. Connections: the same idea in other fields
  11. Sources and further reading
  12. Key points
  13. Test yourself