Jump to content
Sign in to follow this  
Sherman -3rd ID-

Buying Units from Constructed Buildings

Recommended Posts

So I've been searching for this for awhile, and I have not been able to figure this out.

On my mission, I have it to where you can construct a base and its various base defenses, but once all that is done you cannot construct units from their various buildings.

Now I knew it wouldn't be as easy as placing them down, but does anyone know how, or know where, to find out how to "buy" units from base building?

Share this post


Link to post
Share on other sites

how did you enable the CoIn interface? maybe this helps? or check other warfare custom missions like this one.

Share this post


Link to post
Share on other sites

In the init.sqf I put this...

myMoney = 2000;

MyCoin setvariable ["BIS_COIN_name","Base"];

MyCoin setvariable ["BIS_COIN_rules",[player]];

MyCoin setvariable ["BIS_COIN_areasize",[50,20]]; 

MyCoin setvariable ["BIS_COIN_categories",["Base", "Defence", "Cars"]]; 

MyCoin setvariable ["BIS_COIN_items",
[
	//--- Class, Category, Cost or [fundsID,Cost], (display name)
	["USMC_WarfareBBarracks","Base",200,"Barracks"],
	["LAV25_HQ_unfolded","Base",100],
	["USMC_WarfareBLightFactory","Base",400],
	["USMC_WarfareBHeavyFactory","Base",600],
	["USMC_WarfareBFieldhHospital","Base",100],
	["Land_Fort_Watchtower","Defence",100,"Large Watchtower Bunker"],
	["Hedgehog","Defence",10,"Hedgehog"],
	["USMC_WarfareBMGNest_M240","Defence",100,"MG Nest"],
	["TOW_Tripod","Defence",250,"TOW Pod"],



]
];

myCoin setvariable ["BIS_COIN_funds",["myMoney"]];

myCoin setvariable ["BIS_COIN_fundsDescription",["€"]];

MyCoin setvariable ["BIS_COIN_onPurchase",{sleep 2}];

Its works great, but none of those links really helps me out. The CoIn module on the wiki page is kind of lacking for somebody who is new to the scripting universe. And unfortunately I have no idea how to utilize this to build normal units. I can place them using the script but then that would kind of defeat the purpose of having a base if your units just appeared out of thin air.

Share this post


Link to post
Share on other sites

This is the reason why I said look at other examples, the CoIn module is for constructing different kinds of buildable objects as you defined at the MyCoin variable, not for "building" (aka buying) units. Also I wouldnt recommend putting that script in your init.sqf but in a seperate file which is called from the CoIn module init.

To get back to the units, these need to be configured just as the objects used with the CoIn module, check out the sample mission in this thread then you will see what I mean.

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  

×