In vs. On

I’m trying to get a more descriptive narrative before someone puts a Crystal in a tube. As shown in the code below. For some reason (unknown to me), the code with the “on” compiles and runs… the code with “in” doesn’t even compile. It errors out. Since the tube is a container, I really want to the “in” code, not the “on” code…

Any ideas?
Greg

Before putting the Crystal on the Flourescent Tube: 
	say "You carefully place the crystal into the holder at the darkened end of the tube [paragraph break]The tube appears to be transforming!";
	
Before putting the Crystal in the Flourescent Tube: 
	say "You carefully place the crystal into the holder at the darkened end of the tube [paragraph break]The tube appears to be transforming!";

Looks like one/both of two things:

  • You haven’t established the Flourescent Tube as a container. You can do this with The Flourescent Tube is a container. Right now, I think it’s interpreting it as a supporter since you can put things on it.
  • The verb for adding things to a supporter is putting it on. The verb for adding things to a container is inserting it into. So your code should say Before inserting the Crystal into the Flourescent Tube:.

Also, Before may not be the ideal rule in this situation. If you run the action, you’ll end up with:

You carefully place the crystal into the holder at the darkened end of the tube

The tube appears to be transforming!

You put the Crystal into the Flourescent Tube.

4 Likes

Thanks! That did the trick… I implemented it as:

Instead of inserting the Crystal into the Fluorescent Tube: 
	say "You carefully place the crystal into the holder at the darkened end of the tube [paragraph break]The tube appears to be transforming!";
	now the Crystal is in the Fluorescent Tube;

Greg

1 Like

Glad it’s working! You might consider using an After rule for this rather than an Instead rule, though - as you’ve noticed, the Instead route requires you to manually reimplement stuff that the action process system otherwise would be doing for you (like moving the object into the tube), and can create problems later if for example you want to check whether the player has ever inserted anything into the tube (since an Instead rule terminates the action in failure).

5 Likes
After inserting the Crystal into the Fluorescent tube:
     say "You carefully place the crystal into the holder..."

That’s all you need if you just want a detailed result message. Putting this into an After rule lets the parser’s normal Check and Carry-Out rules also run for inserting things into containers so you don’t have to do it.

After rules will only run when the action is successful and completed so you don’t need to futz with it much. It will by default stop the action so any other Report rules with messages will not run. You won’t get a stock “You put the Crystal into the Flourescent Tube” Report message unless your After rule specifies to continue the action.

You can also use After rules to trigger other events besides the specific message:

After dropping the fragile Ming Vase:
     say "It shatters on the floor with a delicate crash. Surely those monsters heard that.";
     now the fragile Ming Vase is off-stage;
     now the Clickers are alerted.
3 Likes

Thanks!