# Compound conditions

I have several places that moving in a nowhere direction gives pretty much the same result:

``````Instead of going nowhere from Thentis Road,
say "[one of]That direction will take you off quest.[or]The road continues into the distance but away from your main objective.[or]If you search the chapel, perhaps we can be done before nightfall.[at random]"

say "[one of]That direction will take you off quest.[or]The road continues into the distance but away from your main objective.[or]If you search the chapel, perhaps we can be done before nightfall.[at random]"``````

I donâ€™t know how to specify multiple conditions. I would prefer something like

``Instead of going nowhere from Mercer Cove Road or Thentis Road...``

but get an error for various attempted combinations.

One easy way to group together rooms when you want to specify rules in common among rooms is with a region.

``````The Road of Trials is a region.

say "[one of]That direction will take you off quest.[or]The road continues into the distance but away from your main objective.[or]If you search the chapel, perhaps we can be done before nightfall.[at random]"
``````

Writing with Inform 3.4: Regions and the index map

1 Like

A perhaps less idiomatic way to do it is to subtype the room, thus:

``````Instead of going nowhere from a Road-Room,
say "[one of]That direction will take you off quest.[or]The road continues into the distance but away from your main objective.[or]If you search the chapel, perhaps we can be done before nightfall.[at random]"

A Road-Room is a kind of room.

``````

(Mentioned only for sake of variety: I actually prefer Zedâ€™s solution.)

1 Like

Thanks to you both. I was thinking of making the groups of roads a region but now, if I do, that will solve this problem too. Works perfectly.

Or, just use an actual condition.

``````Instead of going nowhere when the location is Thentis Road or the location is Mercer Cove Road orâ€¦
``````

Then you can use â€śandâ€ť and â€śorâ€ť and such as much as you like.

Or, as another option, you can use a new definition:

``````Definition: a room is roadlike if it is Thentis Road or it is Mercer Cove Road.
``````

But I think a region is the best solution.

1 Like

I tried the compound condition (location is Thentis Road etc) but I couldnâ€™t get it to work. The region solution worked well. Thanks for letting me know that it IS possible and that it was typical user error on my part.

The trick with that is you have to assert entirely for each object. Itâ€™s a subtle but important difference to Inform:

`Instead of going nowhere the the location is Main Street or State Street:`

should be

`Instead of going nowhere when the location is Main Street or the location is State Street:`

2 Likes

The former is, notably, a syntax that I6 supported but I7 doesnâ€™t. I sometimes wonder why, because â€śvalue is option or option or optionâ€ť isnâ€™t especially ambiguous to parse. The typechecker handles worse ambiguities already.

Itâ€™s not hard to parse, but Informâ€™s â€śisâ€ť verb is extremely open-ended. You could write something like:

``````...when the location is Main Street or sunny or adjacent to Central Park:
``````

Syntactically this can always be rephrased into â€śX is A or X is B or X is Câ€ť but the chance of landing somewhere the author didnâ€™t intend is maybe too high.

I guess thereâ€™s also cases like

``````...when the location is sunny or adjacent to Central Park or Main Street:
``````

This is genuinely ambiguous.

3 Likes