Spatial arrangements in Inform 7

How can I arrange objects spatially within a room(e.g. the window is to the east, the bed is to the west, etc) And how can I have an object’s description change based on interactions with other objects(e.g. the sword is dull and rusty until you talk to the Armorer, who cleans it)?

Is it even possible within the language?

Also, how do I upload my avatar?

A forum avatar? That’s disabled here. Sorry.

Very much so, but I can’t go into details at the moment as I’m off to work. :wink:

Can you when you get back from work?

The best example I could find so far was number 316 in the list of examples.

The main question I have here is what the player is going to do in this set up. In some one-room games the description of the room changes based on where the protagonist is in the room, and where the protagonist is depends on what they last examined, touched, etcetera. So what you’re doing is recording where the objects are located, and assigning the player to that location as well so that the game prints the room description from that viewpoint.

If you actually want the player to type ‘go to bed’, ‘go to window’, etcetera, personally i would question the value of that approach. I think it’s more important to focus on what the player actually is doing in the location.

In many ways these are the same thing, but the important thing is you don’t have to arrange objects spatially, like with coordinates. Just record locations and what is in relation to what. Unless you’re going for some deeper simulation?

See section 5.1 (text with substitutions), and the chapter on Kinds (especially sections 4.6 and up). Also check out tables, in chapter 15, particularly 15.16 and 15.17, and chapter 8 on change, as well as chapter 12 on Advanced Actions.

In this case you want to use I7’s properties (these would be dull, rusty, etc.), When the Armorer cleans the sword, you change the property of the sword so the game prints the correct description. You can embed if statements in an object’s description, or create a description by selecting entries in a table.

Here is a very simple example:


"Rusty Sword"

The Armory is a room. A man called The Armorer is here.

A blade is a kind of thing. A blade can be rusty. A blade can be dull. A blade usually is rusty and dull. 

A blade called a sword is here. The description of the sword is "An iron sword [if the sword is rusty]covered in rust[end if][if the sword is dull], with an edge good only for buttering your bread[end if]."

Sharpening the sword is an action applying to one visible thing. Understand "sharpen [something]" as sharpening the sword. 

Check sharpening the sword: if the noun is not a blade, say "You can't sharpen that." instead. 

Carry out sharpening the sword: now the noun is not dull.

Report sharpening the sword: say "After hours and hours of work, you sharpen the sword.".

A tulip is here. 

test me with "x sword / sharpen sword / x sword / sharpen tulip".

Thank you for your assistance.

Actually, I just wanted to have a window on one wall that the player could look through or at. Both choices would be useful for solving some of the puzzles that I have in mind. So if the player wants to “examine window”, the window itself would be described, while if the player wants to “look east”, they would see through it. I realize now that it wouldn’t work, though. What could I use to make the player able to look in a given direction?

Take a look at example 20 for the window, I think it covers what you need (and explains it better than I could! :slight_smile: )

Thank you for your help. Do you know how to keep it from saying “You can see [thing] here.” at the end of a room description?

The basic way to do that is to write for example, “The forge is a thing. It is scenery.”.

But I want to be able to take it.

I’m not sure if this is what you want, but you can get at this with:

Rule for listing nondescript items: do nothing.

Do a search on ‘nondescript’ in the documentation and you’ll see other examples and an explanation of this.

Thank you very much. I can’t figure out how to make it display a message other than “Taken” after taking the item, though.

Do a good deed. Help a newb.

I’m new to I7 myself but I think you can do what you want with a report rule for the specific object:

[code]The Place is a room.

The whatsit is a thing in the Place.

Report someone taking the whatsit: ignore the standard report taking rule; say “You gobble up the whatsit, greedily.”

Test me with “take whatsit”.[/code]

Which works.

Or even more simply:

Report someone taking the whatsit: say "You gobble up the whatsit, greedily." instead.

Hope this is what you are looking for.

Gav