Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: rmonic79 on Wed 12/04/2017 22:15:17

Title: addwaypoint crash [SOLVED]
Post by: rmonic79 on Wed 12/04/2017 22:15:17
hey guys can someone help me with this crash?

(http://i.imgur.com/vcZu2HGl.png) (http://imgur.com/vcZu2HG)

the characters are looped and when they reach certain position they get to start and use addwaypoint again, the game freeze after a minute or near it.
Title: Re: addwaypoint crash
Post by: Khris on Thu 13/04/2017 15:06:13
Looks like you've hit some hardcoded waypoint limit. Try adding a cGilman.StopMoving(); before the loop starts over again.
Title: Re: addwaypoint crash
Post by: rmonic79 on Thu 13/04/2017 23:21:30
It seems to work, thanks khriss. Maybe it should be added to manual :)
Title: Re: addwaypoint crash [SOLVED]
Post by: Slasher on Sat 15/04/2017 17:33:53
This is my game works..

Code (ags) Select

function room_RepExec()
{
  if(Fly==false && !cFly.Moving){
  cFly.AddWaypoint(173, 97);
  cFly.AddWaypoint(91, 114);
  cFly.AddWaypoint(192, 93);
  cFly.AddWaypoint(249,119);
  cFly.AddWaypoint(149,82);
  cFly.AddWaypoint(64,86);
}
}


Title: Re: addwaypoint crash [SOLVED]
Post by: Snarky on Sat 15/04/2017 19:13:43
Change the first AddWaypoint() to a Walk(), like in the example in the manual.
Title: Re: addwaypoint crash [SOLVED]
Post by: rmonic79 on Wed 19/04/2017 16:07:14
Works with StopMoving() so i can add as many as i want with addwaypoint(). I let them walk for twenty minutes :)

Title: Re: addwaypoint crash [SOLVED]
Post by: Cookie_Wood on Sun 05/05/2019 09:48:50
Hey guys,

Re-openning the topic. I had quite the same problem with the error message "way point too complexe" I just delete 2 of the waypoints and it solved the thing perfectly.

But, I had another similar problem. The thing is, I got a big room with 5 NPC including 2 kids who turn around each other with a timer (just like they're playing).

But when I start a dialog with another NPC in the same room, the timers stop and kids stop moving. Sorry if it's a stupid question :'( I tryed to put it into the globalscript with condition if (player.room==9) but I'm not sure it's a good idea. Cheers :D

Here's a bit of code :

Code (ags) Select


function room_Load()
{
SetTimer(1, 1);
SetTimer(2, 1);
}

function room_RepExec()
{
if (IsTimerExpired(1))
{
cLouna.Walk(1755, 835);
cLouna.AddWaypoint(1395, 915);
cLouna.AddWaypoint(1290, 770);
cLouna.AddWaypoint(1610, 700);
cLouna.AddWaypoint(1700, 735);
SetTimer(1, 200);
}

if (IsTimerExpired(2))
{
cLouca.Walk(1290, 770);
cLouca.AddWaypoint(1610, 700);
cLouca.AddWaypoint(1700, 735);
cLouca.AddWaypoint(1755, 835);
cLouca.AddWaypoint(1395, 915);
SetTimer(2, 200);
}
}


Title: Re: addwaypoint crash [SOLVED]
Post by: Khris on Sun 05/05/2019 19:48:33
Try this:

In General settings -> Dialog, set "Run game loops while dialog options are displayed" to true.
Title: Re: addwaypoint crash [SOLVED]
Post by: Cookie_Wood on Sat 11/05/2019 12:07:42
Hi Khris :)

Thank you, but it's already set on True and it works great for others NPC. But here, it's not really a view/loop, I try to do it adding some "waypoint" into the room rep_execute.
I was hoping I wouldn't have to create a specific view for this, but maybe it is the only solution ?

Thank you again :D