Jump to content
Undeceived

How to launch a whitelisted Arsenal without the ammo box stuff?

Recommended Posts

Hello guys. If I understand things correctly, the only way to set up a whitelisted Arsenal (an Arsenal with chosen gear in it) is by "virtually" adding stuff into a box, then launching the Arsenal via the action menu after getting to the box.

 

 

But I don't want the damn action menu stuff.  <_<  I want to launch the Arsenal with my preset gear right at mission start and via script, without the player having to approach a box and selecting the right action.

I tried out every possible bullshit, but no avail... :D

 

 

Any solution or idea?

 

Many thanks.

Share this post


Link to post
Share on other sites

Untested but the flow should look something like..

//wait until after briefing
sleep 0.1;

//Sart a loading screen to hide init behind ( preload( although has its own ) + making whitelist  ) 
[ "myLoadingScreen" ] call BIS_fnc_startLoadingScreen;

//Preload arsenal lists
[ "Preload" ] call BIS_fnc_arsenal;

//Make sure player object is available
waitUntil { !isNull player };

//Add all your stuff to the PLAYER ( all it does is sets some variables on an object, that object then acts as arsenal whitelist )
//[ whitelist object, STUFF, isglobal, add action ]
[ player, [ /*STUFF*/ ], false, false ] call BIS_fnc_addVirtual#Cargo;

//End the loading screen
[ "myLoadingScreen" ] call BIS_fnc_endLoadingScreen;

//Pop open the arsenal display - [ full version, object that holds whitelist, object to alter ( user of arsenal ) ]
["Open",[false,player, player]] call bis_fnc_arsenal;
  • Like 1

Share this post


Link to post
Share on other sites

Larrow, you're the best!! :wub: Thanks a lot, man!

 

This is the little whitelisted Arsenal with some allowed gear (weapons, mags and items), launched in the init.sqf:

//wait until after briefing
sleep 0.1;

//Sart a loading screen to hide init behind ( preload( although has its own ) + making whitelist )
[ "myLoadingScreen" ] call BIS_fnc_startLoadingScreen;

//Preload arsenal lists
[ "Preload" ] call BIS_fnc_arsenal;

//Make sure player object is available
waitUntil { !isNull player };

//Add all your stuff to the PLAYER ( all it does is sets some variables on an object, that object then acts as arsenal whitelist )
//[ whitelist object, STUFF, isglobal, add action ]
[ player, [ "CUP_arifle_G36K_camo","CUP_launch_M136" ], false, false ] call BIS_fnc_addVirtualWeaponCargo;
[ player, [ "CUP_30Rnd_556x45_G36","CUP_M136_M" ], false, false ] call BIS_fnc_addVirtualMagazineCargo;
[ player, [ "CUP_muzzle_snds_G36_desert" ], false, false ] call BIS_fnc_addVirtualItemCargo;

//End the loading screen
[ "myLoadingScreen" ] call BIS_fnc_endLoadingScreen;

//Pop open the arsenal display - [ full version, object that holds whitelist, object to alter ( user of arsenal ) ]
["Open",[false,player, player]] call bis_fnc_arsenal;

Thanks again!

Share this post


Link to post
Share on other sites

I tested the code above and it only bricks the game. 

Share this post


Link to post
Share on other sites
30 minutes ago, kibaBG said:

I tested the code above and it only bricks the game. 

 

Probably copy/paste corruption. I get invisible characters when I copy either code block. But also, how and when are you running it?

 

This should be clean:

//wait until after briefing
sleep 0.1;

//Sart a loading screen to hide init behind ( preload( although has its own ) + making whitelist )
[ "myLoadingScreen" ] call BIS_fnc_startLoadingScreen;

//Preload arsenal lists
[ "Preload" ] call BIS_fnc_arsenal;

//Make sure player object is available
waitUntil { !isNull player };

//Add all your stuff to the PLAYER ( all it does is sets some variables on an object, that object then acts as arsenal whitelist )
//[ whitelist object, STUFF, isglobal, add action ]
[ player, [ "CUP_arifle_G36K_camo","CUP_launch_M136" ], false, false ] call BIS_fnc_addVirtualWeaponCargo;
[ player, [ "CUP_30Rnd_556x45_G36","CUP_M136_M" ], false, false ] call BIS_fnc_addVirtualMagazineCargo;
[ player, [ "CUP_muzzle_snds_G36_desert" ], false, false ] call BIS_fnc_addVirtualItemCargo;

//End the loading screen
[ "myLoadingScreen" ] call BIS_fnc_endLoadingScreen;

//Pop open the arsenal display - [ full version, object that holds whitelist, object to alter ( user of arsenal ) ]
["Open",[false,player, player]] call bis_fnc_arsenal;

 

  • Like 2

Share this post


Link to post
Share on other sites

@Harzach your code runs now, thanks man. 😀 But should I use it in initPlayerLocal.sqf and onPlayerRespawn.sqf instead of init.sqf? Probably it should be local to different players?
 

Edit: Just tested it, works perfectly used in initPlayerLocal.sqf and initPlayerLocal.sqf, just removed sleep.   

  • Like 1

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

×