Jump to content
Sign in to follow this  
legio4777

Spawn ammo box with VAS

Recommended Posts

Hi,

I want to spawn an ammo box, but wiht the functionality of the VAS included.

Does any one know how to include it???? Has anyone any example???

For multiplayer

Thanks in advance

Share this post


Link to post
Share on other sites
Hi,

I want to spawn an ammo box, but wiht the functionality of the VAS included.

Does any one know how to include it???? Has anyone any example???

For multiplayer

Thanks in advance

Ok so you first must save the mission from the editor

then navigate to "My Documents" then into ArmA 3 - Other Profiles then "Your Username for ArmA 3" then "missions" then "the name that you save your mission"

once there create a file and call it "Description.ext" and place inside of it

#include "VAS\menu.hpp"
class CfgFunctions
{
#include "VAS\cfgfunctions.hpp"
};

next download VAS and then open it and Navigate Virtual Ammobox System >> scripts >> Copy "VAS" and "stringtable.xml" into "your mission name"

after this go back into the editor open up the mission and place down a player

after the player is placed go ahead and go Empty >> Ammo >> "what ever ammo box you want" and then before you hit ok place in the init:

this addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"];

Share this post


Link to post
Share on other sites

You want it to be in a mission, or you want to spawn it in the middle of a mission? Not quite sure what you're thinking of.

Share this post


Link to post
Share on other sites

Hi,

thanks I should explain it better.

In a mission I want to create a guy, like an armory guy, once near him thru an addaction to spawn an ammo box with the VAS functionality

I hope this be clear enough

Share this post


Link to post
Share on other sites

If you are spawning it via a debug console then just run the syntax in the init field of the item.

Use the same code you do to place it on the map in the editor.

this addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"];

If you could explain how you are spawning the boxes that would help,, and which console you are using.

I use the fhq_console when mission building,, who knows it might help you too.

Share this post


Link to post
Share on other sites

the thing is I dont know so much about scripting.

Do you have an .sqf to generate the ammo box in mission? to after that once the ammo box is generated attach the VAS functionality

Share this post


Link to post
Share on other sites

You don't need an .sqf script to spawn an ammobox with VAS.

You can do it in a trigger.

ACTIVATION: BLUFOR

Once

Present

Condition this

On ACT:

VasBox = createVehicle ["B_supplyCrate_F", position thisTrigger, [], 0, ""];clearMagazineCargoGlobal VasBox;clearWeaponCargoGlobal VasBox;clearItemCargoGlobal VasBox;clearBackpackCargoGlobal VasBox;VasBox addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"];hint "Spawning VasBox";

If you want to spawn a unit as well, add this to the end

[getPos thisTrigger, WEST, ["B_Soldier_A_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;

Of course you'll have to had #include VAS setups in the description.txt

Share this post


Link to post
Share on other sites

Note: You don't have to use a trigger either, marker/object/position will work fine as well.

Examples:

VAS_Box = "B_supplyCrate_F" createVehicle (getMarkerPos "MarkerName");
VAS_Box = "O_supplyCrate_F" createVehicle (getPos ObjectName);
VAS_Box = "I_supplyCrate_F" createVehicle [0,0,0]; // Bottom left corner of map...
VAS_Box addAction ["<t color='#FFFFFF'>Virtual Ammobox System</t>", "VAS\open.sqf"];

Dirty Haz

Share this post


Link to post
Share on other sites
You don't need an .sqf script to spawn an ammobox with VAS.

You can do it in a trigger.

ACTIVATION: BLUFOR

Once

Present

Condition this

On ACT:

VasBox = createVehicle ["B_supplyCrate_F", position thisTrigger, [], 0, ""];clearMagazineCargoGlobal VasBox;clearWeaponCargoGlobal VasBox;clearItemCargoGlobal VasBox;clearBackpackCargoGlobal VasBox;VasBox addAction["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"];hint "Spawning VasBox";

If you want to spawn a unit as well, add this to the end

[getPos thisTrigger, WEST, ["B_Soldier_A_F"],[],[],[],[],[],0] call BIS_fnc_spawnGroup;

Of course you'll have to had #include VAS setups in the description.txt

thanks man! It works perfectly.

Can I executed like .sqf? it will be great if for instance thru an addaction in the init of a HEMTT truck you can approach to it and make the box out... is possible to do that???

---------- Post added at 09:59 ---------- Previous post was at 09:58 ----------

Note: You don't have to use a trigger either, marker/object/position will work fine as well.

Examples:

VAS_Box = "B_supplyCrate_F" createVehicle (getMarkerPos "MarkerName");
VAS_Box = "O_supplyCrate_F" createVehicle (getPos ObjectName);
VAS_Box = "I_supplyCrate_F" createVehicle [0,0,0]; // Bottom left corner of map...
VAS_Box addAction ["<t color='#FFFFFF'>Virtual Ammobox System</t>", "VAS\open.sqf"];

Dirty Haz

Do you mean like a sqf?

Share this post


Link to post
Share on other sites

Init.sqf:

nul = [] execVM "VAS_Box.sqf";

VAS_Box.sqf:

if (!isServer) exitWith {};
VAS_Box = "B_supplyCrate_F" createVehicle (getMarkerPos "MarkerName");
VAS_Box addAction ["<t color='#FFFFFF'>Virtual Ammobox System</t>", "VAS\open.sqf"];

Dirty Haz

Share this post


Link to post
Share on other sites

Could I execute that in mission? I mean A guy can apporach to an object and obtain it???

Share this post


Link to post
Share on other sites

Yes, you can use what I posted above in your mission or whatever. Just make sure the marker name is correct though. Obtain it? Huh...

Dirty Haz

Share this post


Link to post
Share on other sites

yes I mean, include an addaction to the vehicule init an obtain the ammo vas box, could we?

with this sqf the vas box spwns autamtically, and I want that spawns when the player uses the addaction for instance called resupply, do you know?

Edited by legio4777

Share this post


Link to post
Share on other sites
Init.sqf:

nul = [] execVM "VAS_Box.sqf";

VAS_Box.sqf:

if (!isServer) exitWith {};
VAS_Box = "B_supplyCrate_F" createVehicle (getMarkerPos "MarkerName");
VAS_Box addAction ["<t color='#FFFFFF'>Virtual Ammobox System</t>", "VAS\open.sqf"];

Dirty Haz

Yes. Try it.

Dirty Haz

Share this post


Link to post
Share on other sites
Yes. Try it.

Dirty Haz

Already, with this sqf the vas box spwns autamtically, and I want that spawns when the player uses the addaction for instance called resupply, do you know?

Perhaps Im doing something wrong

---------- Post added at 10:50 ---------- Previous post was at 10:43 ----------

I ve put this in the vehicle init but doesnt work....

VAS_Box addAction ["<t color='#FFFFFF'>Resupply</t>", "VAS_Box.sqf"];

---------- Post added at 10:56 ---------- Previous post was at 10:50 ----------

Done It!!!

This is the right code to put in the init of the vehicle

this addAction["<t color='#ff1111'>Resupply</t>", "VAS_Box.sqf"];

Share this post


Link to post
Share on other sites

Sorry, I think I did not understand you correctly. Glad you got it working! :)

Dirty Haz

Share this post


Link to post
Share on other sites

Hi Dirty,

I´ve been testing the script on a dedicated server and doesn´t work.

It works perfectly on MP but not in dedicated.

Perhaps you can help me again. :-)

I´ve put this in the init of a unit, I want this unit to provide me in mission de VAS box.

this addAction ["<t color='#FFAD1F'>Ammo VAS</t>", "VAS_Box.sqf"]; 

And this is the .sqf we made:

if (!isServer) exitWith {};
VAS_Box = "B_supplyCrate_F" createVehicle (getMarkerPos "MarkerName");
VAS_Box addAction ["<t color='#FFFFFF'>Virtual Ammobox System</t>", "VAS\open.sqf"];

Do you know why doesnt work on a dedicated???

Thanks in advance...

Share this post


Link to post
Share on other sites

a brute force method using bis_fnc_mp:

BIS_fnc_MP can cause performance issues if you are spawning it often, and your mission is expected to run with high traffic for many hours/days. If that isn't an issue, then its probably the easiest/most efficient method of getting what you want to work.

cliffs:

1. create a folder in your main mission directory named "functions".

2. create an SQF file named "fn_vasBoxAction", put that in "functions" folder..

3. in the file "fn_vasBoxAction", paste this: (i know, too tiny to deserve a file but whatever)

this addAction ["<t color=#FFAD1F'>Ammo VAS</t>", "VAS_Box.sqf];

4. copy this to your description.ext, if you dont already have a CfgFunctions in it.

class CfgFunctions {

class legio {

tag = "legio";

class functions {

file "functions";

class vasBoxAction {};

};

};

};

5. now, in your script:

#define BOX_TYPE "B_supplyCrate_F"

_boxPos = getMarkerPos "MarkerName";

_VASbox = createVehicle [bOX_TYPE,_boxPos,[],0,"NONE"];

[_VASbox,"legio_fnc_vasBoxAction",nil,true] spawn BIS_fnc_MP;

6. The B_supplyCrate_F named _VASbox should now have the VAS addAction, available to all players in the server and all players who join the server.

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites

Thanks man. I´ll test it and let you know...

One thing, I dont get the point 5. Do I have to put also my .sqf in the folder "functions" or do I have to leave it outside...

Again thanks

---------- Post added at 12:12 ---------- Previous post was at 11:51 ----------

The description is giving me an error take my out of teh game, I have the following regarding the class CfgFunctions:

class CfgFunctions
{
class legio 
{
	tag = "legio";	
	class functions {
	file "functions";		
	class vasBoxAction {};
};
#include "VAS\cfgfunctions.hpp";
};

Share this post


Link to post
Share on other sites

Looks like you're missing a };

class CfgFunctions {

#include "VAS\cfgfunctions.hpp";

class legio {

tag = "legio";

class functions {

file "functions";

class vasBoxAction {};

};

};

};

Try that

Put the file "fn_vasBoxAction.sqf" inside the folder "functions".

Share this post


Link to post
Share on other sites

Again takes me out:

It sais:

description.ext, line 159: Cfg Functions: ´;´ encountered instead of ´=´

line 159 it is refered to, in this case the sentence #include "VAS\cfgfunctions.hpp";

Share this post


Link to post
Share on other sites
Again takes me out:

It sais:

description.ext, line 159: Cfg Functions: ´;´ encountered instead of ´=´

line 159 it is refered to, in this case the sentence #include "VAS\cfgfunctions.hpp";

remove the ; from the end of line 159 you should be OK

Share this post


Link to post
Share on other sites

Yep, sorry an error on my part.

should be:

#include "VAS\cfgfunctions.hpp"

should not be a ;

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  

×