Beginning MS Agent: Part 2 Austin TX

Catch up on the second installment of Mack Male's series of articles on the Microsoft Agent control.

Local Companies

Adhesive Software
512-478-7349
800 Brazos St
Austin, TX
Activant Solutions Inc
512-328-2300
804 Las Cimas Pkwy
Austin, TX
MicroMain Corporation
523-328-3235
5100 Bee Caves Road
Austin, TX
Itransition
512 782 4386
115 S Wild Basin Road
Austin, TX
Parts-People.Com Inc
512-339-1990
3106 Industrial Terrace
Austin, TX
Lone Star Internet
512-708-8006
211 E 7th Ste 1110
Austin, TX
Austin Programming Solutions
512-990-2151
900 Congress Avenue
Austin, TX
MicroMain Corporation
512-328-3235
5100 Bee Caves Road
Austin, TX
Terminal B Information Technology Services
512-381-4800
108 Wild Basin Road, Suite 255, Austin, TX 78746
Austin, TX
Mojica PC Solutions
512-300-9956
614 S 1st Street
Austin, TX

provided by: 
Originally published at Internet.com


First of all, my apologies for making everyone wait so long for the second installment! Hopefully you have read the first edition of this tutorial, if not, you can read it here: http://www.developer.com/net/vb/article.php/1539561

In the last edition, we added the Microsoft Agent control to Visual Basic, and we created a program with Agent. This time we'll look at accessing animations, and multiple agents. The code in this tutorial will assume you have done everything in the first edition. Please note I that my references to "animation" could also be "method" or "command".

All Agents come with standard animations, such as "load" or "hide". If you create your own Agent, you can add custom animations. In the first tutorial, we used an animation in the line "Assistant.Show". This is the animation for opening the character. For the Merlin character, the following animations exist:

Acknowledge
Alert
AlertReturn
Announce
AnnounceReturn
Blink
Confused
ConfusedReturn
Congratulate
CongratulateReturn
Congratulate_2
Decline
DeclineReturn
DoMagic1
DoMagic2
DoMagicReturn
DontRecognize
DontRecognizeReturn
Explain
ExplainReturn
GestureDown
GestureDownReturn
GestureLeft
GestureLeftReturn
GestureRight
GestureRightReturn
GestureUp
GestureUpReturn
GetAttention
GetAttentionReturn
GlanceDown
GlanceLeft
GlanceRight
GlanceUp
Greet
GreetReturn
Hear_1
Hear_2
Hear_3
Hear_4
Hide
Idle1_1
Idle1_2
Idle1_3
Idle1_4
Idle2_1
Idle2_2
Idle3_1
Idle3_1Return
Idle3_2
LookDown
LookDownBlink
LookDownReturn
LookLeft
LookLeftBlink
LookLeftReturn
LookRight
LookRightBlink
LookRightReturn
LookUp
LookUpBlink
LookUpReturn
MoveDown
MoveDownReturn
MoveLeft
MoveLeftReturn
MoveRight
MoveRightReturn
MoveUp
MoveUpReturn
Pleased
PleasedReturn
Processing*
ProcessingReturn
Read
ReadContinued
ReadReturn
Reading*
ReadingReturn
RestPose
Sad
SadReturn
Searching*
SearchingReturn
Show
StartListening
StartListeningReturn
StopListening
StopListeningReturn
Suggest
SuggestReturn
Surprised
SurprisedReturn
Think
ThinkReturn
Uncertain
UncertainReturn
Wave
WaveReturn
Write
WriteContinued
WriteReturn
Writing*
WritingReturn

For space constraints, I have not listed descriptions of the animations. To see what they do, try them out. Only certain actions can be used in the form "Assistant.Show". Most of the animations will need to be accessed like this: Assistant.Play "Animation"

You may have noticed that a lot of the animations have a "return' animation. This is provided to allow a smooth transition from one animation back to the neutral position (RestPose). Animations allow you to add life to your character, for example: Assistant.Show Assistant.Play "Wave" Assistant.Speak "Hello!" Assistant.Play "WaveReturn"

If you decide to create your own agent, it is a good idea to include most of these animations in your character. Only some of them are required by the Agent Character Editor (more to come in a later tutorial).

You can load more than one Agent at a time, allowing you to create drama, or anything else you can creatively think of! The easiest way to load another character, is to copy the code from the first tutorial, and change a few things:

Assistant -> Assistant2 (or similar) C:\windows\msagent\chars\merlin.acs -> c:\windows\msagent\chars\anotheragent.acs

To see the second character, you will need to load it: Assistant2.Show. If you were to try creating a theater effect with the two agents now, you might be disappointed; the agents don't wait for one another! However, there is a way to script multiple agent speeches and actions. You must make use of Request and the "Wait' command. For example: Assistant.Play "Greet" Set AssistantRequest = Assistant.Speak ("Hello!") Assistant2.Wait AssistantRequest Assistant2.Play "Announce" Set Assistant2Request = Assistant2.Speak ("Wazzup!") Assistant.Wait Assistant2Request Assistant.Play "Pleased" Assistant.Speak "Now that is cool!"

To get the agents to look and sound the way you want will take some trial and error, but this should be a good starting point.

In The Next Tutorial

The next tutorial will focus on voice recognition and responding to user input. And I promise it won't take so long =)

Author: Mack Male

Read article at Internet.com site

Featured Local Company

Lone Star Internet

512-708-8006
211 E 7th Ste 1110
Austin, TX
http://www.lone-star.net

Related Local Event
Renewable Energy World Conference & Expo North America
Dates: 2/23/2010 - 2/25/2010
Location: Austin Convention Center, Austin
Austin, TX
View Details