I’m trying to have a room with a tree and a metal ball, and have the metal ball fall out of the tree when you examine the tree, but have the metal ball be undetectable until you do so. At first I just put the ball on top of the tree, but then I thought it might be simpler to just create the ball offstage and move it into the room after examining the tree. But when I tried to do that it doesn’t work. I don’t get any errors or anything, but when I test it, the ball doesn’t show up.
Here’s the code I have:
[code]A palm tree is here. It is fixed in place. It has the description "A closer look at the palms reveals that there are, in fact, several small coconuts around the trunk. Some of them even look loose enough to shake down. You grasp the trunk of the tree and shake experimentally. After a few seconds, something hits you in the head with a satisfying ‘klunk’. Slightly dazed, you look at the fallen object.
It isn’t a coconut, you note with sadness. It is something completely foreign and strangely artificial. It is a small, metal sphere, covered in an intricate design. Perplexed, you are unsure what to do with it.". After examining the palm tree, change the description of the palm tree to “Your shakes were in vain; it seems nothing will loosen those coconuts.”
Understand “palm” or “tree” as palm tree.
The metal ball is a thing. It has the description “A small, metal sphere, covered in an intricate design.”. Understand “ball” as metal ball.
After examining the palm tree, move the metal ball to Sandy Cove.[/code]
That’s a weird error. The “after examining the tree” rule does not in fact fire when you examine the tree, while “after player examining the tree” does. Looks like a bug to me.
I think the problem is that you have two “after examining the palm tree” rules. By default an after rule stops the action so you have to either combine the rules or add “continue the action” to the end of them:
After examining the palm tree for the first time:
now the description of the palm tree is "Your shakes were in vain; it seems nothing will loosen those coconuts.";
now the metal ball is in Sandy Cove.
I added “for the first time” so that if you have picked up the ball examining the tree for the second time won’t move it out of your inventory. It’s also better to use “now” instead of “change”, which is deprecated.
…oh. Now I feel stupid; I must have missed the first “after” I don’t know how many times. I’m going to hold off posting any further stuff until this cold clears up, since it seems it’s affecting my thought processes.
Here’s a very simplistic example that can do that:
The living room is a room.
The very small table is a supporter. It is in the living room.
The rock is in the living room.
A pebble is in the living room.
Check putting something on the very small table:
If the noun is not the pebble:
say "The very small table is too small for [the noun]." instead.
It could be generalized out if there was a class of items that can fit on the table, but if there’s only one thing, doing something like this is probably sufficient.
You’d have to write your own rules to create the restriction:
Check putting something that is not an ornament on the Christmas tree:
say "There's no way to hang that on the tree.";
stop the action.
A note about your first problem: I would probably do the description the other way around - the actual description would be “Your shakes were in vain…” but then I’d write an “Instead of examining the tree for the first time” rule that takes care of all the special things happening, including printing all the one-off text.