Microsoft Agent Tutorial Chapter 1

Microsoft Agent Tutorial Chapter 1 - Microsoft Agent...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Microsoft Agent Tutorial Chapter 1 http://abstractvb.com/code/code714.asp 1 of 4 11/21/2006 11:56 PM Main > Code Central Microsoft Agent Tutorial Chapter 1 ID: 714 Author: Abstractvb Date: 4/22/2000 6:53:44 PM VB6, MSAgent 2 Part 1 - Loading the Microsoft Agent Control The easiest way to load the agent control is to select it from the controls menu in VB and just drop it on your form. Alternatively you can add a reference to the Microsoft Agent Control 2.0 from the References menu item in Visual Basic and create an object for the control at runtime like this: Private WithEvents MSAgent As Agent Set MSAgent = New Agent For the purposes of this text we will assume the name of the Agent Control is called "MSAgent". Part 2 - Loading a Character A Character file defines what your agent will look like, and all the character animations are stored there. Before you can begin programming for MS Agent you need to specify what character file to open. ‘Create a Character Object Private Merlin As IAgentCtlCharacterEx ‘Load the Default Character by not supplying ‘an ACS file MSAgent.Characters.Load "Merlin", _ “c:\windows\msagent\chars\merlin.acs” ‘Set the Merlin object to our new character. Set Merlin = MSAgent.Characters("Merlin") Microsoft Agent 2.0 has the ability to allow the user to enter in a default character to use with programs. If you want to load the default character the code looks just about the same. Instead of doing this: MSAgent.Characters.Load "Merlin", “c:\windows\msagent\chars\merlin.acs” We just need to leave out the path and the default will be used, like this: MSAgent.Characters.Load "DefaultCharacter" To show your character on the screen do the following:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Agent Tutorial Chapter 1 http://abstractvb.com/code/code714.asp 2 of 4 11/21/2006 11:56 PM Merlin.Show You can also hide your character by doing this: Merlin.Hide Part 3 - Speech and Animations
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Microsoft Agent Tutorial Chapter 1 - Microsoft Agent...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online