walking loops?

Started by lilinuyasha, Sun 10/07/2011 04:47:39

Previous topic - Next topic

lilinuyasha

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?
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

monkey0506

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:

Code: ags
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:

Code: ags
@3
// ..say some stuff..
  pacing = false;
return

lilinuyasha

 :o Wow that seems complicated. Alright then, standard dialog it is!
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

monkey0506

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.

lilinuyasha

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!
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

SMF spam blocked by CleanTalk