Home arrow Delphi-Kylix arrow Page 4 - Delphi and Microsoft Agent
DELPHI-KYLIX

Delphi and Microsoft Agent


While writing a letter in MS Word, I accidentally clicked on the help button and this animated little thing on a a bike jumped up and presented me with an input box. I’ve seen it a few times before, but this time I wondered if I could write a program that could animate characters in Delphi.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
November 01, 2006
TABLE OF CONTENTS:
  1. · Delphi and Microsoft Agent
  2. · Using the Agent in Delphi
  3. · Modifying speech out
  4. · Other features of the Agent

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Delphi and Microsoft Agent - Other features of the Agent
(Page 4 of 4 )

You can move the agent around the screen by using the Moveto() method. The method takes three parameters:

Moveto(x,y,0)

The agents can also interact with each other. This can be achieved by using the request and wait methods. The code could look something like this:

//create the vars
var
Request1, Request2 : IAgentCtlRequest;
//load the agents
Agent1.characters.load('Merlin','merlin.acs');
Merlin:=Agent1.Characters.Character('Merlin');
Agent1.characters.load('Peedy','peedy.acs');
Peedy := Agent1.Characters.Character('Peedy');
//make them visible
Peedy.Show(False);
merlin.Show(False);
//start the interaction
  Request1 := Peedy.Speak('Hello there','');
  merlin.Wait(Request1);
  Request2 := merlin.Speak('Who''s there?','');
  Peedy.Wait(Request2);
  Request1 := Peedy.Speak('Its me Peedy.','');
  merlin.Wait(Request1);
  Request2 := merlin.Speak('Peedy who?','');
  Peedy.Wait(Request2);
  Request1 := Peedy.Speak('Just Peedy!','');
  merlin.Wait(Request1);
  Peedy.Play('Pleased');
  merlin.Play('Pleased');

To interact with the user, as opposed to another agent, you just need to use input boxes and make the agent read your responses.

Conclusion

Agents will make your applications interactive and fun to use. And with some of the core components that you installed, you can build your own characters to use in your applications.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials