Jump to content
Sign in to follow this  
chondo999

How do I apply a custom made loadout to spawned group/unit?

Recommended Posts

So, I spawned my group using this code

if (!isServer) exitWith {};
_spawnPoint = _this select 0;
_patrolArea = _this select 1;
_side = EAST;
_pos = getMarkerPos _spawnPoint;
_spawngrp = [_pos , _side, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_fnc_spawnGroup;
sleep 3;
_leader = leader _spawngrp;
nul = [_leader,_patrolArea,"limited","safe","line",1]execVM "SimplePatrolScript\patrol.sqf";

The question is: How do I make this group use the custom loadout I made (called loadout1.sqf)? Any help would be much appreciated.

Share this post


Link to post
Share on other sites

so we could add

{
    null = [_x] execVM "loadout1.sqf";
}forEach group _leader;

Share this post


Link to post
Share on other sites
}forEach (units _spawngrp);  

Share this post


Link to post
Share on other sites

Hi, depending on the urgency of your little project I'd advise you to wait for the official Arma3 Arsenal release in the next big game update. You should be able to simply create and assign loadouts to oyur units from what i read.

Share this post


Link to post
Share on other sites

Larrow, Lala, none of those codes work. Could you try this out on your own system to see if they work? Thanks. Any other help/suggestion would be much appreciated.

Share this post


Link to post
Share on other sites
... The question is: How do I make this group use the custom loadout I made (called loadout1.sqf)? Any help would be much appreciated.

Put this line immediately after your _leader = leader _spawngrp;

{[_x] execVM "loadout1.sqf";} forEach units _spawngrp;

Share this post


Link to post
Share on other sites

As Beerkan shows, Larrows suggestion will work. Nobody has to run it on thier machine, because it works. Its up to you to code the loadout script in a way that works with the forEach statement.

I might suggest telling what error you get, or providing some/all of the content of the loadout script or even just what you used to do the call/execVM.

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
Sign in to follow this  

×