One thing that I am still pretty confused about, with Inform 7, is when you can and cannot declare multiple things in one sentence. I assume these are not the same situation, but I am not sure the difference:
[This works - assigning multiple properties to an object ]
The ImpossibleDoor is a closed, locked door.
[ But none of these do, trying to assign multiple properties(?) to a thing or kind ]
[
A thing can be flippable, raisable and lowerable.
A doorstop is a flippable, raisable, lowerable thing.
A doorstop is a kind of thing which is flippable, raisable and lowerable.
A doorstop is a kind of thing which can be raised or lowered.
A doorstop is a kind of thing that can be raised or lowered.
A doorstop can be raised or lowered and is usually raised.
]
[ It seems you have to have to split each item out. Surely there is a more elegant way? ]
A thing can be flippable. A thing can be raisable. A thing can be lowerable.
A doorstop is a kind of thing. A doorstop is flippable. A doorstop is raisable. A doorstop is lowerable. A doorstop can be raised or lowered. It is usually raised.
Q 2 - now that I have a kind that is âraisableâ What is the difference now between âtouchableâ, âenterableâ, etc⌠and raisable where the former would be accepted in the condition(?) below but not the latter?
[ WHY not 'one raisable thing' ? ]
[Raising is an action applying to one raisable thing.] [ <--- doesn't work ]
Raising is an action applying to one touchable thing.
Understand "raise [something]" as raising.
Understand "lift [something]" as raising.
[ oh sure, raisable works here... ]
Check raising:
If the noun is not raisable, say "You can't raise [the noun]." instead;
If the noun is raised, say "[The noun] is already raised." instead;
Yeah. âtouchableâ and âenterableâ are pre-defined I7 properties that have rulebooks already written for them.
When youâre wanting something to be âflippableâ thereâs already a âdeviceâ kind in Inform that is meant to work like a switch and take the properties âswitched onâ and âswitched offâ. You might want to look at that as an example, or possibly make your doorstop a device so the player can inherently FLIP DOORSTOP.
On your question 2, the issue is that Inform only accepts a very small set of properties when defining new actions: visible, touchable, and carried (link to WwI). So you canât actually define an action as applying to an openable or touchable thing at that level (there is probably a good reason for this, but I donât know it).
You can limit the actionâs applicability by properties when defining the grammar: Understand âblarg [something openable]â as blarging, or what have you. But in real life, itâs probably better to do that with a check rule with a custom rejection message, so the player doesnât try to blarg something unopenable, get a default parser error, and conclude that blarging wonât be needed in this game.
See, those kind of IDK⌠ambiguities⌠are what is killing me about getting my mind around Inform7.
I can say âone touchable thingâ or âone enterable thingâ but after I specifically declare that a thing can be raiseable, I canât say âone raiseable thingâ. But later I can say âIf the noun is not raiseableâ.
I totally get how Inform7 is being parsed into Inform6 code. Frankly I canât imagine how that is even possible to pull off as a coding project, and I have written simple interpreters and compilers myself. But, I do understand that just because it makes similar âenglish senseâ, that doesnât mean it parses into Inform 6. But that kind of subtlety keeps tripping me up.
No, only âtouchableâ, âvisibleâ, and âcarriedâ work here. This is a special case in the syntax. These arenât properties or rulebooks. These are specific keywords that only apply to defining actions. (I7 doesnât normally have much of a concept of keywords, but in this case, thatâs the best way to think about it.)
Q1 - Canât say âthing can be this, that and the otherâ just a grammatical thing that doesnât work. Accept it. Have to say: Thing can be this. Thing can be that.
Q2 - âOne openable thingâ, âOne visible thingâ, only works for adjectives that are pre-defined keywords. My own âraiseableâ isnât in that company. But later it can be referred to as a property of a noun.
If you declare âa thing can be hated and lovedâ itâs trying to make one property called âhated and lovedâ not a âhatedâ property and a âlovedâ property. Thatâs just the syntax.
Youâre not wrong â this is confusing. In most places, you can use your property like youâd like. But action definitions are a special case. And then grammar tokens in Understand statements are a different special case. And you can go ahead and use your properties again in your actionsâ rule preambles, but then you have to be sure to say ânounâ and not try to say âthingâ in the body of the rule.
If it helps, these are brief notes I wrote for myself to help get my head round how this works:
An action needs two things to anchor it in the game world:
(i) a very basic description of how the action works in the game world â (e.g.) (Photographing) is an action applying to nothing/(one/two) (visible/touchable/carried/â) (thing(s)/value(s)) [and oneâŚ] [and requiring light].
NB confusingly, 'visible' here means 'anything the actor is allowed to refer to' (more formally, 'in scope for the actor') not the more usual 'visible to the actor'. So it includes for example the compass directions and even objects out-of-play if the scope rules judge them to be 'in scope' By default most objects not visible in the usual sense will be excluded from consideration by the scoping rules followed by grammar lines (see below), so there is usually a close but not complete alignment between 'in scope' and 'conventionally visible'. Without specifying 'visible/carried', 'touchable' is the default. 'carried' is a more restrictive form of 'touchable' and includes only things directly carried by the actor.
(ii) grammar line(s) to recognise the action in what is typed by the player and declare a (usually) more restricted scope for the objects and/or values the action can refer to. â (e.g) Understand âphotograph [someone]â as photographing.
built-in tokens:
[somebody] / [someone] â synonyms == a person in scope for the actor => the [second] noun (rather than âthe person understoodâ)
[something] / [thing] â synonyms == a thing in scope for the actor- thing here means Informâs usual more restricted sense, not object, so excludes rooms, directions and regions
[things] â a list of one or more things in scope for the actor
[other things] â a list of one or more things in scope for the actor which are not the other thing mentioned (e.g. a container)
[things inside] â a list of one or more things in or on the other thing mentioned (e.g. a supporter/container)
[something preferably held] â as with [thing], but choose a held object over others with same name, try implied take if present but not held
[things preferably held] â as with [things], but choose a held object over others with same name, try implied take if present but not held
[text] â an unparsed sequence of words => a snippet called âthe topic understoodâ â
[a time period] â a period of time â â => a time called âthe time understoodâ
[description of objects/values] â matching any description of objects ([open door]) within sight of the actor, or of values [even number]
â [description of directions] references directions. NB directions are âvisibleâ but not âtouchableâ (see above)
â prefixing âanyâ e.g. [any open door] removes the restriction that an object must be in scope for the actor (or, to think about it another way, brings all matching objects temporarily into scope for this action)
â [any thing] will allow any thing, in or out of the game world == [anything]; similarly [anybody], [anyone]
â [any (description of rooms)] allows reference to rooms, not otherwise mentionable in typed commands
â [anywhere] == [any room]
â the Index indicates which built-in values have a corresponding Understand token
=> for values, a value called âthe (kind) understoodâ
=> for objects, the [second] noun
â this is something of an exception, for historical reasons, to the general ability to refer to a successfully-parsed grammar token as âthe (kind) understoodâ, which here would otherwise be âthe snippet understoodâ. Using âthe nounâ and âthe second nounâ to refer to the first and second object parsed are also exceptions. But we say for example âthe number understoodâ or âthe time understoodâ or âthe colour understoodâ for values. There is also âthe person askedâ for constructions such as âBob, open the boxâ.
NB it is also possible to extract values from the playerâs command or other snippets through âif (snippet) includes â[kind of value]ââ following which âthe (kind) understoodâ contains the matched value. e.g. âif the playerâs command includes â[number]ââ => (if matched) âthe number understoodâ
â â this special token is provided because [a time], which follows the general [description of values] pattern, matches only specific times of day but does not match â21 minutesâ for example, even though this is also of kind time. However, the parsed value is still referred to as âthe time understoodâ rather than âthe time periodâ understood.