Triggering events via hidden objectives. This tutorial explains how you can trigger events on the completion of
hidden objectives. In this tutorial, we'll create a system where a door will automatically open when approached by the player, but only if he is carrying a KeeperMedal (-4429). The first thing to do is to create a scenario where this will make sense. Add the FrobInert (-1629) metaproperty to the door - we don't want the player to be able to open it normally. To achieve our effect, we are going to use an invisible goal, so the
first thingto do is to set one up.
Even though this goal is invisible, it will still be marked as completed
when the player is carrying a KeeperMedal (-4429),
and set back to incompleted when the player is no longer carrying one. To trigger an event when the objective is completed, we need to create a QuestVarTrigger (-4370), and set up its Trap->Quest Var property as follows: =1:goal_state_20 Make sure you enter that in verbatim, or it won't work. Now, create a RequireAllTrap (-2649), add a ControlDevice link from the QuestVarTrigger (-4370) to the RequireAllTrap (-2649), from the BoundsTrigger (-2086) to the RequireAllTrap (-2649), and from the RequireAllTrap (-2649) to the door. Finally, create a KeeperMedal (-4429) on the side of the door that the player starts on. That should do it. You can also use this effect to trigger events via the other types of
objective ('Kill a Creature', 'Go to a Location', 'Steal a Certain Amount
of Loot'), and also with reversed goals. |