This tutorial will show you how to create the triggers necessary to open a locked door, like in the Dungeon missions.
First, create the map. All you need to do to test these triggers, is put a Paladin down, the item ‘Ghost Key’ next to him, place a gate, and create a region just in front of the gate.
It should look like this:
Event:
Unit – A unit enters Region001 [gen]
– If any unit enters the region next to the gateCondition:
((Triggering unit) Equal to Paladin 0000 [gen]) and ((Item carried by Paladin 0000 [gen] of type Ghost Key) Equal to Ghost Key 0001 [gen])
– as long as that unit is the hero (selected), and he has the Ghost Key (also selected)Action:
Destructible Doodad – Open Demon Gate (Diagonal 1) 0000 [gen]
– Open the gate (selected)
This should look like so in the Editor:
Another way to do this, is to use the If/Then/Else trigger. Like so:
Event:
Unit – A unit enters Region001 [gen]
– If any unit enters the region next to the gateCondition:
No ConditionsAction:
If (((Triggering unit) Equal to Paladin 0000 [gen]) and ((Item carried by Paladin 0000 [gen] of type Ghost Key) Equal to Ghost Key 0001 [gen])) Then do (Destructible Doodad – Open Demon Gate (Diagonal 1) 0000 [gen]) Else do (Do Nothing)
– This creates just the same effect as before, however, the condition and action are now both in a single action.
This should work, if not, try fiddling about with the unit animations instead of using the ‘Open Door trigger’.