Jump to content
Sign in to follow this  
Fr33d0m

TMN Defense Budget System

Recommended Posts

Last Script Update: 6/4/2014

http://www.mediusgaming.com/Budget%20Script%202.0.zip

Screenshot 1:

www.mediusgaming.com/BudgetV2.jpg

TMN Defense Budget Script 2.0 - By TMN Fr33d0m

(Demo Mission Included)

If you've ever wanted to make equipment and vehicles have VALUE, instead of respawning endless gear with no real loss attached, this is the script for you!

The TMN Defense Budget Modification allows mission makers to introduce a managed defense budget into their missions, utilizing a snazzy new GUI to track budget, total war cost, current rank and rating, access VAS and buy vehicles, aircraft and armor.

Constructed as a bigger sister program to the Action-Menu powered TMN Defense Budget System V 1.5, The TMN Defense Budget Modification is lighter, faster and prettier than it's smaller counterpart! Both pieces of software will be maintained separately, as this version is a different animal from a programming perspective, a bit more difficult to modify and does not support FIA faction.

FEATURES:

Toggle-Enabled Built in UP Armored Humvee Support (I like that mod!) (Toggle in script, off by default).

NATO, AAF and CSAT support.

VAS Support (Best if used with VAS, pay for access to VAS!!)

Buy vehicles, Aircraft and Armor, reward missions completed with money!

Meritocracy System- Ability to purchase based on player rating. Team killing or Civ killing = No buying things!! Enemy kills and objectives complete = more rating points = ability to buy bigger ticket items!

Big ticket items locked to rank of Major by default. Gives a clan leader control of the budget for big ticket purchases!

Ability for Major to allow temporary VAS access for all players. Outfit your team before going into battle!

Snazzy video & awesome subtle background music at GUI.

Built to tinker - Well explained, well designed scripts allow for a novice to intermediate mission editor to customize a store by adding or removing entries! Copy, Paste and Edit!

Default monetary values of all purchasable items modeled off real world counterparts. A M2A1 is 6 million dollars, for example.

INSTRUCTIONS:

Drag and drop ALL FILES into your mission folder (The one accessed by the 2D editor).

Exclude the example mission folder (obviously).

Copy the contents of the Description.ext to your mission's Description.ext.

Note: This thing is designed to work with Tonic's VAS.

UNIT INIT ENTRIES: You can paste this into the INIT of anything, a computer, a person, a vehicle, whatever for the corresponding side you wish to access via this terminal.

+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+. IN THE ARMA 3 2D MISSION EDITOR: +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+

For BLUFOR side, in 2D EDITOR:

Blufor:

this addAction ["NATO Budget Interface", "scripts\B_economy.sqf"];

Add corresponding INIT entry above to whatever you want. Remember to setDamage false!! or when it dies, no more economy access!! (Unless this is a DESIRED effect).

Place 3 "empty" markers. Name them:

vehspawn

airspawn

chspawn

These markers are where the stuff will spawn when you buy it. Make sure there isn't anything in the way that might make it explode. Rocks for example.

Place at least one playable unit with rank of MAJOR (Can buy big ticket items, should probably be a slot for your clan leader or something).

How to Award Money:

When a mission is completed, use

B_defensebudget= (B_defensebudget+150000); publicVariable "B_DefenseBudget";

change the number as needed for what you want to reward for the task. You can do this in a trigger activated field or in the setTaskState block, amongst many other places.

+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.

For OPFOR side, in 2D EDITOR:

Opfor:

this addAction ["CSAT Budget Interface", "scripts\O_economy.sqf"];

Add corresponding INIT entry above to whatever you want. Remember to setDamage false!! or when it dies, no more economy access!! (Unless this is a DESIRED effect).

Place 3 markers. Name them:

O_vehspawn

O_airspawn

O_chspawn

These markers are where the stuff will spawn when you buy it. Make sure there isn't anything in the way that might make it explode. Rocks for example.

Place at least one playable unit with rank of MAJOR (Can buy big ticket items, should probably be a slot for your clan leader or something).

How to Award Money:

When a mission is completed, use

O_defensebudget= (O_defensebudget+150000); publicVariable "O_DefenseBudget";

change the number as needed for what you want to reward for the task. You can do this in a trigger activated field or in the setTaskState block, amongst many other places.

+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.

For INDFOR side, in 2D EDITOR:

Independent:

this addAction ["AAF Budget Interface", "scripts\I_economy.sqf"];

Add corresponding INIT entry above to whatever you want. Remember to setDamage false!! or when it dies, no more economy access!! (Unless this is a DESIRED effect).

Place 3 markers. Name them:

I_vehspawn

I_airspawn

I_chspawn

These markers are where the stuff will spawn when you buy it. Make sure there isn't anything in the way that might make it explode. Rocks for example.

How to Award Money:

When a mission is completed, use

I_defensebudget= (I_defensebudget+150000); publicVariable "I_DefenseBudget";

change the number as needed for what you want to reward for the task. You can do this in a trigger activated field or in the setTaskState block, amongst many other places.

License:

You may use and alter this script, but you may not redistribute. You may distribute this script as a part of your mission, with proper credits given.

Arma 3 Defense Budget Script 2.0 AKA TMN Economy Script 2.0 by:

TMN Fr33d0m

Co Dev - Corello

www.mediusgaming.com (The Medius Network)

All Right Reserved

For Information and Inquiries: admin@tmnclan.com

Edited by Fr33d0m
UPDATES!!

Share this post


Link to post
Share on other sites

Nice, but I think it belongs in the USER MISSIONS section since it technically isnt an addon.

Share this post


Link to post
Share on other sites

Yeah, I had that dilemma myself. It isnt really a mission either :-\ which is why I didn't post it there. It can be moved wherever the mods see fit, I have no objections. Whatever is helpful.

Share this post


Link to post
Share on other sites

An idea, have you ever thought of integrating the cost of building defence systems & FOBs into the budget? I once saw a mission script that gave players the ability to build bases. The better/bigger they are, the more expensive. I just thought that your script + the base building script combined might give a more immerse experience to those seeking persistent and progressive gameplay. Plus it would also give supply trucks a new job in the game - bringing in the equipment + parts to supply the soldiers and build FOBs.

Share this post


Link to post
Share on other sites

I am actually experimenting with such a thing now, basically atm it's an MHQ type situation, using a truck (Currently a HEMTT Box) that gives you a fast travel to FOB option and a lot of FOB building options, including the option to purchase an AI guard detail at a FOB using BIS_fnc_taskDefend. Also can buy Large and Small bunkers, sandbags, flags, fire barrels, and an assortment of other base building supplies. As it's currently in development, things are always subject to change, but for now that's how it's shaping up. Also looking into attaching a restricted ZEUS module into the mix for FOB building, but so far haven't been very successful. Also, the idea isn't very popular amongst my peers.

Logistics are an interesting mix, and something we (the guys I play ARMA with) deploy on our server locally, but we rely on the =BTC= logistics script to get the job done ATM. I can DEFINITELY produce a version that is meant to work with =BTC= or another logistics script, but need to consider 3rd party permissions first.

Thanks for the suggestion!!! Glad to hear we're on the right track with our next iteration, and hope to bring it to you soon!!

---------- Post added at 02:37 ---------- Previous post was at 02:19 ----------

Alternately, for a fix NOW to use with whatever cargo script you wanna use, do something like this:

where the B_economy script says what I show below, add a value as I have shown (last line at the bottom)

//Monetary Costs of things:

Bvascost= 10000;

Bsupplycrate= 500;

Bammocrate= 750;

HunterUnarmed= 470000;

HunterHMG= 500000;

HunterGMG= 520000;

HEMTTcov= 125000;

HEMTTopn= 90000;

BATV= 7500;

M2A1= 6000000;

Sandstorm= 2410000;

AMV7 = 3150000;

IFV6c= 3000000;

IFV6a= 3800000;

AH99= 12100000;

UH80= 21300000;

AH9= 2300000;

MH9= 2000000;

BSandbag= 150;

After VAS Ammobox entry, and before Supply Crate, add this:

//Sandbag

_banker addAction ["Buy Sandbags- $150.00",

{_prat = rating player; if ((B_defensebudget< BSandbag) OR (_prat< B_Mlimit)) then {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", B_Mlimit, BSandbag]} else {_MATV= " Land_BagFence_Long_F" createVehicle (getMarkerPos "itemspawn"); B_defensebudget= (B_defensebudget-BSandbag); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+BSandbag); publicVariable "B_totalcost"; hint format ["You have purchased a Sandbag Set for $%1", BSandbag];}}];

...that should do it for BLUFOR, for OPFOR,

just like we just did, at the top, add...

Osandbag= 150;

After VAS Ammobox entry, and before Supply Crate, add this:

//Sandbag

_banker addAction ["Buy Sandbags- $150.00",

{_prat = rating player; if ((O_defensebudget< OSandbag) OR (_prat< O_Mlimit)) then {hint format ["You do not have sufficient rating (Min Rating %1) or money (Costs $%2) to do this.", O_Mlimit, OSandbag]} else {_MATV= " Land_BagFence_Long_F" createVehicle (getMarkerPos "O_itemspawn"); O_defensebudget= (O_defensebudget-OSandbag); publicVariable "O_defensebudget"; O_totalcost= (O_totalcost+OSandbag); publicVariable "O_totalcost"; hint format ["You have purchased a Sandbag Set for $%1", OSandbag];}}];

...that should do it! Sandbags can purchased at whatever base you set the banker object up at. Then you can haul from there to wherever.

Additionally, you can use this method to plug in ANY object that you'd like to make available for purchase. Add the price defining value, then plug the value into each side's set. Restrict items or weight prices differently a you see fit.

If you'd like to try out the mission im talking about, with the logistics etc. check out this ALiVE Mission recently released: http://forums.bistudio.com/showthread.php?177974-TMN-Assaultis-CooP-71-ALiVE-Mission

- it's all in there, with some other goodies :-)

Edited by Fr33d0m
additional info.

Share this post


Link to post
Share on other sites
Guest

Thank you very much for sending us the release :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Is there a way to link this system with some COIN systems, for object placement?

Share this post


Link to post
Share on other sites
Is there a way to link this system with some COIN systems, for object placement?

Absolutely! let's look at some COIN integration that will work right now, and then i'll briefly touch on future plans for this particular script.

So, =BTC= Giallustio has an awesome logistics script (http://www.armaholic.com/page.php?id=21269), which, despite a few glitches, works pretty well for building bases with sandbags and limited fortifications. It also allows one to haul the stuff in a cargo system.

Using the method I provided above, you can fully customize your FOB building store by adding any object you want! Long sandbags, short sandbags, all you have to do is create a new price variable at the top of the economy script, then paste the fat line of code on the bottom and change the cost variable name of the item in the fat line of code to whatever you made your new item to be. Do it for both sides if you want them to both have the item available for purchase. As long as it has a classname, you can pretty much tag it with a price and add it to the list. I like this tool for finding classnames fast:

http://browser.six-projects.net/cfg_vehicles/classlist?utf8=%E2%9C%93&version=73&commit=Change&options[group_by]=faction&options[sort_by]=name&options[faction]=&options[vehicleclass]=Fortifications

IN THE FUTURE: I am working, as I mentioned above, on a COIN of my own, and hope to bring a more complete budget package with COIN support, individual small arms purchases (instead of just VAS access) and custom ammunition support (buying more ammo for custom guns) as well as a FOB building and object placement module in the near future. I hope to bring more in future iterations.

Share this post


Link to post
Share on other sites

Thanks Fr33dom! What a great option to plug into missions, Will it work with Indepedent (one day?)

Share this post


Link to post
Share on other sites

Yes!! Definite independent support with next iteration. Really kind of stupid that I didn't release it with this first version. My original reason for not including AAF was because this was originally just PvP idea, and AAF doesn't so much have as many equally comparable vehicles to the other sides. As it grows, and suggestions pour in, it's clear that not only independent support, but some FIA support as well needs to be done. That's something I can PROMISE, all default faction support by next iteration.

Share this post


Link to post
Share on other sites

Is there any possibility of such a system incorporating a supplementary function associated with getting money for killing enemies as well?

Share this post


Link to post
Share on other sites

Anything is possible. I have actually already done the PvP aspect of this, incorporating PvP kill rewards into a revive script we use locally here on Medius Network. As for AI kill rewards, it is indeed something that has occurred to me, but not something I have explored yet. I'll tag it on my wishlist and see what I can produce as far as a specific reward method for PvP and AI kills.

Share this post


Link to post
Share on other sites
Anything is possible. I have actually already done the PvP aspect of this, incorporating PvP kill rewards into a revive script we use locally here on Medius Network. As for AI kill rewards, it is indeed something that has occurred to me, but not something I have explored yet. I'll tag it on my wishlist and see what I can produce as far as a specific reward method for PvP and AI kills.

That would be fantastic if you could include some kind of functionality into this or some sort of derivative work.

I'm think it would work very well with the flashpoint mission scripts as a dynamic means of buying equipment or what have you whilst fighting a dynamically generated onslaught of enemies.

I'm thinking along the lines of either a menu-type thing similar to army of 2: the 40th day. Or having to come across an AI weapons dealer that appears/travels to random points in the battle zone ala Drebin from MGS 4.

Share this post


Link to post
Share on other sites

I REALLY like the idea of this script. We are going to be running a PMC style campaign and this fits very well into what we would like to do. The thing I cannot figure out is how to integrate into a dynamic campaign using Alive and MCC. In our games we have no missions specifically in the map. All of it is either by Alive or whoever is running MCC.

So what would your suggestion be to add money to the budget without specific triggers in the map. I was thinking that it could be someone that only the Major had an option to add funds, or something that could be run through MCC.

Share this post


Link to post
Share on other sites

I actually run this budget script on 2 alive missions, but as you mentioned, both missions I run have seize modules or specific PvP kill events that reward money.

Other ideas to reward money are:

Loot - There is a pretty cool suitcase model, and for blatant display, there is a pile of cash model. You could make it where finding these suitcases or pile of cash would result in money being added by adding this line of code to the init of the item (Example is 100k to BLUFOR, change amount as desired, and B to O for OPFOR:

this addAction ["Collect Money", {B_Defensebudget= (B_Defensebudget+100000); publicVariable "B_Defensebudget"; hint "You have collected a monetary reward!";}];

For a mode where the Major can add money for the whole side at a whim, add this to the B_Economy script (In blufor case)

//Rank Add $$ for all

_banker addAction ["Rank - $1m Budget Increase Request",

{_prat = rank Player; if (_prat != B_Maxrank) then {hint format ["You do not have the proper rank (Min Rank %1) to allocate funds for team", B_Maxrank]} else {B_Defensebudget= (B_Defensebudget+1000000); publicVariable "B_Defensebudget"; hint "You have allocated $1m to the defense budget!";}}];

...and finally, here's a rough and untested idea allowing players to redeem points earned in the field:

//trade rating for money

_banker addAction ["Convert Rating to Money (Rating falls back to 150)",

{

//checking to see if player has at least 150 rating

_prat = rating Player;

if (_prat <= 149 ) then

{hint "You do not have enough of a rating to allocate funds for team. Avoid friendly and civilian kills."}

else

{

_pconv = rating Player;

//heres the multiplier -

_sellrating = (_pconv x 10);

//do business....

B_Defensebudget= (B_Defensebudget+_sellrating); publicVariable "B_Defensebudget";

hint format ["You have converted your rating points into $%1 for the side's defense budget!", _sellrating];

//subtract old rating, give new rating of 150

player addRating -_pconv;

player addRating 150;

}

}

];

Hope this helps!

Share this post


Link to post
Share on other sites

So I have a couple other questions for you. We were able to get everything to work within MCC, we could place a suitcase and add the init line:

_this addAction ["Collect Money", {B_Defensebudget= (B_Defensebudget+100000); publicVariable "B_Defensebudget"; hint "You have collected a monetary reward!";}];

The only issue we had with that, is we are trying to figure out a way for the suitcase to disappear after the money has been collected. Do you have any suggestions on this?

Also, I was trying to figure out how to add additional vehicles to your economy script and I could not seem to get it to work correctly. We wanted to add the AH-1Z, the blackhawk and the CH-47 from the US Helicopters pack. It seems like when I copied your lines you have in your script and modified the class name and variables it did not show up as an item. Any help would be appreciated.

The script is fantastic and I cannot wait to use it our operations.

Share this post


Link to post
Share on other sites

The issue with MCC (Last time I used it) is that you cannot name objects you put down. The quick way around this (most of the time) is to use "myvariable = _this select 0; deleteVehicle myvariable;".

With that in mind, let's change that line of code to include a function that deletes the suitcase when you get the money

this addAction ["Collect Money", {_suitcase = _this select 0; B_Defensebudget= (B_Defensebudget+100000); publicVariable "B_Defensebudget"; hint "You have collected a monetary reward!"; deleteVehicle _suitcase;}];

Now it should disappear when you hit the action button, after it adds the money to your budget.

Share this post


Link to post
Share on other sites

Woo! fantastic, again thank you for the quick reply.

Any suggestion on adding new vehicles to your script?

Share this post


Link to post
Share on other sites

As for adding the vehicles, here's a cut and paste block. I used the old classnames from A2 OA because I dont have the US Heli pack, but hopefully they are still the same.

AH1Zprice= 4300000;

UH60price= 10460500;

CH47price= 40000000;

//AH1Z

_banker addAction ["Buy AH1Z - $4,300,000.00",

{_prat = rank player; if ((B_defensebudget< AH1Zprice) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs %2) to do this.", B_maxrank, AH1Zprice]} else {_MATV= "AH1Z" createVehicle (getMarkerPos "chspawn"); B_defensebudget= (B_defensebudget-AH1Zprice); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+AH1Zprice); publicVariable "B_totalcost"; hint format ["You have purchased an AH1Z for $%1",AH1Zprice];}}];

//UH-60M EP1 Blackhawk

_banker addAction ["Buy UH-60M Blackhawk - $10,460,500.00",

{_prat = rank player; if ((B_defensebudget< UH60price) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs %2) to do this.", B_maxrank, UH60price]} else {_MATV= "UH-60M_EP1" createVehicle (getMarkerPos "chspawn"); B_defensebudget= (B_defensebudget-UH60price); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+UH60price); publicVariable "B_totalcost"; hint format ["You have purchased a UH60 Blackhawk for $%1",UH60price];}}];

//CH_47F_EP1

_banker addAction ["Buy CH-47 Chinook - $40,000,000.00",

{_prat = rank player; if ((B_defensebudget< CH47price) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs %2) to do this.", B_maxrank, CH47price]} else {_MATV= "CH_47F_EP1" createVehicle (getMarkerPos "chspawn"); B_defensebudget= (B_defensebudget-CH47price); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+CH47price); publicVariable "B_totalcost"; hint format ["You have purchased a CH-47 Chinook for $%1",CH47price];}}];

---------- Post added at 18:40 ---------- Previous post was at 18:22 ----------

In this block, i've actually gone thru and bolded what to change. leave everything else :-)

//AH1Z

_banker addAction ["Buy AH1Z - $4,300,000.00",

{_prat = rank player; if ((B_defensebudget< AH1Zprice) OR (_prat != B_Maxrank)) then {hint format ["You do not have sufficient rank (Min Rank %1) or money (Costs %2) to do this.", B_maxrank, AH1Zprice]} else {_MATV= "AH1Z" createVehicle (getMarkerPos "chspawn"); B_defensebudget= (B_defensebudget-AH1Zprice); publicVariable "B_defensebudget"; B_totalcost= (B_totalcost+AH1Zprice); publicVariable "B_totalcost"; hint format ["You have purchased an AH1Z for $%1",AH1Zprice];}}];

Edited by Fr33d0m

Share this post


Link to post
Share on other sites

Awesome, got it in and it works perfectly. Thanks for all your help.

Share this post


Link to post
Share on other sites

Why is there no +Karma here? Fr33dom, you Rock.

Share this post


Link to post
Share on other sites
Why is there no +Karma here? Fr33dom, you Rock.

Thanks man!

---------- Post added at 23:40 ---------- Previous post was at 23:39 ----------

OK!! It's already time for that next iteration I was talking about. The link and OP have been updated!

Changelog:

1) Number Truncating Error Fixed, Now all numbers display correctly! No more e+006 truncation! (Special Thanks to Corello for working this one out)

2) Sides FIA and AAF now supported.

3) BLUFOR side has optional Up Armored HMMWV Modification support. Switch it on in the B_Economy.sqf script. (Off by default)

4) New way for MAJOR to unlock VAS to everyone with 0 rating and above for 5 minutes, allowing a MAJOR to outfit his team prior to first contact if he sees fit.

Negative Rated players are still in the dog house :-)

5) New way for MAJOR to get instant rating points, for those times when the required rating of an item needs to be higher than the default rating for rank of MAJOR.

Enjoy! More to come!

Edited by Fr33d0m

Share this post


Link to post
Share on other sites
Guest

Thanks for sending us the new version :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Edited by Guest
updated to latest version

Share this post


Link to post
Share on other sites
Thanks for sending us the new version :cool:

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Thanks for hosting and posting, FoxHound! You are the man!

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  

×