Jump to content
strider42

[SOLVED] Get spawned and Eden placed groups to behave the same

Recommended Posts

I want to spawn a group with a vehicle and have it move to a MOVE waypoint.

 

If I place a default group ("IRG_MotInf_Team") in the mission from the Eden editor then I only need to tell the group to move to the waypoint for them to mount up into the vehicle and drive to the waypoint.

 

However I get different behaviour if I spawn the same group using BIS_fnc_spawnGroup in a script. Now when I give the spawned group the move to waypoint command the whole group sets off to the waypoint, they don't get in the vehicle. The vehicle and its driver are the first to arrive at the waypoint with the rest of the squad trailing along behind.

 

Does anyone know how I can make a spawned group act like the Eden placed group.

 

Ultimately I would like to spawn a set of units and give them a vehicle of my own choice.

 

Solution:

 

The answer seems to be to use the BIS_fnc_spawnVehicle.  This creates a vehicle with a crew and can specify which group it belongs to.

 

The following code creates a group of infantry then creates 2 vehicles with drivers. Now when the group is give a move command the infantry mount the vehicles and move to the waypoint.


 

_grp = [ markerPos "marker_0", independent, ["I_G_Soldier_TL_F",

"I_G_Soldier_F", "I_G_Soldier_F", "I_G_Soldier_F", "I_G_Soldier_F",

"I_G_Soldier_F", "I_G_medic_F" ] ] call Spk_ai_spawnGroup;


// Spawn vehicles.

_vic = [ markerPos "marker_2", markerDir "marker_2", "I_G_Offroad_01_F",

_grp ] call BIS_fnc_spawnVehicle;


_vic = [ markerPos "marker_3", markerDir "marker_3", "I_G_Offroad_01_F",

_grp ] call BIS_fnc_spawnVehicle;


hint "Group move";

_grp move (markerPos "marker_1");

 

Edited by strider42
Found solution

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

×