Jump to content
Frankdatank1218

How to use Virtual Arsenal like the Virtual Ammobox System?

Recommended Posts

How do I script an Ammobox in the editor to have all items available in Virtual arsenal so it can be used instead of the VAS mod?

Sent a feedback report becaus the BI Wiki script for ammobox does not work and is unclear as to where to put the script, they said "it works now" and closed the report, WTF? Nothing was explained.

I would like someone to explain how I would script an Arsenal Ammobox clearly.

Share this post


Link to post
Share on other sites

Did you use ["AmmoboxInit",myBox] call BIS_fnc_arsenal; or ["Open",true] call BIS_fnc_arsenal;?

Share this post


Link to post
Share on other sites
Did you use ["AmmoboxInit",myBox] call BIS_fnc_arsenal; or ["Open",true] call BIS_fnc_arsenal;?

Neither works, where do I put them? Do I have to name the box "myBox"? Do I put it in a box's init field? In the Description.ext? In an init.sqf? I have no idea, these are the details I need explained, I'm a scripting newb basically.

A step-by-step would be great.

Share this post


Link to post
Share on other sites

To have it by addaction like VAS you will want to make it in .SQF and call that .sqf with the addaction, That way you can set up the parameters for things like disallowed weapons and so forth.

You can call it with a trigger as well by putting the function in the on act field.

Using https://community.bistudio.com/wiki/Arsenal you should be able to get it set up the way you want, It is sum what involved but for a basic everything is available box it is straight forward.

Share this post


Link to post
Share on other sites

Put '["AmmoboxInit",myBox] call BIS_fnc_arsenal;' into an init.sqf, then I put "this addAction["init.sqf"]" on the box, nothing happened. Please, I NEED a step by step. That page you linked just tells me the text, not where to put it or how to implement it.

The page may be fine for you because you understand this better than me, but it does not tell enough for me.

EDIT: Figured it out by dissecting the Addaction script given in the VAS mod:

I made a "arsenalbox.sqf" file in my mission folder, pasted ["Open",true] call BIS_fnc_arsenal; into that file

Then I put "this addAction["<t color=#ff1111'>Arsenal Box</t>", "arsenalbox.sqf]" into the init field of the ammo box in the mission. Thanks for the help.

Edited by FrankDaTank1218

Share this post


Link to post
Share on other sites

Alright I will try to do a step by step someone please correct me if anything is wrong.

1. Create a text file called VABoxinit.sqf in your mission folder

2. In VABoxinit.sqf put

["Open",true] call BIS_fnc_arsenal;

3. Now place down the object you want people to interact with and in the Name field type VABox1

4. Create another text file in your mission folder called init.sqf

5. In init.sqf type

VABox1 addaction ["Open Virtual Arsenal", "VABoxinit.sqf"];

6. Save your mission to apply the new .sqf files and run

You now have a Virtual Arsenal with every item in your mission, I'm not an expert scripter so I'm not entirely certain how this will acting in terms of locality and JIP players.

Here is the mission I made using that step by step.

Google Drive

Just Download unzip and put the VABox_Test.VR folder in your editor mission directory.

Edited by PenguinInATuxedo
  • Thanks 1

Share this post


Link to post
Share on other sites

No need to complicate things too much. In order to add a box with everything available, simply put the following code to init field of the box:

["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;

As mentioned, more info can be found on Biki: https://community.bistudio.com/wiki/Arsenal

  • Like 4

Share this post


Link to post
Share on other sites
No need to complicate things too much. In order to add a box with everything available, simply put the following code to init field of the box:

["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;

As mentioned, more info can be found on Biki: https://community.bistudio.com/wiki/Arsenal

I'm telling you, this didn't work for me.

Share this post


Link to post
Share on other sites
I'm telling you, this didn't work for me.

Working fine here, just copy-pasted the line into the init field.

Even works on vehicles...

dkbJzSs.jpg

Share this post


Link to post
Share on other sites
Alright I will try to do a step by step someone please correct me if anything is wrong.

1. Create a text file called VABoxinit.sqf in your mission folder

2. In VABoxinit.sqf put

["Open",true] call BIS_fnc_arsenal;

3. Now place down the object you want people to interact with and in the Name field type VABox1

4. Create another text file in your mission folder called init.sqf

5. In init.sqf type

VABox1 addaction ["Open Virtual Arsenal", "VABoxinit.sqf"];

6. Save your mission to apply the new .sqf files and run

You now have a Virtual Arsenal with every item in your mission, I'm not an expert scripter so I'm not entirely certain how this will acting in terms of locality and JIP players.

Here is the mission I made using that step by step.

Google Drive

Just Download unzip and put the VABox_Test.VR folder in your editor mission directory.

tested your mission and noting worked so i put ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; in the init field of the object and it worked

Share this post


Link to post
Share on other sites

why wouldn't you do instead something like

this addaction ["Open Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }];

but anyway on the other hand doing the way that Moricky said does the same thing xD

Share this post


Link to post
Share on other sites
tested your mission and noting worked so i put ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; in the init field of the object and it worked

Strange I used that exact mission in editor and it worked fine, but maybe you should look at the way moricky and lala has done it, they seem to be more efficient.

Share this post


Link to post
Share on other sites

Looking great! But I noticed something. When I tried using

["AmmoboxInit",[supplies,false]] call BIS_fnc_arsenal;

or

["AmmoboxInit",supplies] call BIS_fnc_arsenal;

it wouldn't work - no Arsenal action appeared. Optional boolean for parameter 1 had to be true. That, or I misunderstood the goal of that boolean. But it's okay, since it's just a matter of using the removal functions later:

[supplies,["%ALL"],true] call BIS_fnc_removeVirtualItemCargo;

EDIT:

Well, but I missed this:

[supplies,["arifle_MX_F","arifle_MX_SW_F","arifle_MXC_F"],true] call BIS_fnc_addVirtualWeaponCargo;

Didn't realize at first you didn't really need to run BIS_fnc_arsenal.

Edited by rakowozz

Share this post


Link to post
Share on other sites

Has anybody noticed that BIS_fnc_arsenal is actually missing (loads of) items? Even if you add them in a custom script?

Share this post


Link to post
Share on other sites
Has anybody noticed that BIS_fnc_arsenal is actually missing (loads of) items? Even if you add them in a custom script?

If you are referring to the inability to add many items to inventory ei suppressors,nvgs and mags not for current weapon then yes.

Share this post


Link to post
Share on other sites

I don't get it Morricky, I think I'm mentally handicapped lol, your code works now. IDK what was wrong.

Share this post


Link to post
Share on other sites

I placed "["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;" in the init field of an ammobox and it works in Editor Preview. When I save/load the mission in Local Multiplayer, it does not work. If I go back to the Editor and Preview, it works. Anyone else with having this issue?

The missions have nothing more than playable units, a respawn marker, and a crate with Virtual Arsenal access called in its init field. The purpose is to use MCC/Zeus to build missions on the fly so no other assets have been loaded.

The kicker here is that there is a single mission where Virtual Arsenal works in Local Multiplayer, and that is a simple firing range I built. Prior to Virtual Arsenal, I had Tonic's VAS attached to two crates at either end of the firing line. To test Arsenal versus VAS, I called Arsenal in one crate and left the other with VAS. This mission works fine both in the Editor Preview and in Local Multiplayer, but I can load up another mission with only Arsenal called on a crate and Arsenal will not function.

Edit: I tried the missions I've been having trouble with on my own dedicated server (same pc as client) and Arsenal works fine. It seems it only does not want to work in local multiplayer loaded through the client for me.

Edited by vagrantauthor
New Info

Share this post


Link to post
Share on other sites

Thanks got this to work, However, im surprised there's no simple "faction" setting, to whitelist certain factions weapons , ie WEST,EAST,CIV... etc

But thanks anyways its a neat feature.

Share this post


Link to post
Share on other sites
Thanks got this to work, However, im surprised there's no simple "faction" setting, to whitelist certain factions weapons , ie WEST,EAST,CIV... etc

But thanks anyways its a neat feature.

They just added a module for Virtual Ammobox on dev branch maybe it has fields for things like factions and item class name restrictions.

Share this post


Link to post
Share on other sites

I'm using:

["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;

Occasionally it does not add the action. Also, not all items appear - got some missing weapons from what I can see.

Share this post


Link to post
Share on other sites

Arsenal is also missing MICH (Camo), MICH2 (Camo) that AAF grenadier and Autorifleman are wearing and other items like some booniehats.

Share this post


Link to post
Share on other sites
Arsenal is also missing MICH (Camo), MICH2 (Camo) that AAF grenadier and Autorifleman are wearing and other items like some booniehats.

I'm not noticing anything really missing...it's mostly just sorting through the different menus and only being shown what's applicable to the weapons you're carrying. The only limitation I've had issues with is not being able to add extra scopes/attachments directly to your backpack or vest.

Share this post


Link to post
Share on other sites

Is it possible to import classes from VAS into the Arsenal?

(if) How do i do it?

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

×