Object Properties
Jordan
21 Feb 2004, 04:17Okay, I get the feeling that I should know this, but here it goes...
Is it possible to display an object's property? For example, say I wanted to make a "food" object, with a "taste" property equal to "sweet." Would it be possible to make it so that it would say something like, "You eat the #food#. It tastes ______?" But in the blank would be that property? Help would be appreciated.
edit: Oh, and I plan to make like a "Life" sort of game. Instead of making a seperate eat procedure for each item, I would like to make it somewhat easier, and use a property, but I don't know how to display properties.
Is it possible to display an object's property? For example, say I wanted to make a "food" object, with a "taste" property equal to "sweet." Would it be possible to make it so that it would say something like, "You eat the #food#. It tastes ______?" But in the blank would be that property? Help would be appreciated.
edit: Oh, and I plan to make like a "Life" sort of game. Instead of making a seperate eat procedure for each item, I would like to make it somewhat easier, and use a property, but I don't know how to display properties.
I think Im Dead
21 Feb 2004, 05:54Yep, you'd basically make a command <eat #object#> have it test that the object is edible, if it is, then msg <You eat #object#. It tastes $objectproperty(#object#; taste)$> and it's done.
Jordan
21 Feb 2004, 06:00Thank you, ITID. Your help is appreciated (at least by me).
Alex
21 Feb 2004, 16:50Slightly more readable (but works just the same):
msg <You eat #object#. It tastes #object:taste#>
msg <You eat #object#. It tastes #object:taste#>
Alex
21 Feb 2004, 16:51Actually even better would be:
msg <You eat #@object#. It tastes #object:taste#>
with the @ sign. Then if "object" has an alias, that will be displayed instead of the code name.
msg <You eat #@object#. It tastes #object:taste#>
with the @ sign. Then if "object" has an alias, that will be displayed instead of the code name.
Jordan
07 Mar 2004, 01:58Thanks Alex, but now I'm back with another question! Whoopee! Anyway, now my question is....
How do you run an object's "action" script, as under "Properties and Actions...."
Yes, another simple one, but I would still appreciate help.
How do you run an object's "action" script, as under "Properties and Actions...."
Yes, another simple one, but I would still appreciate help.
I think Im Dead
07 Mar 2004, 03:21doaction <objectname; objectaction>
Jordan
07 Mar 2004, 05:28Thanks again, ITID.
codingmasters
16 Mar 2004, 05:54For that matter, how do you activate an Action using QDK commands?
Matthew G.
Matthew G.
Jordan
16 Mar 2004, 15:48Edit..
Add Command
Objects
Run an object's(or room's) action script
Or, under "Other Script Command", which is under "Other", put in "doaction <objectname; objectaction>", then it will detect it and set it to the above.
Add Command
Objects
Run an object's(or room's) action script
Or, under "Other Script Command", which is under "Other", put in "doaction <objectname; objectaction>", then it will detect it and set it to the above.
codingmasters
19 Mar 2004, 00:04Thanks for the help
Matthew G.
Matthew G.
paul_one
10 Apr 2004, 16:22Alex - I thought #@name# returned the ACTUAL name of the object when ou use the alias....
Is the reverse true? So it both fetches the alias AND original name when you use it (depending on which is used)...
Is the reverse true? So it both fetches the alias AND original name when you use it (depending on which is used)...