<object name="WindowLook">
<topics>*LOOKAT</topics>
<text>You look out onto a sunny day.</text>
</object>
<object name="WindowLookMorning">
<topics>*LOOKAT</topics>
<needs>morning</needs>
<text>The ground outside is wet with the morning dew..</text>
</object>
<object name="WindowLookAfternoon">
<topics>*LOOKAT</topics>
<needs>afternoon</needs>
<text>You look out onto a sunny day.</text>
</object>
<object name="WindowLookNight">
<topics>*LOOKAT</topics>
<needs>night</needs>
<text>The sky is black and filled with stars.</text>
</object>
<object name="TimePassage">
<topics>IDLE</topics>
<sets50>afternoon !morning</sets50>
<sets100>night !afternoon</sets100>
</object>
<object name="WindowLookAfternoon">
<topics>*LOOKAT</topics>
<needs>afternoon</needs>
<usechildren>random</usechildren>
<object name="WindowLookAfternoon_Normal">
<text>You look out onto a sunny day.</text>
</object>
<object name="WindowLookAfternoon_ManComing">
<text>You see a man coming up the walkway.</text>
<sets>mancoming</sets>
</object>
</object>
As far as talking to the Janitor, I can see how this simple game has design flaws. The mirror and bat were actually added in just so I could show how verbs and commands hook in. They're absolutely irrelevant to the completion of the game, which involves the machine in the room and its missing key. Try asking about those. I'll add in some response to mirror and bat in the next rev of the sample.
The "show topics" command is a debugging command that would not normally be part of a game (more "test app"-itis). It shows the topics sent to the engine for the commmands typed. It provides an easy way to determine what topic keywords a specific command will input, which should make creating responses easier. It could be called anything. (I just happened to pick that.)
<object name="RoomLook">
<topics>LOOK</topics>
<usechildren>first</usechildren>
<object name="RoomLook_MachineOn">
<needs>machine_on</needs>
<text>The room is a bit less depressing now.</text>
</object>
<object name="RoomLook_MachineOff">
<text>The room is quiet and depressing.</text>
</object>
</object>
<needs>!mirror_smashed</needs>
In the Integrator's guide, you say it is a good idea to inherit from response library types, but you do not do that in the demo (because the demo is not integrated?), or in the examples later in that doc.
This seems to assume that a certain order is preserved, that RoomLook_MachineOn is always before RoomLook_MachineOff (as only the former has the condition). Is that a safe assumption?
For topics, I see LOOk and LOOKAT used as examples. Are these topics hardcoded into Quest/ResponseLib? If so, is there a full list of topics somewhere? Or does response lib actually send this value to the Quest parser?
Is "isgroup" ever false? Would it save typing if group is the default (so the flag is "issingle")?
Quest uses "not", might be better as <needs>not mirror_smashed</needs>
Any GUI support? Looks like the answer is no; would be good, even for coders, as it saves typing the XML tags.
Thinking about this further, I would be inclined to use "!" rather than "not". It feels better when you have <sets> as well. And saves typing.
"Selection phase: Only the responses with the top score are selected. There may be more than one response selected if they have equal scores." I cannot imagine when I would want more than one response.
<object name="GenderLeadin">
<topics>GENDER_QUERY</topics>
<text>The elf leans in closer. "Be ye male or be ye female?"</text>
</object>
<object name="GenderMale">
<topics>GENDER_QUERY</topics>
<prompt>I'm a red-blooded male</prompt>
<sets>male</sets>
<calls>GENDER_SET</calls>
</object>
<object name="GenderFemale">
<topics>GENDER_QUERY</topics>
<prompt>I'm all woman</prompt>
<sets>female</sets>
<calls>GENDER_SET</calls>
</object>
<calls>GENDER_QUERY</calls>
Can you have multiple words flagged with *, and only one is required?
<object name="GenderQuery">
<topics>*GENDER_QUERY</topics>
<isgroup/>
<object name="GenderLeadin">
<text>The elf leans in closer. "Be ye male or be ye female?"</text>
</object>
<object name="GenderMale">
<prompt>I'm a red-blooded male</prompt>
<text>"I'm a man, thank you."</text>
<sets>male</sets>
<calls>GENDER_SET</calls>
</object>
<object name="GenderFemale">
<prompt>I'm all woman</prompt>
<text>"I'm a woman, you twit."</text>
<sets>female</sets>
<calls>GENDER_SET</calls>
</object>
</object>
<needs>!female</needs>
<needs>!male</needs>
The elf leans in closer. "Be ye male or be ye female?"
"I'm a man, thank you."
I have encountered some uses for that. One is in the case of the room description. The sample game shows this (the machine adds its own description into the room description).
The other case is when using prompts as multiple choice options (like a menu):
<object name="BatLook">
<topics>LOOKAT</topics>
<text>Louisville never made a slugger like this.</text>
</object>
<object name="bat responses">
<object name="BatLook">
<topics>LOOKAT</topics>
<text>Louisville never made a slugger like this.</text>
</object>
...
</object>
Silver wrote:I'm interested in this for what I think it might do.
For instance, if I look at the monkey in the cage it might be eating an apple. If I look again ten seconds later it will still be eating the apple. But if I leave the room and come back it might be swinging off the rope or have gone to bed. Is this the sort of thing the code deals with?
Silver wrote:Also, does this then replace quest's code completely? If so is there an interface or are coding skills needed in order to use this?
foreach (obj, value)
foreach (obj, o)
<object name="TheOther">
<inherit name="editor_object" />
<inherit name="ResponseLib_Caller" />
<alias>the strange figure</alias>
<capalias>The strange figure</capalias>
<longtermtopics type="dictionary" />
<reflectcount type="int">0</reflectcount>
<responses type="object">TheOtherResponses</responses>
<calls type="object">TheOtherCalls</calls>
<changedalias type="script">
this.capalias = CapFirst(this.alias)
</changedalias>
</object>
jaynabonne wrote:And if it's not clear, the whole calling/suggesting thing is more advanced.