I'm having trouble specifying which objects trigger events on certain hot spots. Here's my simple example that I'm toying with:
Character has a key and a match in inventory. The key should be the only inventory item to unlock the cupboard, but right now, the match will also open the cupboard.
How do I set only the key to unlock the cupboard and retrieve the cup (retrieving the cup I've scripted already) and using the match on the cupboard will give a different outcome? Been all over the tutorials and could not find this.
~XyloCub
Check the ActiveInventory
function hDoor_UseInv {
if (player.ActiveInventory == iKey) {
//Open door
}
}
~Trent
function hDoor_UseInv {
if (player.ActiveInventory == iKey) {
Display("You have unlocked the cupboard!");
player.AddInventory(icup);
}
else Display("You do not have a key to unlock this cupboard!");
}
The "else" code will appear if you use anyother item on the cupboard.
And the "if" code will open the cupboard and let you recieve a cup, only "if" you have the specific key located in your Inventory.