Jump to content
thefluffyraisin

Virtual Arsenal: Switching Between Units

Recommended Posts

Okay, so this one might be a bit of trouble. At the beginning of my mission, I want to use the built in Arma 3 virtual arsenal to create a weapon loadout for the player. However, I'd also like to be able to choose a load-out for the other 3 units that are on the player's team. Would it be possible to edit the virtual arsenal to possibly add a button or something like that to switch between all 4 units (player included), give them each their load-outs, and then have that carry over to the actual mission itself? I guess this is basically a gear selection thing before the mission. (Would this go in the intro section of the mission?) Thanks for your time guys.

Share this post


Link to post
Share on other sites

There's no need for a button, the 3D editor has that functionality pretty much built in.

 

Open 3D editor >> place unit >> right click placed unit >> navigate down to arsenal... and click on it >> edit loadout of unit >> click ok >> copy edited unit using Ctrl+C >> paste said unit using Ctrl+V.

Share this post


Link to post
Share on other sites

i think the point is to have this as an option for the players once the mission has started.

 

so i'd just use player switch to achieve this,

 

so basically use the "selectplayer" command right before you open the arsenal. then detect somehow when teh arsenal is being close and switch back to the original player that you have stored in a variable before using "selectplayer" again.

Share this post


Link to post
Share on other sites
choose a load-out for the other 3 units that are on the player's team.

Team? by this do you mean they are all in the players group?

 

The below will allow you to choose each loadout via the VA for each unit in the players group, doing the player first.

//initPlayerLocal.sqf
waitUntil{ time > 0 };

//Place here any BIS_fnc_addVirtual#Cargo to add items to VA

[ missionNamespace, "arsenalClosed", {
    arsenalOpened = false;
}] call BIS_fnc_addScriptedEventHandler;

{
    //true means full arsenal, use false if using BIS_fnc_addVirtual#Cargo commands above
    ["Open",[true,objNull,_x]] call BIS_fnc_arsenal;
    arsenalOpened = true;
    waitUntil{ !arsenalOpened };
    
    //Do player first and then any other units of the players group
}forEach ( [ player ] + ( units group player - [ player ] ));

Very simple example that works as the player spawns into the mission there maybe other things you would want to do to stop other things happening before you have finished loading out your units.

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

×