Change @OVERHOTSPOT@ description [solved]

Started by HandsFree, Thu 15/03/2012 11:45:20

Previous topic - Next topic

HandsFree

I'm using a label with @OVERHOTSPOT@. According to the manual that should give the hotspot name (but instead it gives the description, which is fine).

But I like the description to change during gameplay. Is that possible?
hotspot.description = "new name" doesn't work cause it's read only.

thanks


HandsFree

Thanks, I searched but got an error as usual.  :(
I can see the code you provided returns a new description, but how do I make that appear in the @OVERHOTSPOT@ label?

I assume the code goes in GlobalScript.asc. But where do I put lblHotspotDesc = OtherName(Game.GetLocationName(mouse.x, mouse.y));?
And do I need to set it back to @OVERHOTSPOT@ somehow for all the hotspots that don't change?


Khris

Just put the line inside the repeatedly_execute function.

If you use this function, you don't need @OVERHOTSPOT@ any longer.
What the function call does is get the name of whatever is under the mouse and pass it on to OtherName().
That function in turn can now replace the description with another String (or append something to it), and the result is then set as the label's text.

HandsFree

Yes, I have to experiment with it some more but at first glance it seems to work.
Thanks.

SMF spam blocked by CleanTalk