Okay I've had a look and couldn't find a topic on it (although there's so many, sorry if this has been asked before) nor could I find answers in the tutorials (although no doubt they're in there... somewhere buried).
Basically I want my character to refuse to leave a room until he's acquired all objects (in this case, two). The code I'm using at the moment requires the character to use a key to open a door. He'll do this whenever the key is used, but I want him to refuse to leave if he hasn't picked up the other item in the room.
The code at the moment is as follows;
function hHotspot2_UseInv()
{
if(player.ActiveInventory == iKey)
{
player.Walk(357, 215, eBlock);
player.ChangeRoom (2);
}
else {
Display("That's hardly going to work, is it?");
}
}
I need to change this so if you use the key without having the second object (iShaft) in your inventory, he'll say something along the lines of "There's still more to find in here."
I'm using the latest version of AGS, if that helps. Any pointers would be much appreciated. Thanks in advance!
Basically I want my character to refuse to leave a room until he's acquired all objects (in this case, two). The code I'm using at the moment requires the character to use a key to open a door. He'll do this whenever the key is used, but I want him to refuse to leave if he hasn't picked up the other item in the room.
The code at the moment is as follows;
function hHotspot2_UseInv()
{
if(player.ActiveInventory == iKey)
{
player.Walk(357, 215, eBlock);
player.ChangeRoom (2);
}
else {
Display("That's hardly going to work, is it?");
}
}
I need to change this so if you use the key without having the second object (iShaft) in your inventory, he'll say something along the lines of "There's still more to find in here."
I'm using the latest version of AGS, if that helps. Any pointers would be much appreciated. Thanks in advance!