Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Thu 10/12/2020 11:18:33

Title: Naming objects on the fly
Post by: Slasher on Thu 10/12/2020 11:18:33
Hi

I have empty object food containers that can be filled with food. There are a number of food items to choose from. As each container is filled it goes to the top of the screen...

I need each container to set the description of the food inside... which of course could be any of the food items..

Can you help?

Cheers
Title: Re: Naming objects on the fly
Post by: Crimson Wizard on Thu 10/12/2020 11:46:17
Custom Properties is the only way at the moment, as AGS does not support changing object's name (description) at runtime.

Setup a custom proper schema in the editor, create a String property, call it as you like, and mark it as applied to Objects (or other types if you need).

Then in script you can use GetTextProperty and SetTextProperty to get/set your custom value.
Title: Re: Naming objects on the fly
Post by: Slasher on Thu 10/12/2020 14:08:31
Thank you Crimson...

Another inst to add to your list of TODO's  (laugh)

Cheers