Hi
ide like to know why
hHotspot5.Enabled = false;
sometimes comes up with this:
GlobalScript.asc(1462): Error (line 1462): Undefined token 'hHotspot5'
seems i cant use it if used with activeinventory function???
cheers
barefoot
That's because you're using the hotspot's name in the global script.
You can only access the current room's hotspots, i.e. if the player is currently in room 2, you can't turn off a hotspot in room 5 (that's because only the current room is loaded into memory and gets unloaded as soon as you leave it).
To access hotspots from the global script you have to use the hotspot array:
if (player.Room == 2) hotspot[5].Enabled = false;
This will turn off the hotspot with ID number 5 in room 2, but only if the player currently is in room 2.
If you didn't use the if check, the command would turn off the current room's hotspot 5, regardless which room the player is in.
If you actually want to do something to a hotspot in another room, you have to use a variable. You'd create a global one using the Global variables pane and change that, then check the variable's value in the before fadein event of the other room and change the hotspot accordingly.
Cheers Khris
yes, i understand now... i am now using an object instead and that works ok..
cheers Khris
barefoot
As long as it works... :)
But it's exactly the same situation with objects.