Jump to content
Spriterfight

Easy way to set waypoints for ai in multiplayer

Recommended Posts

I usually make separate script file with waypoints for the ai to move there every time if they respawn so their waypoint dosent get disapeared but are there an easier method to do this than make every individual group a script.sqf?

Share this post


Link to post
Share on other sites

@Spriterfight You can create invisible markers on your map for each group's path, and then just pass each array of markers along with the group to your script, e.g:

[grp1, ["grp1mkr1", "grp1mkr2", "grp1mkr3", "grp1mkr4"]] execVM "addpath.sqf";

//addpath.sqf

params ["_group", "_markers"];
{
	_group addWaypoint [getMarkerPos _x, 0];
}forEach _markers;
  • Thanks 1

Share this post


Link to post
Share on other sites
On 3/23/2020 at 2:29 PM, Spriterfight said:

for the ai to move there every time if they respawn

How are the units spawning?

 

If you want to place the waypoints visually in the editor you could use copyWaypoints command.

For example, say you have a spawnAI module and you want all groups spawned by the module to follow a certain set of waypoints...

  • Place the spawnAI module
  • Place a unit in the editor near the module
  • In the units Init attribute place the following code...
this disableAI "All";
this hideObjectGlobal true
  • Sync the unit to the module
  • Give the unit the waypoints you want all spawned groups to follow
  • In the spawnAI modules Expression attribute place...
params[ "_group", "_module" ];

_waypointHolder = synchronizedObjects _module select 0;
_group copyWaypoints group _waypointHolder;

TEST_MISSION

Job done, no external script files, easy to edit waypoints.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you guys!Usually i dont use spawn module because its limited and it's  a lot of work to configure it.

Share this post


Link to post
Share on other sites
3 hours ago, Von Quest said:

Just paste into squad leader's init box:

On 3/23/2020 at 2:29 PM, Spriterfight said:

if they respawn

AI dont actually respawn so placing anything in their init would not solve the issue, unless specifically written to handle it.

 

7 hours ago, Spriterfight said:

Usually i dont use spawn module

So the question still remains...

What are you using to spawn/respawn the AI?

  • Like 1

Share this post


Link to post
Share on other sites

Derp. Sped-read while tired. Yup, sorry.

  • Like 1

Share this post


Link to post
Share on other sites
18 hours ago, Larrow said:

AI dont actually respawn so placing anything in their init would not solve the issue, unless specifically written to handle it.

 

So the question still remains...

What are you using to spawn/respawn the AI?

i make them playable and via multiplayer respawn markers and add them eventhadnler when respawn thats gives them waypoint

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×