Hi. I’m trying to make a hotspot object the user can click, and then it will respond by, for example, taking them to a different level. My idea was to have a single hotspot object, with a variable “instanceName” that would have the unique name of this hotspot, and then a big structure with all the different hotspots in the game paired with, for example, a string to display when clicked, or a new level to load. So the structure would look like:
hotspots.texts.well - returns a string that I can use in a “display this string” function
hotspots.location.door - returns the name of a new level, stored as a string, that I can then use in a “go to this level” function.
This way I can see them all in one place.
I am open to the suggestion that this is a totally stupid way to organise this and to do it some other way, but I really think I’ve almost got it working. The issue seems to be in calling the structure. If I use this expression:
GlobalVariableString(hotspots.texts[Variable(object_name)]) I get 0 (where “object_name” is a local variable I’ve already defined and populated with the instanceName, for eg “well”
I’ve tried every permutation of the syntax I can think of. So
- Am I making an obvious syntax mistake?
- Am I going about this task backwards?
- Is there a central repository of this sort of syntax. The documentation seems very good but only covers the main introductory stuff. Is there a way to find the exact syntax and options for every expression?
many thanks