Issues with variables (if,)

Here’s my code. I have a way of indenting things to keep my stuff neat, but I’m going to guess it’s interfering with the way the compiler works.
I’d really appreciate it if someone could clean this up/finish this off for me so I can learn for next time.

[code][///THE PLAYER]

[//ITEMS]

	[/COAT]
	The player is wearing your coat.
	The description of your coat is "It's dirty and ripped after the escape, but you can still wear it."
	Your coat is an open container.
	Instead of burning your coat:
		say "You throw your coat on the ground and set it alight. It quickly goes up into flames, and turns to ash.";
		remove your coat from play;
		move the ashes to the location of the player.

	
		[/LIGHTER]
		In your coat is your lighter.
		The description of your lighter is "Your trusty Zippo. It still works."
		Your lighter can be used to burn things.
	
		
		
	[/BROKEN WATCH]
	The player is wearing your broken watch.
	The description of your broken watch is "It's smashed, but still wearable. The screen remains barely in one piece and wires splay from where a button on the side used to be."
	Instead of burning your broken watch:
	if the player is wearing the watch
	say "It's still attached to your wrist!"
	otherwise:
	say "It doesn't look like it will burn".[/code]

You can use the headings Volume, Book, Part, Chapter, and Section to organize your code. Then when you click on Contents, it’ll automatically arrange it in outline form.

This should compile.

[code]Part - The Player

Chapter - Items

Section - Coat

The player is wearing your coat.
The description of your coat is “It’s dirty and ripped after the escape, but you can still wear it.”
Your coat is an open container.

Instead of burning your coat:
say “You throw your coat on the ground and set it alight. It quickly goes up into flames, and turns to ash.”;
remove your coat from play;
move the ashes to the location of the player.

Section - Lighter

In your coat is your lighter.
The description of your lighter is “Your trusty Zippo. It still works.”
[Your lighter can be used to burn things.] [I’m not sure what this line is trying to do]

Section - Ashes

[Added in ashes so the burning coat rule would compile]

There are some ashes.

Section - Broken Watch

The player is wearing your broken watch.
The description of your broken watch is “It’s smashed, but still wearable. The screen remains barely in one piece and wires splay from where a button on the side used to be.”

Instead of burning your broken watch:
if the player is wearing the watch: [added a colon here]
say “It’s still attached to your wrist!”; [added semicolon]
otherwise:
say “It doesn’t look like it will burn”.[/code]

“Your lighter can be used to burn things.” isn’t valid Inform code. What are you trying to do here?

The code for burning the broken watch is also not indented properly. It should be like this:

Instead of burning your broken watch:
	if the player is wearing the watch
		say "It's still attached to your wrist!"
	otherwise:
		say "It doesn't look like it will burn".

Indentation is very important in Inform, sort of like in Python. You can also use the older begin-end syntax but that’s less readable and isn’t used much anymore.

Other than that it all looks fine to me.

EDIT: Also echoing what bg said about headings. They’re the best way to organize Inform code into sections.

Thanks very much for the help chaps! I know all this seems simple but I’m sure you know what it’s like when you are starting out. I’ve found a separate handbook to use with the Documentation which should help me out. This is actually for a uni assignment, and I’m on a deadline, so it’s quicker to fire something on the forums then spend hours reading.

Cheers again.

I think when you say “the lighter can be used to burn things” you probably mean something like “The player can’t burn anything unless they’ve got the lighter.” You can do that like this:

Check burning when the player does not hold the lighter: say "You don't have a lighter to burn things with." instead.

This will run before the rules that actually govern burning, and if it runs the word “instead” in the clause will stop the action so the “Instead of burning” rules don’t run. (The word “instead” in a rule like this isn’t the same thing as a rule that starts “Instead of burning…”, which is tricky.)

If the player types “burn coat with lighter” they’ll get the message “I only understood you as far as wanting to burn the coat” which hopefully will clue them in that they just need to type “burn coat.” If you have enough time you can try coding up an action that captures “burn X with Y” but that depends on how much time you have before the deadline.