How to "use [blank] on [blank]"

Hi everyone, I’m working through my first game using I7. Basically just creating a world where I can test the possibilities. Unfortunately, so far the possibilities are testing me. :confused:

But here’s my problem (which occurs in the last section, the rest is background info for the kind soul who attempts to help me):
(Quick side note: I know that I’ve spelled “dessert” not “desert”. It’s eventually going to turn into a poor attempt at humor.)

[code][Player’s beginning items and descriptions.]
The carrying capacity of the player is 2. Yourself is wearing a red silken cape. Yourself is carrying a walking stick. Description of the walking stick is “A gnarly old stick about four feet long. You picked it up somewhere before climbing that plateau.” Description of the red silken cape is “This is your adventuring cape. It seemed appropriate to wear today since you set off into the unknown dessert and all.”

Plateau is a room in The Dessert. The description of Plateau is “[if unvisited]You seem to be standing on a plateau overlooking the dessert. You remember heading out into the wild looking for adventure. Hopefully that doesn’t end up being a terrible idea.[end if] The way down is to the North and a dangerous drop surrounds you on all other sides.”

[Bush activity]
In Plateau is a burning bush. The burning bush is lit. Description of burning bush is “A small shrubbery sitting at the edge of the plateau is burning with a chipper little flicker. Nevermind, it’s pretty raging, fire-wise. Fortunately, it doesn’t seem to be spreading.” Instead of taking the burning bush, say “That would hurt for a whole host of reasons. Better just leave it there.”. Instead of attacking the burning bush: say “you swing a well-aimed kick at the bush. Your animosity towards the bush seems to have gotten the better of you when your shoe catches fire, leading to your silk cape, then hair going up in flame also. Since you’re in the dessert, you’re out of luck. Rest in peace knowing tat this is probably the most creative way to die.” ; end the game in death. Instead of using the walking stick on the burning bush: say “Your walking stick isn’t very good for walking now but it certainly gives off a nice glow now.” ; now the walking stick is lit.[/code]

All I’m trying to do is essentially turn the trusty walking stick into a torch if the player is creative enough to figure it out. Clearly inform doesn’t recognize “using [something] on [something else]” as an action. Neither does it recognize “lighting [something] on [something else]” Is there a command for accomplishing this or will I have to create a new rule? If so, what’s the best way for me to do so in this situation? I haven’t run into creating my own rules yet.

Thanks!

You might try the inserting it into action. (“Instead of inserting the walking stick into the burning bush:”)
If I recall correctly, you may need to make the burning bush a container for that to work out of the box, although workarounds are possible.

Burning is also an action. It does nothing by default, but you can change that. Or, if you want to stick with the two noun thing, you could just remap burn to inserting something into the burning bush. (ie “Check burning: if the burning bush is in the location, try inserting the noun into the burning bush instead.”) (Untested!)

To be kind to players, you’d want to allow as many synonymous phrases as possible, of course.

Okay so I’m continuing to attempt to solve this problem. I’m now trying to use the bush as a container that the stick may be inserted into at which time the walking stick will then be lit.

My code reads:

In Plateau is a burning bush. The burning bush is lit. The burning bush is an open container. Description of burning bush is "A small shrubbery sitting at the edge of the plateau is burning with a chipper little flicker. Nevermind, it's pretty raging, fire-wise. Thankfully it doesn't seem to be spreading." Instead of taking the burning bush, say "That would hurt for a whole host of reasons. Better just leave it there.". Instead of attacking the burning bush: say "you swing a well-aimed kick at the bush. Your animosity towards the bush seems to have gotten the better of you when your shoe catches fire, leading to your silk cape, then hair going up in flame also. Since you're in the dessert, you're out of luck. Rest in peace knowing tat this is probably the most creative way to die." ; end the game in death. Instead of inserting "[noun]" into the burning bush: If the noun is the walking stick, say "Your walking stick isn't very good for walking now but it certainly gives off a nice glow now." ; now the walking stick is lit.

My error message is:
Problem. You wrote ‘Instead of inserting “[noun]” into the burning bush’ , which seems to introduce a rule taking effect only if the action is ‘inserting “[noun]” into the burning bush’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.

Unless you’re going to print the noun name, you don’t need to use the “[noun]” construction; you can always just refer to the noun plain, as in “try dropping the noun” or “now the noun is lit”.

If you’re writing rules for an action, you can use “something” as a placeholder. Due to the rules of what the noun is, you’ll always be inserting the noun into the second noun. “Instead of inserting the noun into the burning bush” compiles, but it’s not the way I usually see it done, which makes me a little anxious. I usually see “instead of inserting something into the burning bush”.

Accordingly, this should work.

Instead of inserting something into the burning bush: If the noun is the walking stick, say "Your walking stick isn't very good for walking now but it certainly gives off a nice glow now." ; now the walking stick is lit.

Thanks so much for all your help! It’s working so far. My only last concern is that the end description of the room reads “You can see a burning bush (empty) here.”. Since I’m only specifying that the bush is a container as a nuance of the game, is there any way to get around it saying that the bush is empty?

Oh, right. Sorry! This is one of those tiny little weird things I have to look up every time:

Rule for printing room description details of the burning bush: stop.

Also! Don’t forget to add something in case the player (inevitably) tries putting other things in the burning bush. For example:

Instead of inserting something into the burning bush: If the noun is the walking stick: say "Your walking stick isn't very good for walking now but it certainly gives off a nice glow now." ; now the walking stick is lit; otherwise: say "You almost thrust [the noun] into the inferno, and then think better of it."

Thanks so much for all your help! I’m struggling a little with the “otherwise” clause but it’s a matter of punctuation that I’ll probably be able to puzzle through alone.

No problem! Good luck. (Let me know if the grammar issue persists - sometimes it’s easier to spot from the outside.)

Alright, my grammar issues are persisting relentlessly. I’ve got it working except for that part about not putting other things into the bush.

I have:

Instead of inserting something into the burning bush: If the noun is the walking stick: say "Your walking stick isn't very good for walking now but it certainly gives off a nice glow." ; now the walking stick is lit. Otherwise: say "You decide that putting that into the bush probaby isn't a good idea.".
I’ve checked my indentations and played around with : vs , format but nothing seems to work.

Additionally, I have another problem hinging onto this. I’ve set up a cave and intend for the player to have to light the walking stick before entering. Inform doesn’t see an issue with my code but it still lets me enter the second room of the cave without the lit stick.

[code]A Cave is a region in The Dessert.

Cave Entrance is a room in A Cave. Cave Entrance is west of Oasis.The description of Cave Entrance is “[If unvisited]You expect a break from the dessert heat when you walk into the shade of the cave. What you didn’t expect was the cool draft that comes from somewhere deeper underground.[End if] You can still faintly see the oasis in the distance to the East. The cave continues to the West.”

Check entering Grand Foyér:
If the walking stick is not lit:
Instead of entering Grand Foyér:
say “It’s too dark that way. Better turn back.” ;
move player to Cave Entrance.[/code]

Replace the period on the line preceding the otherwise with a semi-colon.

The problem here:

Check entering Grand Foyér: If the walking stick is not lit: Instead of entering Grand Foyér: say "It's too dark that way. Better turn back." ; move player to Cave Entrance.

is that you’re mixing two rulebooks - check entering and instead of entering. You can only do one at a time, so Inform is confused. You’re absolutely on the right track, though.

You can put your block either place, but I’d leave in the check rules. If you want to halt the action, you can always finish the last line with “instead”. And I changed “entering” to “going to”. This is a little confusing, but basically the entering action is for getting onto or into things that aren’t rooms. (From the action description: “Whereas the going action allows people to move from one location to another in the model world, the entering action is for movement inside a location: for instance, climbing into a cage or sitting on a couch.”)

Check going to Grand Foyér: if the walking stick is not lit: say "It's too dark that way. Better turn back." instead;

There are internal things in Inform about dark rooms and light and stuff, but I’ve never worked with them. (This should work, but if you’re doing lots of dark rooms, it might be worthwhile taking a look.)

Thanks! It all works perfectly now! I really appreciate the time you spent helping me figure it all out :smiley: