How to Make Things Edible?

HyperMasenko
14 Jul 2013, 15:46
I am going to create an RPG-life Quest game that will include vehicles, food, etc. Food is pretty much the only thing that I am missing.

Any clue of what to do?

jaynabonne
14 Jul 2013, 20:25
Quest provides an "eat" verb. By default, if you try to eat something, Quest will respond "You can't eat it." If you want something to be edible, then create an "eat" attribute on that object. If the "eat" attribute is a string, then that string will be printed when you try to eat the object. If the "eat" attribute is a script attribute, then the script will be run when you try to eat the object. You could print out a message and then move the object to an inaccessible "holding" room, so that the object will disappear from the player's inventory (or the room), as if eaten.

If you could provide more input about what exactly you mean by "edible" or what you want to happen when an object is eaten, I'm sure someone can help further.

HegemonKhan
16 Jul 2013, 01:16
here's a "drink" verb I created:

<object name="exp_potion_100">
<inherit name="editor_object" />
<alias>100 exp potion</alias>
<alt type="simplestringlist">potion; pot; exp pot; exp pot 100; 100 exp pot</alt>
<take />
<drink type="script">
msg ("You drink the exp potion, receiving 100 experience.")
player.experience = player.experience + 100
exp_potion_100.parent = game_storage_object
</drink>
<displayverbs>Look at; Take; drink</displayverbs>
<inventoryverbs>Look at; Use; Drop; drink</inventoryverbs>
</object>


as for "edible", it is done as a Boolean, String, or Inherited (Object Type), to enable~connect~to whatever script you want run.

if you are interested in this, I can try to explain it to you, but it is a bit more advanced stuff to deal with.