Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: lilinuyasha on Sun 10/07/2011 04:47:39

Title: walking loops?
Post by: lilinuyasha on Sun 10/07/2011 04:47:39
I've tried searching for what i need here, and couldn't find it. So keep that in mind before i get flooded with hate for being incompetant/being a brony.

Anyways, i need a character to walk back and forth from one spot to another until a specific line in a dialogue is triggered. How would i go about doing something liek that?
Title: Re: walking loops?
Post by: monkey0506 on Sun 10/07/2011 06:37:34
Once the character stops, what happens after that? The reason I'm asking is to better determine whether you need a global variable.

Anyway, the most generic response I can provide based on the information given is this:

- Create a global variable, say called pacing (type bool, default true)

- Then, in the GlobalScript.asc:

function repeatedly_execute()
{
  if (pacing)
  {
    if (!cPace.Moving)
    {
      if (cPace.x == 0) cPace.Walk(320, cPace.y, eNoBlock);
      else cPace.Walk(0, cPace.y, eNoBlock);
    }
  }
}


You'd need to fill in the appropriate character script name, and coordinates, but it's actually pretty simple here.

- Finally, in the dialog script:

@3
// ..say some stuff..
  pacing = false;
return
Title: Re: walking loops?
Post by: lilinuyasha on Sun 10/07/2011 06:44:25
 :o Wow that seems complicated. Alright then, standard dialog it is!
Title: Re: walking loops?
Post by: monkey0506 on Sun 10/07/2011 09:12:20
I don't mean to come across rude, but if that seems "complicated", then you're going to have a difficult time doing much of anything in AGS.
Title: Re: walking loops?
Post by: lilinuyasha on Sun 10/07/2011 17:27:34
What i meant to say is that I'll use that and then insert it in the natural dialog! Or maybe have Pinkie Pie simply run her view during hte dialog. I'll think of something. Thanks for the help regardless!