What am I doing wrong that causes rudimentary things to seem so complicated?

TM123
I have an apple tree surface object:

"You can see an apple tree (on which there is some apples)."

The template for "SurfaceContentsPrefix" is not dynamic. It is just "on which there is"

Would it work if I deleted the fundamental "SurfaceContentsPrefix" template from the English.aslx file and created a dynamic one of the same name with "on which there " + WriteVerb(object, "be") ?

This seems rather complicated for the beginner. Is there an easier way, like setting the object type to "Inanimate objects (plural)?"

The Pixie
How is this going to work? If the player types TAKE APPLE, will the tree no longer have any apples?

I would be tempted to have the apple in the room set to scenery, rather than on the tree as a container. Have a flag on the tree and when the apple is taken, set the flag. If the player tries to take another, Quest can say the other apples are too high to reach. It will still not be trivial, as you will need to cover GET APPLE FROM TREE, etc.

TM123
The plural apples object is just for show (and it is showing as "is apples" instead of "are apples.") For picking/taking apples I have an apple prototype object in a "nowhere" room which gets cloned, and an appletree.applecount attribute. The script replaces the apples object with a single apple object if there is one left, and removes it if there are none.
I just discovered description strings can be replaced with scripts, so maybe I'll do it differently.

XanMag
You should play Xanadu the worlds only hope and find my purple berry bush. It's quite similar! Lol

XanMag
I created a room as part of my tutorial game (keep in mind, I am not finished with this room yet, as you might find it not quite smooth yet), but if you copy-paste the code below into a game, you can see how I solved your problem with the is/are. Also, I have the apple repeatably takeable under proper criteria.

This is the code for my 'items room' (nowhere room) containing an apple.
<object name="items room">
<inherit name="editor_room" />
<object name="apple">
<inherit name="editor_object" />
<eat type="script">
msg ("You scarf the delicious apple down in just a few bites! Yummy!")
MoveObject (apple, items room)
SetObjectFlagOff (lush green fruits, "taken")
</eat>
<talkto type="script"><![CDATA[
msg ("You speak meaningfully to the apple.<br/><br/>It responds... \"Thanks for taking the time to speak with me. No one does that much anymore these days. I would really like to be back with my apple family. Do you think you can appease me?\"<br/><br/>You think about it and decide that you would miss your family too. You nod affirmatively and the apple grins at you. \"Thank you again!\"<br/><br/>With that, the apple dissappears from your hand and vanishes into thin air.")
MoveObject (apple, items room)
SetObjectFlagOff (lush green fruits, "taken")
]]></talkto>
</object>
</object>


Below is my code for the room with the apple tree.
  <object name="multiple equal objects room">
<inherit name="editor_room" />
<object name="Tree">
<inherit name="editor_object" />
<inherit name="surface" />
<look>It's a fruit bearing tree -</look>
<takemsg>You can't very well take the entire tree!</takemsg>
<climb>You climb the tree but quickly realize that apple trees aren't the greatest for climbing. You scurry back down to the ground where you belong.</climb>
<feature_container />
<hidechildren />
<listchildren />
<listchildrenprefix>on which there are</listchildrenprefix>
<contentsprefix>on which there are</contentsprefix>
<object name="lush green fruits">
<inherit name="editor_object" />
<look>These apples look delicious!</look>
<take type="script">
if (GetBoolean(lush green fruits, "taken")) {
msg ("You already have an apple and you do not want to damage this healthy tree by taking another apple! You leave the apples be.")
}
else {
msg ("You pluck a delicious looking apple from the healthy tree.")
AddToInventory (apple)
SetObjectFlagOn (lush green fruits, "taken")
}
</take>
<ontake type="script">
</ontake>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<alt type="stringlist">
<value>fruit</value>
<value>apple</value>
<value>apples</value>
</alt>
</object>
</object>
<object name="mallet">
<inherit name="editor_object" />
<look>It's a rubber mallet - perfect for smashing innocent fruits!</look>
<take />
<feature_usegive />
<selfuseon type="scriptdictionary">
<item key="apple">
msg ("You bludgeon the innocent fruit to bits.")
SetObjectFlagOff (lush green fruits, "taken")
MoveObject (apple, items room)
</item>
</selfuseon>
</object>
<object name="Magoo">
<inherit name="editor_object" />
<inherit name="editor_player" />
<look>You're Magoo. A simple being trapped in a test game.</look>
<attr name="pov_look">You're Magoo. A simple being trapped in a test game.</attr>
</object>
</object>
<verb>
<property>talkto</property>
<pattern>talk to; speak to</pattern>
<defaultexpression>"You can't talk to; speak to " + object.article + "."</defaultexpression>
</verb>


You'll likely notice my not-so-smooth part of this after playing. I named the apples on the tree 'lush green fruits' as to not confuse them with the apple that ends up in your inventory. I did this so that you could see the code/response for trying to take a second apple. Also, if I named them 'apples' the built in Quest command for take apple (if you already had one), "You are already carrying it.", would override my desired response. I wasn't patient enough right now into fixing it. The downside to this method is that you can't type 'take apple(s)' from the tree, you have to type 'take fruit(s)'. I did not add an 'apple(s)' alias to the fruits because I wanted to avoid (for now) the pop up question: which apple do you mean?

Hopefully, despite that, you get the idea. Let me know if it helps.

XanMag

TM123
Ah, changing the prefixes works wonderfully.
I use a script for picking the apples, which avoids "which apple" although trying to eat one asks if you mean the tree.
I was thinking about making the tree fully functional, which would include:

picked apples rotting after a certain number of turns
climbing the tree to reach apples in the upper branches
falling out of the tree and dying if you try to pick two apples at once while in the tree
dropping apples from in the tree drops them to the ground
ripe or unripe apples depending on the season
the tree can be chopped down, leaves and branches taken off
carving your initials in the bark with a knife
examining the leaves under a microscope shows the cellular structure
using the wood in a barbeque imparts a delicate flavor
planting the seeds grows a new tree

maybe not...

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums