Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2006
    Posts
    5,380

    MSAgent with LuaCOM ???

    anyone had any luck useing MSAgent with LuaCOM ???

    iv been asked to work on a educational project for my daughters school that will use some MSAgent characters, i can make this work in PB but i want to use AMS and i dont want to have to wrap every command i sent to MSAgent in a dll as there could be 1000's

    heres what i have
    Code:
    AgentObj = luacom.CreateObject("Agent.Control.2")
    if AgentObj then
    	if AgentObj then
    		AgentObj.Connected=true	
    		AgentObj.Characters.Load("Max", "Max.acf")
    		AgentObj.Characters.Show("Max")
    		AgentObj.Characters.Play("Max","Greet")
    		AgentObj.Characters.Speak("Max","Hello. ")		
        end
    else
    	Dialog.Message("Error", "Could not create luacom object.")
    end
    it gets past the "AgentObj.Connected" but then errors on "AgentObj.Characters.Load" saying "Characters is a nil value" but it should be there,

    heres what MS has to say.....but it dident really help me :(
    http://msdn2.microsoft.com/en-us/library/ms695962.aspx

    what am i doing wrong ?
    Open your eyes to Narcissism, Don't let her destroy your life!!

  2. #2
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    Its been a while, but here you go. Worm started this thread. i used it in a project also.

    http://www.indigorose.com/forums/sho...hlight=MSAGENT

    http://www.indigorose.com/forums/showthread.php?t=14363

    Hope that helps some

    Chris

  3. #3
    Join Date
    May 2006
    Posts
    5,380
    Thats Perfect, how did i miss that one

    got just what i need to get started now

    Code:
    AgentObjEvents={}
    AgentObj = luacom.CreateObject("Agent.Control")
    if AgentObj then
    	if AgentObj then
    		AgentObj.Connected = 1	
    		AgentObj.Characters:Load("Max", "C:\\WINDOWS\\Msagent\\chars\\Max.acs")
    		if AgentObj.Characters("Max") ~= nil then
    			luacom.Connect(AgentObj, AgentObjEvents)
    			AgentObj.Characters("Max"):MoveTo(0,0)
    			AgentObj.Characters("Max"):Show(nil)
    			AgentObj.Characters("Max"):Play("Greet")
    			AgentObj.Characters("Max"):Speak("Hello. ")	
    		else
    	
    		end
        end
    else
    	Dialog.Message("Error", "Could not create luacom object.")
    end
    funny enough, "AgentObjEvents" would have been my next milestone so that solves 2 problems in one,

    thanks for pointing me in the right direction
    Open your eyes to Narcissism, Don't let her destroy your life!!

  4. #4
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    No Problem But in all reality... WORM's the MAN!

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    WORM's the MAN!
    lol, very true....i think everyone at this forum has been helped by worm at some point...and i think me more than most, lol

    Cheers worm
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Jul 2007
    Posts
    1,512
    i really like this i have just downloaded all 4 on the ms site going to see if i can do something with them.


  7. #7
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    there was a complete web circle out there somewhere that had even more characters.

    chris

  8. #8
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137

    SAPI - Speak - LuaCOM - MSAgent - Intrigued

    I went ahead and created an example (.apz - exported AMS 7 project) so folks can download and get to testing, trying out such code.

    Note: You will need to reference (click on the check box for such) the LuaCOM plugin. Project > Plugins > LuaCOM (Thanks to Brett, who was the previous lead developer for the I.R. team, for donating this free plug-in!)

    SAPI (computer speaks) example:

    http://www.amsuser.com/ams/examples/...-Intrigued.apz
    Intrigued

Similar Threads

  1. Problem with LuaCOM plugin
    By columbo in forum AutoPlay Media Studio 7.5
    Replies: 2
    Last Post: 12-10-2007, 05:39 AM
  2. MSAgent in AMS
    By Worm in forum AutoPlay Media Studio 5.0
    Replies: 11
    Last Post: 04-08-2006, 06:08 AM
  3. Plugin: LuaCOM
    By Brett in forum Setup Factory 8.0 Examples
    Replies: 1
    Last Post: 08-04-2005, 09:18 AM
  4. luaCOM and M.S. Word...
    By Intrigued in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 02-09-2005, 09:01 AM
  5. Action Plugin: LuaCOM
    By Brett in forum AutoPlay Media Studio 5.0
    Replies: 19
    Last Post: 01-31-2005, 10:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts