I would like the Player to be able to throw any of his inventory items out the window.
I would like a display to read: "You throw your [active inventory item] out the window."
Is there a convenient way to get a textual description of whatever the ActiveInventory happens to be without having to write "if" statements for each possible inventory item?
I tried using the GetTextProperty command as described in manual, to no avail.
I tried editing "Properties" for each item, but it does not appear to be item-specific.
I am very confused. Please help.
Quote from: dace on Tue 23/12/2008 23:53:58
I would like the Player to be able to throw any of his inventory items out the window.
I would like a display to read: "You throw your [active inventory item] out the window."
Is there a convenient way to get a textual description of whatever the ActiveInventory happens to be without having to write "if" statements for each possible inventory item?
I tried using the GetTextProperty command as described in manual, to no avail.
I tried editing "Properties" for each item, but it does not appear to be item-specific.
I am very confused. Please help.
Of course there is.
All you need is this:
Display("You throw your %s out the window.",player.ActiveInventory.Name);
so simple, yet so effective.
I thank you.
Glaaad to be of serviceee
I believe that ActiveInventory is a pointer of a InventoryItem type. So you can use any of the InventoryItem functions on it.
~Trent
PS-The AGS Wiki has a good article (http://www.americangirlscouts.org/agswiki/AGS_Pointers_for_Dummies) on pointers.