Jump to content

Home

Waypoints


TimBob12

Recommended Posts

Hello there,

 

Ive been using some waypoints and everything has gone well so far. I have on question though. Is there a way to make an NPC pause at a waypoint before continuing to the next waypoint? Also if I pause one will I then have to pause them all?

 

Thanks

 

TB12

Link to comment
Share on other sites

Hello back there,

 

There are some possibilities depending on what you want... Do you want the NPC to move if a certain condition succeeds or do you just want him to wait a few seconds?

 

First Case: You have to do some seperate scripts. When condition is true the npc walks to the next waypoint. And so on.

 

Second Case: Then it's just a simple Delaycommand or ActionWait in the script.

 

Fastmaniac

Link to comment
Share on other sites

so you're using waypoints from the game?

 

That's good and it would be something like

 

void main(){
          ActionWait(2.0);
          AssignCommand(GetObjectByTag("TAG_OF_NPC", 0), ActionMoveToObject(GetObjectByTag("WAYPOINT_1", 0), 1, 0.0));
          ActionWait(20.0);
          AssignCommand(GetObjectByTag("TAG_OF_NPC", 0), ActionMoveToObject(GetObjectByTag("WAYPOINT_2", 0), 1, 0.0)));
}

 

This script is telling the NPC to move to WAYPOINT_1 and assumes he has reached the Waypoint in less than 20 Seconds. Then the NPC is told to move to Waypoint_2. If it takes the NPC longer to reach the Waypoint increase the number of Seconds in the second ActionWait.

 

Hope that helps...

 

Fastmaniac

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...