I'm trying to write a script for the game I'm developing that allows specific mouseover captions for objects, based on the inventory item that is selected. So for example, if you selected a hammer and moused over any object, the default caption would be "use hammer with [object]", but if you moused over a toolbox, it would say "put hammer back in toolbox".
I have the special captions stored inside the objects' script. For this example, toolbox.script contains this attribute: toolbox.hammer = "put hammer back in toolbox"; so that when you mouseover with the hammer, the game.loop script looks for ActiveObject.SelectedItemName and if it exists, displays that caption instead of the default one. The problem is, I can't seem to find a way for game.loop to test whether or not ActiveObject.SelectedItemName exists. I've been told that eval() is a possibility, because it can turn a string into a command, but Wintermute doesn't support it. What would the code look like that would allow me to test this dynamically?