Does anybody know if it's possible to have a dialog option trigger a hotspot on/off or change the events of a hotspot?
And if it is, is it possible to have it trigger abilities of a hotspot in another room (actually I'm not sure, if dialogs are room specific...)?
Any help would be much appreciated :)
First of all, you can run standard script commands in dialog scripts by putting a blank space before them.
You can access hotspots in dialog scripts using the hotspot array (this will always point to the current room though).
Note the hotspot's ID in the room editor, then put a line like this in the dialog script:
hotspot[3].Enabled = false;
Now, to change the state of your game, what you use is variables.
In the Global variables pane, create a variable of type bool, name it appropriately (e.g. "door_unlocked") and give it an initial value of 0 ( = false).
Now you can set the variable to a new value in the dialog script, like this:
door_unlocked = true;
Dialogs aren't room specific, btw.
In the other room, in the "interact with hotspot" event's function, use code like this:
function hDoor_Interact() {
if (door_unlocked == true) {
Display("You open the door and walk through.");
player.ChangeRoom(5, 120, 250);
}
else {
player.Say("Unfortunately, the door is locked.");
}
}
Thanks a lot!
That was exactly what I was looking for :)
To get around the issue with dialogs not being room-specific you could do this:
if (player.Room == 1) hotspot[3].Enabled = true;