Hi, so I'm trying to figure this thing out. I have an object on my game, and the player has to use an inventory object on it so something happens. Then, after that happens, a hotspot that wasn't usable before needs to "unlock" somehow, how do I do that?
Set up a global variable boolean lets say "Unlocked" and set it to false.
from the editor create a "Use Inventory On Object" event for the object you have.
in the event do something like:
if (Player.ActiveInventory == oKey) {
Unlocked = true;
}
Then in the code for the hotspot only execute it if Unlocked is true:
if (Unlocked) {
.... do something
}
... and if what you mean by "a hotspot that wasn't usable before" is that the hotspot didn't appear at all, you should create an "Enters room before fade-in" room event, and edit the function that gets created to something like this:
function room_Load()
{
hNameOfYourHotspot.Enabled = Unlocked;
}
(Just remember that if you can unlock the hotspot from within the room, you also need to update hNameOfYourHotspot.Enabled when you change the value of Unlocked there.)[/code]
hm, can't one just use if (soandso) { hhotspopnumber.enabled=true; ?
Quote from: dayowlron on Tue 21/11/2017 14:32:18
Set up a global variable boolean lets say "Unlocked" and set it to false.
from the editor create a "Use Inventory On Object" event for the object you have.
in the event do something like:
if (Player.ActiveInventory == oKey) {
Unlocked = true;
}
Then in the code for the hotspot only execute it if Unlocked is true:
if (Unlocked) {
.... do something
}
This was it!!! Thank you dayowlron!