Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SN1984jm on Sun 20/12/2009 19:15:19

Title: Changing name of inventory item
Post by: SN1984jm on Sun 20/12/2009 19:15:19
Say I want to name an item "unknown object" until the player has explored something somewhere in the game. After achieving this certain exploration, the name of the item should change to what it actually is.

Is this possible, since i did read in the manual: "It is not currently possible to change the name of an object at run-time". I saw this at "Object.Name".

Maybe they mean something else than what I want to achieve.

I was thinking about replacing the "unknown object" with a new object, which to the player looks exactly the same, but is actually another object in the script.
I was hoping there was a better way though.
Any ideas?
Title: Re: Changing name of inventory item
Post by: Calin Leafshade on Sun 20/12/2009 19:35:25
the best way to do this is to just replace the inventory item with a different item..

so you have one that is "unknown" and then the other one and just lose one and get the other.
Title: Re: Changing name of inventory item
Post by: Crimson Wizard on Sun 20/12/2009 20:04:54
Do you want to replace a name of an Object or an Inventory Item? Because these are different things.

For inventory item you can change InventoryItem.Name.

As for object, I guess, you'll have to make 2 objects with different names, at the beginning an object with known name should be disabled (invisible), when player completes necessary investigation turn visibility for "unknown object" off and to the one with specified name - on.
Title: Re: Changing name of inventory item
Post by: Calin Leafshade on Sun 20/12/2009 20:32:34
sorry i didnt know you could change inventory item names at runtime :p
Title: Re: Changing name of inventory item
Post by: SN1984jm on Sun 20/12/2009 21:30:27
Ah, great. Changing the inventory name did the trick! That's what I needed.