Using a variable as hotspot description?

Started by pharc, Sat 20/03/2021 14:42:30

Previous topic - Next topic

pharc

Hello community!

I'm new here and to the software. I've been learning to code for the past six months and came upon AGS. I love it so far, having tons of fun with it!

There is one thing that I can't get over. I've tried googling around but I haven't found a solution, given there even is one.
I want the hotspot's Description (under Appearance) to change based on, for example, when the player looks at it. Obviously the description is just a string and so it shouldn't be any problem having a variable in there or to call some function to change it.

I mainly came across hotspot[2].SetTextProperty("Description", "jep"); but that just changes a custom property called Description. Not the actual description.
I'm not interested in using Display for this.

Sorry if obvious or asked a lot. I assure you I have spent quite some time trying to figure this out.



Crimson Wizard

#1
AGS is very old, and it still has number of restrictions left from many years ago when they were meaningful (for example to save program memory). We were improving this situation gradually, but some still remain. Hotspot's description is one of them, it cannot be changed at runtime.

Using custom property or regular String variable in script is a way to go here. You only need to adjust your script that displays object names to use custom property instead. Or use custom property if it has a non empty value and display original Hotspot.Name instead if nothing was set yet.

pharc


SMF spam blocked by CleanTalk