addwaypoint crash [SOLVED]

Started by rmonic79, Wed 12/04/2017 22:15:17

Previous topic - Next topic

rmonic79

hey guys can someone help me with this crash?



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.

Khris

Looks like you've hit some hardcoded waypoint limit. Try adding a cGilman.StopMoving(); before the loop starts over again.

rmonic79

It seems to work, thanks khriss. Maybe it should be added to manual :)

Slasher

This is my game works..

Code: ags

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);
} 
}



Snarky

Change the first AddWaypoint() to a Walk(), like in the example in the manual.

rmonic79

Works with StopMoving() so i can add as many as i want with addwaypoint(). I let them walk for twenty minutes :)


Cookie_Wood

#6
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


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);
 }
}



Khris

Try this:

In General settings -> Dialog, set "Run game loops while dialog options are displayed" to true.

Cookie_Wood

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

SMF spam blocked by CleanTalk