Jump to content
7erra

[Release] Virtual Arsenal Shop System

Recommended Posts

you think I mean my script from 18.12.2018.

 

If you open directly the virtual arsenal, the shop does not work correctly.

 

I have this in the init from one Amo Box:

[this] call TER_fnc_addArsenal;

 

Share this post


Link to post
Share on other sites

Well i have encounter more problems in MP.

The biggest one is that from unknown reason the variable TER_moneyNamespace is no longer linked to player but its model p3d file.

Share this post


Link to post
Share on other sites

how is it possible to give players Magazines automatically, like in the default Arsenal, and them to the Buy list?

Share this post


Link to post
Share on other sites

@7errathis is great! I would be very interested to use it in my own A3Wasteland verdict. Could you tell me if this works with the A3W monetary system or otherwise, in what way could it work?

Share this post


Link to post
Share on other sites

Hi. I added this list and see it all on the host or in the editor. BUT

 

 


_costArray = [// add your entries in the format >"classname",cost<
///////////цирус
    "srifle_DMR_05_hex_F",700,
    "srifle_DMR_05_tan_f",700,
    "srifle_DMR_05_blk_F",700,
    "10Rnd_93x64_DMR_05_Mag",100,
///////////асп1
    "srifle_DMR_04_Tan_F",700,
    "srifle_DMR_04_F",700,
    "10Rnd_127x54_Mag",100,
///////////мар10    
    "srifle_DMR_02_camo_F",700,
    "srifle_DMR_02_sniper_F",700,
    "srifle_DMR_02_F",700,
    "10Rnd_338_Mag",100,
///////////мк14
    "srifle_DMR_06_olive_F",500,
    "srifle_DMR_06_camo_F",500,
    "20Rnd_762x51_Mag",50,
    "muzzle_snds_B",100,
    "muzzle_snds_B_snd_F",100,
    "muzzle_snds_B_khk_F",100,
//---------------------- NOT HAVE on dedicate server
    "MMG_01_hex_F",1000,
    "MMG_01_tan_F",1000,

    "150Rnd_93x64_Mag",200,
    "muzzle_snds_93mmg_tan",100,
    "muzzle_snds_93mmg",100,

    "MMG_02_camo_F",1000,
    "MMG_02_sand_F",1000,
    "MMG_02_black_F",100,
 
   "130Rnd_338_Mag",200,
    "muzzle_snds_338_green",100,
    "muzzle_snds_338_sand",100,
    "muzzle_snds_338_black",100,

    "LMG_03_F",1500,
 
   "200Rnd_556x45_Box_F",200,
    "muzzle_snds_H_MG",100,
    "muzzle_snds_H_MG_blk_F",200,
    "muzzle_snds_M",100,
    "muzzle_snds_m_snd_F",100,
    "muzzle_snds_m_khk_F",100,
    "muzzle_snds_H_MG_khk_F",100,    
//////////глуш
    "acc_flashlight",100,
    "muzzle_snds_570",200,
    "muzzle_snds_58_hex_F",200,
    "muzzle_snds_58_ghex_F",200,
    "muzzle_snds_58_blk_F",200,
    "150Rnd_556x45_Drum_Mag_F",200, //барабан
///////рюкзак
    "B_Bergen_mcamo_F",500,
    "B_Bergen_hex_F",500,
    "B_Bergen_tna_F",500,
    "B_Bergen_dgtl_F",500,
    
  "SLAMDirectionalMine_Wire_Mag",200,
  "ATMine_Range_Mag",200,
  "APERSBoundingMine_Range_Mag",200,
  "APERSMineDispenser_Mag",200,
  "APERSTripMine_Wire_Mag",200
    
];

 


BUT on dedicate server does not show machine guns that are highlighted. Why? (these are machine guns "navid", "spmg", "lim85").  Magazines, other weapons, mines (corrected as written by the person above) - everything shows.

Share this post


Link to post
Share on other sites

I do not knew any solution for this  but if you look closer you will find that there are more stuff being missed in MP.

and i found other problems with which has push me to create my own trade system

Share this post


Link to post
Share on other sites

Hi, I'm creating open-world SP-mission which would be relaying on this awesome script but there's a couple of challenges on the way.

 

1. Many CfgFunctions at description.ext -> problems

 

When I tested the script on simple null mission plate it worked perfectly. However in the mission I'm creating there's also HLF UnitCapture-script also used and that is activated also by using CfgFunctions at Description.ext so my description.ext currently looks like this:

 

Quote

class CfgFunctions
{
    #include "arsenalShop\cfgFunctions.hpp"

    #include "functions1.hpp" // HLF UnitCapture, works perfectly this way, no need to worry about it
    
};

 

But in-game when I start the mission I get following error-notification

Quote

'...ms ["_typeInit",["_didJIP",true]];

 

if (|#|_typeInit == "postInit") exitWith {

TER_...'

Error Undefined variable in expression: _typeinit

File missions\Unluckymission.map\arsenalShop\config.sqf, line 3

 

The arsenal shop opens up like expected but trying to add money with example command:

Unlucky setVariable ["TER_money",300];

Won't work and thus player is unable to buy anything from the Arsenal Shop.

 

Of course other problems might rise currently that I'm not aware of but I don't know how I should handle many CfgFunctions same time, given the fact that one of them works fine. 🤔

 

2. How add money cumulatively?

The above mentioned setVariable is a good way to set specific amount of money for player but how you are supposed to add more money into player's pocket? Some above conversations in this topic have examples how to get money from killing enemies but what if I'm looking to add money in script for example after player completes a side quest that might not involve killing enemy forces at all? addVariable code doesn't exist according to my poor coding knowledge.

 

3. Anyway for player to check how much money he currently have/ have trigger execute once player have enough money?

This is the smallest problem of all three as failing to do so wouldn't stop mission to be creatable by me but it definitly would help out if player can check through radio repeatably how much money he have and if I have objective for player like "Collect 2000 dollars to buy the house" then I would need some way that trigger detects when player have enough money for that.

 

 

Thanks for the possible replies in advance! 😊

 

- Unluckymonster

Share this post


Link to post
Share on other sites

@Unluckymonster Im getting started in the use of scripts and programing in general but i figured out something by reading other coments that works for me.

 

Quote

init:

 

money = player getVariable [TER_moneyVariable,0]; 
money = money + 500
player setVariable [TER_moneyVariable, money];

 

Every time is triggerd it will add 500$ to the player.

(Note: I only tested on SP surely wont work in MP)

Hope was usefull.

  • Like 1

Share this post


Link to post
Share on other sites

Wow, thx @ixaak  , didn't expect anyone to reply so thank you very much. One step closer to victory with my challenges 😉

Share this post


Link to post
Share on other sites

Hey guys i saw a post a wile ago talking about giving money to the player for kills. anything we can do for MP dedi-servers for killing enemy and deducting money for civilian kills? 

Share this post


Link to post
Share on other sites
22 hours ago, Nicholas Lendall said:

Hey guys i saw a post a wile ago talking about giving money to the player for kills. anything we can do for MP dedi-servers for killing enemy and deducting money for civilian kills? 

On the first page of this thread @7erra post more or less what you are asking, I leave it here for you.

 

SQF:

Quote

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

}];

Then u can just edit it the way u want, check also the first page for more info about this.

Share this post


Link to post
Share on other sites

Just so you know I am reading all of the comments but development has been laid off cause I've been working on another project and been busy. Getting back into the code will take some time so thanks for the kind words and sorry for the lack of support 😉 

 

7 minutes ago, ixaak said:

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

}];

 

3 minutes ago, Nicholas Lendall said:

also put this in the init.sqf or initplayer.sqf?

This is meant for the init field of a unit which is going to be killed. The system doesn't support a complete money system as of now. There are other systems which can be used in conjunction with VASS.

 

6 minutes ago, Nicholas Lendall said:

you thinking of making a Vehicle shop soon? so that way we can have a full store and money system?!?!

Have thought about it but first comes fixing bugs and making the code cleaner 🙂 Using the Virtual Garage for that purpose might be viable 🤔

 

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

Oh ok i was trying to figure out a system for killing enemy and getting payed for it also capturing money stashes/gold and selling them to a store then being able to buy vehicles and gear kinda like a wasteland/RP style i just dont know enough about C++ to do any of this shit lol. I see a ton of post about a system like that but nothing has come of it. i would make the MSO/Insurgency missions way better making you pick up enemy's weapons and retrieving gear. finding a SAM site and gettting big $$ for selling the vehicle. but ok ill wait and keep trying to learn it and maby just maby be ready for Arma 8 lmfao

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Nicholas Lendall said:

also what systems work with your VASS? for what im taking about?

The money is only stored as a variable on the the player. Some sqf knowledge would be neccessary to adjust it for your needs. I actually expected that there would be a simple money system somewhere but a quick google search didnt yield any formidable results...

If you want to reward the player for killing enemies you can take a look at the onEntityKilled mission eventhandler. There should be some threads on the forum already explaining it in detail.

  • Like 2

Share this post


Link to post
Share on other sites

ok ill check it out thanks dude i appreciate it bro this is something the community needs and in a standalone mod for mission makers like me lol 

Share this post


Link to post
Share on other sites
20 hours ago, 7erra said:

Just so you know I am reading all of the comments but development has been laid off cause I've been working on another project and been busy. Getting back into the code will take some time so thanks for the kind words and sorry for the lack of support 😉

 

Hey no problem sir, my own mission was on hold due the inflammatory bowel disease and what else things, we are humans after all.

 

But returning to the subject as I asked earlier is there "Anyway for player to check how much money he currently have/ have trigger execute once player have enough money?" other than checking in the store or is this planned feature on future update(s)?

Share this post


Link to post
Share on other sites
13 minutes ago, Unluckymonster said:

But returning to the subject as I asked earlier is there "Anyway for player to check how much money he currently have/ have trigger execute once player have enough money?

 

in config.sqf you can set which variable name (and nameSpace) is used for the amount of money a player has. you can easily use it to inform the players in your mission about their balance.

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Unluckymonster said:

But returning to the subject as I asked earlier is there "Anyway for player to check how much money he currently have/ have trigger execute once player have enough money?" other than checking in the store or is this planned feature on future update(s)?

moneyCheck = player getVariable [TER_moneyVariable,0];  
hint format ["Current money: %1 %2 ",moneyCheck, TER_moneyUnit];

The moneyCheck variable will get the amount of money that the player have at the moment, and in the Hint you just call two variables; the amount of money and the money unit.($)

 

This will do the trick. 😄

 

P.D. 

 

You can also make the variable moneyCheck private (_moneyCheck), this willmake variables only visible in a specific script, or function, or Control Structures.

  • Like 3

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

×