1. Downloading Q package
Please download Q package from here and decompress it. You can find "qpackage-dr-e" directory.
2. Installing Microsoft Agent
Microsoft agent is not installed as standard on Windows95. On the other hand, it is stan-dard on Windows98/2000/Me/XP. So, installation procedures depend on the operating systems users use. Please check the following table to carry out the necessary proce-dures.
| Prefer agents to speak |
Prefer agents not to speak |
|
| Windows 98/2000/Me/XP | 3 |
|
| Other versions of Windows | 1,2,3 |
1,2 |
- Please install Microsoft Agent itself to operate Microsoft Agent.
- Please install Microsoft Agent character Merlin (wizard) to operate the sample sce-nario. If users wish to have other characters, Peedy, Robby and Genie, it is possible to install them.
- If users want the characters to speak, please install the following Text-To-Speech engine (L&H, freeware). Not installing them will not cause any operation trouble.
If the above files cannot be accessed for any reason, it is possible to download the files via "Downloads" on the left side of the Microsoft Agent home page.
3. Describing Scenarios
When describing scenarios in Q language, you have to write
(load "msagent.q")
at the top of the scenario file to load "msagent.q" file, which defines cues and actions MSAgent can employ. And then follow Q language specification to describe scenarios. In addition, the specifications of "defagent", "cues", and "actions" for MSAgent/Q are described in 3.1 and 3.2. After describing scenarios, save them in "/qpackage-dr-e/msagent/scenario" directory.
Example: Scenario description
(load "msagent.q")
(defagent Merlin :scenario explanation :location '(20 40) :shape '("Merlin.acs"))
(defscenario explanation ()
(observation
((?watch_web :url "http://kimono.com/fukuro_obi")
(!speak :sentence "Fukuro-obi is basically used for formal dress.")
(!speak :sentence "Do you want to wear kimonos?")
(!request_selection '("Yes." "No."))
(go asking))
((?watch_web :url "http://kimono.com/nagoya_obi")
(!speak :sentence "Nagoya-obi is used for casual kimono.")))
(asking
((?receive_selection 0) c)))
"Explanation" scenario consists of two states; observation, and asking. In the observation state, which is initial state, Merlin agent waits for users to click "http://kimono.com/fukuro_obi" or "http://kimono.com/nagoya_obi." If it observes that users click the former link, it explains "fukuro obi" and asks whether users want to wear kimono. If it observes that users click the latter link, it explains "Nagoya obi" and terminates this scenario.
3.1 Defining Agents
The specification of "defagent" of MSAgent/Q is as follows.
(defagent name
:scenario scenario_name
:location ' (integerinteger)
:shape '(string))
- "name" indicates agent's name.
- "scenario" indicates scenario that the agent executes at first.
- "location" indicates agent's initial coordinate.
- "shape" indicates agent's character data.
(e.g. "Merlin.acs" , "Peedy.acs", and "Genie.acs")
"location", "shape", and "arguments" are optional.
Example: Description of Agent Definition
(defagent Merlin
:scenario explanation
:location '(20 40)
:shape '("Merlin.acs"))
In Q language, some definitions of agents can be described. However, this application does not meet this specification. Only one definition of an agent can be described. In addition, "defavatar", and "defenv" cannot be used in this application.
3.2 Cues and Actions
Here is a list of cues and actions which are available in MSAgent/Q. Definitions of cues and actions are described in the following format.
(cue/action's_name {arguments}*)
arguments::= :parameter's_name <in | out | inout> data_type
Please refer to Q language specification for definition of "in", "out," and "inout" attributes.
CUE:
- (?receive_selection :selection <in> integer)
It fires if user's input of a list box displayed in !request_selection (described later) is selection.
Example:
(!request_selection :selection-list '("Golden Pavilion" "Silver Pavilion"))
(?receive-selection 1)Agents display 2 options "Golden Pavilion" and "Silver Pavilion" in the list box in !ask-selection. When a user selects "Silver Pavilion" from the options, the above ?receive-selection fires.
- (?receive_text :text <out> string)
It obtains text input from a user, and substitutes the input to text.
Example:
(!request_text :sentence "Please input here.")
(?receive_text :text $text)
Agents display a text box which shows "Please input here." When a user input text, the cue works and then substitutes the input to $text, pattern variable (refer to Q language specification for the detail of pattern variables).
- (?watch_web :url <in> string)
It fires if a user clicks the link whose address is url.
Example:
(?watch_web :url "http://www.lab7.kuis.kyoto-u.ac.jp")
When a user clicks a link to "http://www.lab7.kuis.kyoto-u.ac.jp", it fires.
ACTION:
- (!speak :sentence <in> string)
Agents display sentence in a speech balloon. If a text-to-speech engine is installed into your PC, MSAgent speaks the sentence by using the engine.
- (!fly :to_coordinate <in> '(integer integer) :time <in> integer)
Agents move to the specified coordinate on the screen for time seconds.
- (!display :url <in> string)
Agents display the web page whose address isurl.
- (!request_selection :selection_list <in> '(string c))
Agents display a list box. User's selection is obtained by "?receive_selection."
Example:
(!request_selection :selection_list '("Golden Pavilion" "Silver Pavilion"))
Agents display two selections, "Golden Pavilion" and "Silver Pavilion", in the list box.
- (!request_text :text <in> string)
Agents display a text box, showing text in the blank, to request a text input from a user.
- (!set :size <in> '(integer integer))
Agents change the size of their body.
- (!gesture :animation <in> "enumerate")
Agents do the specified gesture. Gesture available to MSAgent is as below.
- "Acknowledge": Nods head
- "Alert": Straightens and raises eyebrows
- "Announce": Raises trumpet and plays
- "Blink": Blinks eyes
- "Confused": Scratches head
- "Congratulate": Displays trophy
- "Congratulate_2": Applauds
- "Decline": Raises hands and shakes head
- "DoMagic1": Raises magic wand
- "DoMagic2": Lowers wand, clouds appear
- "DontRecognize": Holds hand to ear
- "Explain": Extends arms to side
- "GestureDown": Gestures down
- "GestureLeft": Gestures left
- "GestureRight": Gesture right
- "GestureUp": Gestures up
- "GetAtention": Leans forward and knocks
- "GetAttentionContinued" Leaning forward, knocks again
- "GetAttentionReturn": Returns to neutral position
- "Greet": Bows
- "Hide": Disappears under cap
- "Idle1_1": Takes breath
- "Idle1_2": Glances left and blinks
- "Idle1_3": Glances right
- "Idle1_4": Glances up to the right and bliks
- "Idle2_1": Looks at wand and blinks
- "Idle2_2": Holds hands and bliks
- "Idle3_1": Yawns
- "LookDown": Looks down
- "LookDownBlink": Blinks looking down
- "LookDownReturn": Returns to neutral position
- "LookLeft": Looks left
- "LookLeftBlink": Blinks looking left
- "LookLeftReturn": Return to neutral position
- "LookRight": Looks right
- "LookRightBlink": Blinks looking right
- "LookRightReturn": Return to neutral position
- "LookUp": Looks up
- "LookUpBlink": Blinks looking up
- "LookUpReturn": Return to neutral position
- "MoveDown": Flies down
- "MoveLeft": Flies left
- "MoveRight": Flies right
- "MoveUp": Flies up
- "Pleased": Smiles and holds hands together
- "Process": Stirs caldron
- "Read": Opens book, reads and looks up
- "ReadContinue": Reads and looks up
- "ReadReturn": Returns to neutral position
- "RestPose": Neutral position
- "Sad": Sad expression
- "Search": Looks into crystal ball
- "Show": Appears out of cap
- "StartListening": Puts hand to ear
- "StopListening"Puts hands over ears
- "Suggest": Displays lightbulb
- "Surprised": Looks surprised
- "Think": Looks up with hand on chin
- "Uncertain": Leans forward and raises eyebrow
- "Wave": Waves
- "Write": Opens book, writes and looks up
- "WriteContinued": Writes and looks up
- "WriteReturn": Returns to neutral position
3.3 Utility Functions
Here is a list of utility functions which are available in MSAgent/Q. These functions are often used to check what value is got with "?receive_text."
- (all-keywords? keyword-list string)
If string includes every element of keyword-list, it returns #t. Otherwise #f.
Example:
(all-keywords? '("Golden Pavilion" "highlight") "What is highlight in Golden Pavilion?") -> #t
(all-keywords? '("Golden Pavilion" "highlight") "Where is Golden Pavilion?") -> #f
- (any-keywords? keyword-list string)
If string includes at least one element of keyword-list, it returns #t. Otherwise #f.
Example:
(any-keywords? '("Golden Pavilion" "Rokuonji-temple") "Where is Golden Pavilion?") -> #t
(any-keywords? '("Golden Pavilion" "Rokuonji-temple") "Where is Rokuonji-temple?") -> #t
(any-keywords? '("Golden Pavilion" "Rokuonji-temple") "Where is Silver Pavilion?") -> #f
4. Running MSAgent/Q
MSAgent/Q executes the Q file that is specified in "/qpackage-dr-e/msagent/MSAgent.ini" file. (It is specified as "..\msagent\scenario\scenario_nishijin.q" in the initial state.) To make MSAgent/Q execute the Q scenario file you wish, please follow the procedure below.
- Double-click "MSAgent.ini" in "/qpackage-dr-e/msagent" directory to open "MSAgent.ini" file by the note pad.
- Set the value of "SCENARIOFILENAME" in "MSAgent.ini" (the portion in the red circle in the figure below) the relative path to the Q file you wish to execute. By the way, if there is a semi-colon (;) at the beginning in "MSAgent.ini", the line fol-lowing the semi-colon is regarded as a comment.
- <Parameters set in MSAgent.ini>
ID Identification number of application. Set 0. SMSIZE Size of shared memory. Set 0x100000 PATH Path to the Q.exe from "/qpackage-dr-e/msagent" directory.
Both absolute path and relative path are available.SCENARIOFILENAME Path to Q scenario file executed by MSAgent from "/qpackage-dr-e/Q" directory. Both absolute path and relative path are available. CONSOLEFLAG Flag about whether console output is on.
off - 0, on - 1LANGUAGEID Language ID for Text-To-Speech engine.
Japanese - 0x0409, English - 0x0411
- Overwrite to save "MSAgent.ini" as "File(F)"->"Save(S)".
- Double-click "MSAgent.exe" below "/qpackage-dr-e/msagent" directory.
- To terminate execution in the middle of execution, position the mouse on the MS Agent character and click with the right mouse button to select "exit" on the menu.




