define synonyms
the =
end defineYou don't have to keep retyping object names - Quest's pronoun support means you can type "LOOK AT BOOK" and then "TAKE IT", so there's no need to type the name of the object twice.
Quest does support 'it', though (I think) only if the author specifies it during the object creation. Some of the recent games I've played have allowed me to refer to the previous object as 'it', whereas others have required me to type their name in full.
I don't know why you used so many options for the disambiguation. It shouldn't matter if it's under or ontop of another object... Surely, if it's available for interaction then it'd be ambiguated - otherwise the player can't interact with it anyway.
Also object types shouldn't really matter.
In your instance, if you said "give old to old" and had; old man, old book and old key, then how would you use the type ambiguation..
The same for wearer, equipper and inside object.
OK. So you go into a room, and go "look under rug", and get "there's a key under the rug!" (the room description would probably change after this). Typing "get key" or "pick up key" would lead to "I see no key" and so you'd type "get key from under rug"?'get object' would direct the function to only look for objects that are generally available in the current room. 'get object from under object2' would direct the function to only look for objects that are underneath object2.
I saw that.. I just didn't see much point in having - or coding - those extra 'optional' parts.Only the first two parameters of the GetObject function are necessary
I don't mean to ridicule - but just ask why you went through creating 6 or 7 extra functions which aren't needed for ambiguity - and also when you could have had 4, with less internal coding.
NPC's wouldn't use type disambiguation..
George is looking for food object types, because he's hungry. The type parameter would definitely be useful, no? Note that disambiguation is not used in this example.
It shouldn't matter if it's under or ontop of another object... Surely, if it's available for interaction then it'd be ambiguated - otherwise the player can't interact with it anyway.
Yeah, I mean technically there's one functionone function
I'm just saying; you wouldn't know an object is under it unless you looked underneath.
And *I* don't want to write out the full "get #obj# from under #obj#".
I'd personally just type "get #obj#".
It's, IMO, the more natural thought you have in your brain.
"there's something under the bed - let's pick it up".
I kind of made the half-way guess that getobject returned a string-list (or array name - which I'd personally prefer.. I think you can use #(arrayname.in.string)[index]#).
The Flower Garden was originally written as a quick way to compare how the various IF systems handle ambiguity by default.
Since it looks like writing the Quest version may need a moderate amount of special coding, I'd appreciate seeing a most direct implementation (least amount of "special handling") and a most polished implementation.
define game <Flowers>
asl-version <350>
start <porch>
command <smell #@thing#> if action <#thing#; smell> then doaction <#thing#; smell> else msg <It doesn't smell of anything.>
command <drop all> for each object in <inventory> {
move <#quest.thing#; #quest.currentroom#>
msg <#@quest.thing#: dropped.>
}
end define
define room <porch>
prefix <the>
look <A plain porch. The garden is north of here, and the house is to the south.>
north <garden>
south msg <But you want to stay out and sniff the flowers!>
end define
define room <garden>
look <A mostly empty garden; the house is back to the south.>
prefix <the>
south <porch>
define object <rose>
prefix <a>
take
properties <hasbee>
alt <flower; white>
look if property <rose; hasbee> then msg <A bee crawls across the rose.> else msg <It's a beautiful white rose.>
action <smell> {
if property <rose; hasbee> then {
property <rose; not hasbee>
msg <Ouch! As you sniff the rose, you disturb a bee that was crawling on it. Angered, it stings you then flies away.>
}
else msg <You're wary of sniffing it again, after what happened last time.>
}
end define
define object <daffodil>
prefix <a>
take
alt <flower; yellow>
look <A typical looking yellow daffodil.>
action <smell> msg <It has the usual daffodil scent.>
end define
define object <tulip>
prefix <a>
take
alt <flower; red>
look <An ordinary red tulip.>
action <smell> msg <It smells like a tulip.>
end define
end define