Question: Deleteting items

How do I delete a thing and replace it with another thing in the inventory?

(I understand “deleting” something as it actually being nowhere)

First you’d decide what circumstances such a thing would happen, and define the opening. For example, when a scene starts, or when an action is taken. Write the beginning of the rule as usual.

Then once you’ve designed when it happens, you’d write the actual code. Start each sentence with “now”, which is a declaration of the current state and can change all kinds of things, and follow up with what you want the new state to be.

now the player carries the X;
now the X is nowhere;

Instead of tying the rope to the rope for the first time: now the player has the noose: now the rope is nowhere; say "You tie the rope into a noose."

Why doesn’t the above work? (I’ve probably messed up my grammar…)

You have a colon after first use of the word “noose”. Also, it appears you’re not using the proper indents.

So how should it be written?

Use the standard formatting. Do you know when to use colons and when to use semi-colons?

Spoiler - the three lines encapsulated by Instead should be indented and end with a semi-colon


Instead of tying the rope to the rope for the first time:
	now the player has the noose;
	now the rope is nowhere;
	say "You tie the rope into a noose.";
Problem. In the sentence 'now the rope is nowhere'  , I was expecting to read a condition, but instead found some text that I couldn't understand - 'the rope is nowhere'.

Why is this a “problem”?

If you have defined rope as a kind,

A rope is a kind of thing.

Inform 7 will get confused if you mean the kind “rope” or an object called “rope”. One solution is to use a more specific name for the object. Suppose the object is called “hanging rope” then you could write:

	now the hanging rope is nowhere;

heartless zombie is most likely right.

I couldn’t get that line to screw up, no matter how much I tried:

A rope is a thing. Now the rope is nowhere. If now the rope is nowhere.

Oh damn! The line “a rope is a kind of thing” was lost and I couldn’t see it! Thanks. Now this is fixed.