trouble with getting a door opened from a conversation

Started by robbiejojo, Fri 06/02/2009 04:29:31

Previous topic - Next topic

robbiejojo

Sorry if this is explained in the manual somewhere but I couldn't find it. 
Here's what I'm trying to do:
After your done talking to someone, in a different room a door is no longer locked (in other words the hotspot to interact with it goes from saying "this door is locked" to letting the player go through.)  Seems simple enough but I can't figure it out.
Thanks.

Khris

Define a Global Variable (bool, name: door_is_unlocked, value: false), then set it to true in the dialog script:
Code: ags
 door_is_unlocked = true;

Note the space at the start of the line, it tells AGS to handle the line like a regular script command.

In the door's interaction, check for the variable:
Code: ags
  if (door_is_unlocked) {
    // open door, etc.
  }
  else {
    player.Say("It is locked.");
  }

SMF spam blocked by CleanTalk