Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: arj0n on Wed 21/10/2009 22:29:33

Title: Animation during dialog [solved]
Post by: arj0n on Wed 21/10/2009 22:29:33
Is it possible to let an animation run during a dialog?

NPC1 needs to walk from point A to point B and back, like a loop.
But when the player character starts a dialog with let's say NPC2,
NPC1 stops walking and wait (or freeze) until that dialog has ended.
After that, he continue walking again.
Is there a way to keep him moving during the dialog?

So, somehow the walking animation is blocked until the dialog has ended...
Title: Re: Animation during dialog
Post by: Crimson Wizard on Thu 22/10/2009 00:10:42
Try setting Run game loops while dialog settings are displayed option on General settings page.
Title: Re: Animation during dialog
Post by: arj0n on Thu 22/10/2009 10:30:23
Thanx for your answer CrimsonWizard but it still doesn't work. :'(

Some better explaining:

I have one conversation in dialogs-0: dDialog0 which have both "show" and "say" active.

I also have this RepExec in the roomscript:

function room_RepExec()
{
 if (!cBird.Moving)
 {
   if (cBird.x == 190)
   {
     cBird.Walk(400,  163, eNoBlock, eAnywhere);      
   }
   else
   {
     cBird.Walk(190,  163, eNoBlock, eAnywhere);
   }
 }
 if (!cKeen.Moving)
 {
   if (cKeen.x == 190)
   {
     cKeen.Walk(400,  190, eNoBlock, eAnywhere);
   }
   else
   {
     cKeen.Walk(190,  190, eNoBlock, eAnywhere);
   }
 }
}

Even with "Run game loops while dialog settings are displayed" option set as True on General settings page: when I click on cKeen to start the dialog, cKeen and cBird only finish the part of the loop [.walk] they are doing for that moment and when finished they wait for when the dialog will end. Only then they both restart there walking loop again.

Is there no way to keep for example cBird moving because that one has nothing to do with the dialog? ???
Title: Re: Animation during dialog [solved]
Post by: arj0n on Thu 22/10/2009 11:21:02
OK, this is how it should be [thanx many times Ben304 ;)]:



function room_RepExec()
{
}
function repeatedly_execute_always()

{
  if (!cBird.Moving)
  {
    if (cBird.x == 190)
    {
      cBird.Walk(400,  163, eNoBlock, eAnywhere);     
    }
    else
    {
      cBird.Walk(190,  163, eNoBlock, eAnywhere);
    }
  }
  if (!cKeen.Moving)
  {
    if (cKeen.x == 190)
    {
      cKeen.Walk(400,  190, eNoBlock, eAnywhere);
    }
    else
    {
      cKeen.Walk(190,  190, eNoBlock, eAnywhere);
    }
  }
}
Title: Re: Animation during dialog [solved]
Post by: Crimson Wizard on Thu 22/10/2009 13:23:11
Well, actually that will be useful to know; I am not a pro at AGS scripting yet :)
So, it's repeatedly_execute_always function that does that trick?
Title: Re: Animation during dialog [solved]
Post by: ThreeOhFour on Thu 22/10/2009 13:31:38
Yep, repeatedly_execute_always runs even while you've got something blocking running, such as Arjon had with his dialog.

See here (http://www.americangirlscouts.org/agswiki/Predefined_global_script_functions#repeatedly_execute_always) in the manual :)