7erra 629 Posted October 5, 2018 (edited) VASS - Virtual Arsenal Shop System Introduction VASS provides a simple to setup shop system and is the successor to the Arsenal Shop. The system provides several functions to handle traders and items. As of now it does not come bundled with an economy system but the implementation of an external one is easily possible. Setup Enable system: Download the GitHub repo: https://github.com/7erra/VASS-Virtual-Arsenal-Shop-System Check the example mission (Mission.VR) Copy the VASS folder to your mission Add the lines from the description.ext Add trader: Execute the addShop function: [this] call TER_fnc_addShop Add an inventory with the addShopCargo function: [this, ["itemclass0", 15, 5, ..., "itemClassN", price, amount]] call TER_fnc_addShopCargo For easier setup of this cost table I have created a mod that does this task with a user interface: https://steamcommunity.com/sharedfiles/filedetails/?id=1760193128. The settings can be changed by opening the object's attribute window and scrolling down to the "VASS" section. Handle money: Edit the TER_fnc_VASShandler in "VASS\fnc\fn_VASShandler.sqf" Change the getMoney and setMoney functions to match your economy system Documentation GitHub will have a wiki on all aspects of the system. In addition to that all relevant functions have a header at the beggining of the file to show you what arguments they expect and what they do. Further links GitHub: https://github.com/7erra/VASS-Virtual-Arsenal-Shop-System VASS 3den mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1760193128 BI forums: https://forums.bohemia.net/forums/topic/219677-release-virtual-arsenal-shop-system/ Screenshots That's all for now and I hope that you find this useful! 7erra DISCLAIMER - This post was edited nearly a year after the original post. Don't expect comments from the previous discussion (up until page 5) to be applicable to the new system Edited October 6, 2021 by 7erra Updated for v2.1.0 16 6 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 5, 2018 This is Great ! Congratulations and thanks 7erra ! I will ask if it is possible to edit this , or make an edit for Ravage ? Since this script , will be very helpful ! Thanks again ! Share this post Link to post Share on other sites
7erra 629 Posted October 5, 2018 1 hour ago, GEORGE FLOROS GR said: I will ask if it is possible to edit this , or make an edit for Ravage ? I have never worked with Ravage before so I'm not familliar with the currency system and the shop system. I will take a look though :) 1 Share this post Link to post Share on other sites
gc8 977 Posted October 5, 2018 This is great script just what I needed for my new project. Thanks 7erra! Question, can you sell items? 1 Share this post Link to post Share on other sites
7erra 629 Posted October 5, 2018 9 minutes ago, gc8 said: Question, can you sell items? Not yet. I'm was running into a problem but I might have a lead now. The next update should fix this. 1 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 5, 2018 4 hours ago, 7erra said: Ravage Thank you very much 7erra ! If you have more news it would be good to make a post also to ravage topic , there are a lot of followers there , who would like this feature ! Share this post Link to post Share on other sites
accuracythruvolume 547 Posted October 6, 2018 Can you setup multiple shops? Like one shop for clothing and another for weapons, and so on? 3 Share this post Link to post Share on other sites
7erra 629 Posted October 6, 2018 Sure. You can use the BIS_fnc_addVirtualXXXCargo commands to add specific items to an arsenal. The shop system applies to any Arsenal that is opened. I will modify the addArsenal function so you can add specific items/types and put it in the next update which will also add the possibilty to sell items @gc8 ;) Thanks for the ideas 1 1 Share this post Link to post Share on other sites
7erra 629 Posted October 6, 2018 Updated the repository. Changes are in the first post. @gc8 @accuracythruvolume 1 Share this post Link to post Share on other sites
gc8 977 Posted October 6, 2018 @7erra Just tested it, works great! Share this post Link to post Share on other sites
Davinel 0 Posted October 7, 2018 Hi little question , i'm working on a mission i would like to add money when i kill somoene how can i add money from kill ? (i will out the command in the init of the ennemy) thanks for your help and sorry for my english Share this post Link to post Share on other sites
KokaKolaA3 394 Posted October 7, 2018 11 minutes ago, Davinel said: Hi little question , i'm working on a mission i would like to add money when i kill somoene how can i add money from kill ? (i will out the command in the init of the ennemy) thanks for your help and sorry for my english Try this: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _killer setVariable ["TER_money",1000]; _killer hint "You recieved 1000$"; }]; Note that this code has to be put in the unit which will be killed, if you let players fight AI, then put this into the AI, if it's PvP then put it in every players init. 1 Share this post Link to post Share on other sites
Davinel 0 Posted October 7, 2018 18 minutes ago, KokaKolaA3 said: Try this: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _killer setVariable ["TER_money",1000]; _killer hint "You recieved 1000$"; }]; Note that this code has to be put in the unit which will be killed, if you let players fight AI, then put this into the AI, if it's PvP then put it in every players init. it work thank you but it change the value and not add value to the current variable. i try to figure it how to add value to the variable Share this post Link to post Share on other sites
KokaKolaA3 394 Posted October 7, 2018 10 minutes ago, Davinel said: it work thank you but it change the value and not add value to the current variable. i try to figure it how to add value to the variable Hm, right. I'm not good at scripting, so this may not work or may not be the easiest way, but try this: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _money = _killer getVariable ["TER_money"]; _money + 500; _killer setVariable ["TER_money", _money]; _killer hint "You recieved 500$"; }]; Share this post Link to post Share on other sites
7erra 629 Posted October 7, 2018 1 hour ago, KokaKolaA3 said: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _money = _killer getVariable ["TER_money"]; _money + 500; _killer setVariable ["TER_money", _money]; _killer hint "You recieved 500$"; }]; Eh close enough: this addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0) _money = _money + 500;//add kill reward _killer setVariable [TER_moneyVariable, _money]; "You received 500$" remoteExec ["hint",_killer];// execute code local on the pc of the killer }]; 2 Share this post Link to post Share on other sites
7erra 629 Posted October 7, 2018 Just released another update: v1.2 - Better refunding Refunding of items in containers (uniform, vest, backpack) Selecting a new weapon won't add 4 free magazines, neither does removing a weapon delete the compatible mags I finally got a grasp of how the default Arsenal handles it's stuff (the script is 3206 lines long ) so future editing should be easier. 1 2 Share this post Link to post Share on other sites
accuracythruvolume 547 Posted October 9, 2018 Actually you can just do something like this: in initServer.sqf: #include "scripts\fnc_BountyPayout.sqf" with fnc_BountyPayout.sqf being: fnc_BountyPayout = addMissionEventHandler ["EntityKilled", { _killed = _this select 0; _killer = _this select 1; _killedSide = (side group _killed); _killedFaction = faction _killed; if (_killedSide == resistance) then { if (isplayer _killer) then { _money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0) _money = _money + 500;//add kill reward _killer setVariable [TER_moneyVariable, _money]; }; }; if (_killedSide == east) then { if (isplayer _killer) then { _money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0) _money = _money + 500;//add kill reward _killer setVariable [TER_moneyVariable, _money]; }; }; if (_killedSide == civilian) then { if (isplayer _killer) then { 0 = [_killer] execVM "scripts\fnc_CivilianKilledPenalty.sqf"; }; }; // Player death if (_killedSide == west) then { if (isplayer _killed) then { }; }; }]; You could even expand this into certain vehicles. Say you have a array of Jeep classnames... { if (typeOf _killed == _x) then { _money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0) _money = _money + 500;//add kill reward _killer setVariable [TER_moneyVariable, _money]; }; } forEach Jeeps; Or even specify infantry classnames if you like..... sidebar over 1 Share this post Link to post Share on other sites
accuracythruvolume 547 Posted October 9, 2018 7erra, Is there a way to disable the loading of saved loadouts with this script? That way peeps can't hack in stuff. In other words, does this overwrite any arsenal that a player may access? (like with personal arsenal) Share this post Link to post Share on other sites
7erra 629 Posted October 9, 2018 58 minutes ago, accuracythruvolume said: Is there a way to disable the loading of saved loadouts with this script? That way peeps can't hack in stuff. In other words, does this overwrite any arsenal that a player may access? (like with personal arsenal) I disabled all controls which could get you items for free. The script is run EVERY time an Arsenal is opened, regardless of the circumstances. Therefore there is no way to circumvent the system (at least that I know of). I already have some other possible exploits in mind which I'll try to fix. On that note: I intend to make the whole system safer in a future update. Atm I went for an easy setup for small groups who want to play fair. 1 Share this post Link to post Share on other sites
accuracythruvolume 547 Posted October 10, 2018 Very nice! Share this post Link to post Share on other sites
7erra 629 Posted October 10, 2018 Update v1.3 - Safety and UI All right the system is now in a state which I'd call finished. I fixed some minor bugs and added everything that I could think of. Of course I tested the new version but if there are any bugs then please report them. All changes can be found in the original post. The picture is up-to-date. 7erra Spoiler PS: Try out the black beret in the arsenal 1 1 Share this post Link to post Share on other sites
accuracythruvolume 547 Posted October 11, 2018 Changelog in OP still stops at 1.2 Share this post Link to post Share on other sites
atmo 29 Posted October 11, 2018 @7erra This is great, well done. Exactly what I was looking for. Atmo Share this post Link to post Share on other sites
7erra 629 Posted October 11, 2018 16 hours ago, accuracythruvolume said: Changelog in OP still stops at 1.2 You sure? It says 1.3 in my browser? Cheers! Share this post Link to post Share on other sites
7erra 629 Posted October 14, 2018 Update v1.4 - cfgFunctions Developement still continues as I notice quirks and errors unintended features. The changelog in the orignial post is up-to-date. 7erra 1 1 Share this post Link to post Share on other sites