Those blasted navgoals... -1 reply

  • 1
  • 2

Please wait...

eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#1 11 years ago

How do I make an NPC go along a path, with multiple points?




NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#2 11 years ago

Each of the navgoals needs a targetname. Using an icarus script that "affects" the NPC (I think via script_targetname), set the variable SET_NAVGOAL to the targetname of the waypoint you want it to walk to.

There are more complete details available in the ICARUS manual, which can be found in the SDK.




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#3 11 years ago

NAB622;5209398Each of the navgoals needs a targetname. Using an icarus script that "affects" the NPC (I think via script_targetname), set the variable SET_NAVGOAL to the targetname of the waypoint you want it to walk to.

There are more complete details available in the ICARUS manual, which can be found in the SDK.

I know that, but I need to know how to make them use multiple navgoals (IE, once you reach Navgoal1, go to Navgoal2...)




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#4 11 years ago

You can put the set_navgoal into a task and then wait("task's name"). The script flow will halt until the condition is fulfilled, that is, until the NPC has reached the navgoal. Then just launch the next task containing the next navgoal.

However, you'll quickly see this results in a jerky movement in JA. Basically the NPC stops or almost stops at each navgoal. It worked much better in JO, but then Raven had to "fix" it for JA. There could be some ways to alleviate the behavior, but you'll have to figure them out by trial and error, taking into account the unique requirements and opportunities your map offers.




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#5 11 years ago

lassev;5209734You can put the set_navgoal into a task and then wait("task's name"). The script flow will halt until the condition is fulfilled, that is, until the NPC has reached the navgoal. Then just launch the next task containing the next navgoal.

However, you'll quickly see this results in a jerky movement in JA. Basically the NPC stops or almost stops at each navgoal. It worked much better in JO, but then Raven had to "fix" it for JA. There could be some ways to alleviate the behavior, but you'll have to figure them out by trial and error, taking into account the unique requirements and opportunities your map offers.

Doesn't appear to work. Here's my script: //Generated by BehavEd

rem ( "Go here, fool." ); set ( /*@SET_TYPES*/ "SET_NO_COMBAT_TALK", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_USE_CP_NEAREST", /*@BOOL_TYPES*/ "true" ); //$"patrolRunNoChase"@5 set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" ); set ( /*!*/ "SET_WALKING", /*!*/ "false" ); set ( /*!*/ "SET_RUNNING", /*!*/ "true" ); set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "true" ); set ( /*!*/ "SET_CHASE_ENEMIES", /*!*/ "false" );

task ( "go_stormtrooper" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", $get( STRING, "SET_PARM1")$ ); }

wait ( $get( FLOAT, "SET_PARM2")$ ); dowait ( "go_stormtrooper" ); //$"default"@6 set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" ); set ( /*!*/ "SET_CHASE_ENEMIES", /*!*/ "true" ); set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "true" ); set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "false" ); set ( /*!*/ "SET_WALKING", /*!*/ "false" ); set ( /*!*/ "SET_RUNNING", /*!*/ "false" ); set ( /*@SET_TYPES*/ "SET_NO_COMBAT_TALK", /*@BOOL_TYPES*/ "false" ); The stormtrooper has this set as their spawnscript.




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#6 11 years ago

Assuming Parm1 and 2 aren't causing the problems, under what conditions doesn't it work? Is the NPC already aware of the player? They don't always follow navgoal commands if they are. Still, I'd check the script flow with the script monitor to verify it runs fine, other than the NPC not running to the navgoal.




NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#7 11 years ago

Just FYI, watch out with using navgoals in a task - that doesn't work in MP. In MP you need to manually use a "wait" block.

If you use a nvagoal in a task in MP and try to get it to "wait" for the navgoal, it doesn't - the script just keeps on moving without waiting for the NPC to reach the destination.




Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#8 11 years ago

If it works for SP, there should be a fix for it on the way that will be open-sourced so Slider can happily copypaste it into JA+ <_




NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#9 11 years ago
-Raz0r-;5210851If it works for SP, there should be a fix for it on the way that will be open-sourced so Slider can happily copypaste it into JA+ <_<

Not a good idea. When you're scripting for MP, you have to make scripts that work regardless of the code mod in place. By fixing some of the scripting bugs, JA+ has actually made it harder to script for multiplayer because many other mods have not fixed said bugs. This has caused me many headaches in the past.

The only way I'd like to see it fixed is in an official 1.02 release. Obviously, that won't happen - therefore, may as well leave it as-is.




eezstreet

Lord of the .DCC files

50 XP

16th June 2008

0 Uploads

2,662 Posts

0 Threads

#10 11 years ago

This doesn't work at all. The stormtrooper is completely unaware of the player's presence and it just sits there.




  • 1
  • 2