Open the gate from far away

Try itTie it together with scripts

Here's the clever part. The shrine is in Whisperwood, but the gate is in Grimstone. How does one world open a gate in another?

The answer is the @variable. Every script in the game shares the same @variables, in every world. So Whisperwood writes @spell_broken, and Grimstone reads it.

Grimstone's script

# Grimstone: the gate opens once the spell is broken
if
​

Two rules

The first rule, when any {Heroes} enters, runs each time a hero comes into Grimstone. If the spell still holds, it shows a warning.

The hero stands below the castle's iron gate, and a banner says A dark spell holds the castle gate shut.

The second rule, when @spell_broken is yes, runs when the check becomes true. It also runs when the hero walks in and it's already true.

Then unlock the {Castle gate} takes the lock off, and the hero can open the gate with Open.

Into the courtyard

The hero opens the iron gate, walks through, and comes out at the keep, right in the courtyard with Milo and his guards.

Inside the courtyard: the hero has just come out of the keep's gate, with a crowned slime guard, Milo with his teal hair, banners and braziers around them

Beat the guards, talk to Milo, and he follows the hero. Lead him all the way back to the start in Hollyhill to win.

Put it in your game

Press Map Settings Map settings, pick Grimstone in the grid, and press Level script at the bottom. Type the script in.

This makes a new game in your Lab and opens the builder right here. It is free.

Press Play in the code box to finish this section.