Jump to content
Sign in to follow this  
pogoman979

Construction interface problem

Recommended Posts

using the contruction module i have gotten to the stage where i can place buildings like you would in warfare, however placing a building doesnt deduct from your funds, even though i set its cost in the BIS_COIN_items variable. none of the other commands listed here help:

http://community.bistudio.com/wiki/Construction_Interface

anyone know of anyother commands or what i'm doing wrong. i have set my construction vars like so:

_coin = _this select 0; (BIS_coin_0)

_coin setvariable ["BIS_COIN_categories",["Base", "Defence"]]; 

_coin setvariable ["BIS_COIN_items",
[
	//--- Class, Category, Cost or [fundsID,Cost], (display name)
	["USMC_WarfareBBarracks","Base",200],
	["BTR90_HQ_unfolded","Base",100],
	["USMC_WarfareBLightFactory","Base",200]
]
];

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

_coin setvariable ["BIS_COIN_funds",["200"]];

_coin setvariable ["BIS_COIN_fundsDescription",["S"]];

Share this post


Link to post
Share on other sites

Variable 'BIS_COIN_Funds' have to be global variable, not number.

Try:

myMoney = 200;
_coin setvariable ["BIS_COIN_funds",["myMoney"]];

Share this post


Link to post
Share on other sites

omg lol yeah that was it. look what i just did to fix it:

_coin setvariable ["BIS_COIN_onPurchase",

{

private["_cost"];

_coin = _this select 0;

_arr = _coin getVariable "BIS_COIN_items";

_class = _this select 2;

for [{_i=0}, {_i < (count _arr)}, {_i=_i+1}] do 

{

_id = (_arr select _i) find _class;

if(_id != -1)exitwith{_cost = ((_arr select _i) select 2)};

};

_cost = call compile format["%1", _cost];
_funds = ((_coin getVariable "BIS_COIN_funds") select 0);
_funds = call compile format["%1", _funds];
_newfunds = _funds - _cost;

_coin setvariable ["BIS_COIN_funds",[format["%1",_newfunds]]];

}];

complete waste of time :facepalm:

also something im either doing wrong or could be an error, according to this page:

http://community.bistudio.com/wiki/Construction_Interface

* BIS_COIN_onPurchase = <code>; - Code which is executed when some building is purchased. Once code is completed, building is constructed. Passed argument is array in format [class,position,direction].

Example: BIS_coin_0 setvariable ["BIS_COIN_onPurchase",{sleep 2}]; - building appears after two seconds

Default value: {}

Note: Warning! System continues only after code is finished.

the variables passed should be [class,position,direction], however when i built a barracks, the variables i received were:

[bIS_coin_0, <NULL-object>, RU_WarfareBBarracks]

ie the logic, null, and the class of the building purchased.

this messed me up for awhile when i was trying to write the above code.

Edited by pogoman979

Share this post


Link to post
Share on other sites

Could someone show an example of how to get this working, I entered that into my init.sqf but couldnt figure it out.

Share this post


Link to post
Share on other sites

you need to place a contruction interface module ingame and synchronise it with the units you want to be able to build.

one way of configuring it would be to add this to the init field of the module:

[this] execVM "coinvars.sqf";

and then have the script "coinvars" look like the one in my first post.

remember you will be only be able to build if you are within the set radius of the module (ie _coin setvariable ["BIS_COIN_areasize",[50,20]]; means the radius is 50m). if you are close enough then an action called "construction" should come up.

hope that helps, if really necessary i could create a sample mission :P

Share this post


Link to post
Share on other sites

can I change the construction module's camera? I have the code for the camera i want to use...

disableSerialization;

showcinemaborder false;

_camera = "camera" camCreate [4067.33,217.76,600];

_camera cameraEffect ["internal","back"];

titleCut ["","BLACK FADED",0];

titleCut ["","BLACK IN", 2];

showcinemaborder false;

_camera camPrepareTarget [3928.56,219.04,-99817.98];

_camera camPreparePos [4067.33,217.76,200];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 0;

Share this post


Link to post
Share on other sites

not without creating a new addon, the scripts that load the coin camera are in the modules.pbo.

Share this post


Link to post
Share on other sites
not without creating a new addon, the scripts that load the coin camera are in the modules.pbo.

thought so, I will unpack them and sift through the camera options. thanks!

Share this post


Link to post
Share on other sites
can I change the construction module's camera? I have the code for the camera i want to use...

disableSerialization;

showcinemaborder false;

_camera = "camera" camCreate [4067.33,217.76,600];

_camera cameraEffect ["internal","back"];

titleCut ["","BLACK FADED",0];

titleCut ["","BLACK IN", 2];

showcinemaborder false;

_camera camPrepareTarget [3928.56,219.04,-99817.98];

_camera camPreparePos [4067.33,217.76,200];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 0;

not without creating a new addon, the scripts that load the coin camera are in the modules.pbo.

ok, I extracted the coin.sqf and coin_interface.sqf and placed them into my mission\scripts directory. But I can't launch my scripts, even with a BIS_CON_0 = execVM "scripts\coin.sqf", and the interface just hangs. They are merged into a module, so I tried to simulate that by loading coin.sqf as BIS_Coin_0, then added the action to a unit to open the interface script, but no dice. Appart from combining both files into one massive script... how would I just make a new module that I can modify as an addon so I can get the cameras right?

Edited by stuguy
too vague

Share this post


Link to post
Share on other sites
how would I just make a new module that I can modify as an addon so I can get the cameras right?

with a fair bit of work :P. i'd say its not really worth it, what are you trying to change about the current camera?

Share this post


Link to post
Share on other sites

Excuse my stupidness here as a total script rookie, but is the construction module the only thing that is needed to get to build stuff? Like without money system maybe, and more as a fun thing to test the construction? Or does it always have to have a script loaded to work?

I dont have ARMA2 yet just trying to get some info loaded up before i lay my hands on it. :)

Thanks.

Alex

Share this post


Link to post
Share on other sites

it must have a script loaded that sets all the required variables.

Share this post


Link to post
Share on other sites
with a fair bit of work :P. i'd say its not really worth it, what are you trying to change about the current camera?

i created a new coin module addon. the only problem with it is the addon mod replaces the other coin module in the editor.

Simply put, I got the dpo_lhd (lhd spawner) by ArMaTec loaded on Chernarus, and the vehicle Spawner for LHD script by Mondkalb. I know how to change the camera X and Y, so I just lined it up with my LHD in game with some tweaking, setup a commander unit on the boat that addactions the use of the terminal and wallah! working LHD command base. Now, the construction module is way cool. I have been playing with it, and I want to use that with the LHD scripts. But the only problem is that the default camera for the COIN module puts the camera 100 feet underwater. Thus I need to modify the camera for the COIN module.

I want to use the 600 meter camera height and the window position of Monkalb's script, and as the green and red position click boxes as an alternative to BIS' angled camer set 15 meters up, 1 meter in front of the player.

Edited by stuguy
more required

Share this post


Link to post
Share on other sites

yeah i noticed it didnt work over water. they spawned the camera in a rather stupid way:

_camera = "camconstruct" camcreate [position player select 0,position player select 1,15];

when the should've put

_camera = "camconstruct" camcreate [position player select 0,position player select 1,(position player select 2) + 15];

however i doubt its intended use was to build structures from the middle of the ocean :P

Share this post


Link to post
Share on other sites

Mondkalb's LHD spawning template rocks, but I love the interface and customization of the COIN module. I just hate the camera. I'm using the ArMaTeC LHD spawner, it loads dpo_lhd in the editor.

I am naming the LHD "LHD"

instead of using player as the position. I want to use LHD, and set the height and rotation of the camera to be equal of that from Mondkalb's script. That way you can see the entire carrier.

He also added clicky buttons that turn red if a unit is detected in the area and you can't spawn units there. I like that idea for MP. So I want to remove the BIS camera pivot and locked screen and bring up the mouse so i can click the buttons from Monkalb's template. But not use his menu for building free aircraft, but rather have the player "buy" the planes and spawn them down on the carrier safely, using input from the COIN module

---------- Post added at 02:32 PM ---------- Previous post was at 01:58 PM ----------

here is where i am having problems...I need help breaking down the COIN_interface.sqf.

I know where the camera is getting created, and how that works. It' the HUD and the vehicle Creation that is messing with me....I want to keep the HUD and the referrences to the COIN.sqf, but I want to change the vehicle creation and camera. I am cutting out some stuff and adding in MBG material...

Share this post


Link to post
Share on other sites

I am trying to isolate the HUD from the COIN_interface.sqf. I want to set my own camera in my addon module and overlap the HUD on top. I still want the HUD to reference the materials in COIN.sqf the same. I am getting nowhere messing around with the script, the only thing i can do is raise the camera and rotate it, but I can't change the way it wants to spawn units.

Im shelving this project:

Modify Construction Module to work for the dpo_lhd module by ARMATEC, with elements from the LHD Vehicle Spawner by Mondkalb

Edited by stuguy
project shelved

Share this post


Link to post
Share on other sites

I'm trying to get this construction module setup properly. Basically what I'm trying to do is set it up so the player can build defenses without worrying about money. I don't want the buildings to cost anything or I need the player to have enough money so he can build whatever he wants. I've read the information on the biki and I just don't understand it. I understand how to synch the module with the player and that works and I get the construction interface, but there is nothing there to select to build. You have to list it in these optional parameters for the module somehow. Am I supposed to call these optional parameters in the init of the module or what? Any help is greatly appreciated.

LINK TO BIKI INFO:

http://community.bistudio.com/wiki/Construction_Interface

Thanks,

Monty

Share this post


Link to post
Share on other sites
I'm trying to get this construction module setup properly. Basically what I'm trying to do is set it up so the player can build defenses without worrying about money. I don't want the buildings to cost anything or I need the player to have enough money so he can build whatever he wants. I've read the information on the biki and I just don't understand it. I understand how to synch the module with the player and that works and I get the construction interface, but there is nothing there to select to build. You have to list it in these optional parameters for the module somehow. Am I supposed to call these optional parameters in the init of the module or what? Any help is greatly appreciated.

LINK TO BIKI INFO:

http://community.bistudio.com/wiki/Construction_Interface

Thanks,

Monty

what i did was sync the module to myself and also the module to an NPC, or Truck, or object, or something. It lets that NPC or object act as your terminal. when you sync yourself to the module, that only gives that player access to use it. Like you have the car keys to drive the Porsche. What you are missing now is the Porsche. The actual object also linked to your key, or the module. That will allow you to enter "CONSTRUCTION" menu when you get close enough. It will be a new item in your list of actions. This takes a few moments to load at mission start. So be patient. ARMA2 is buggy :P

Share this post


Link to post
Share on other sites

Thanks for the help, but I know how to access the interface, that wasn't the problem. But I finally figured out how to set the optional variables I needed and it works now! :)

Share this post


Link to post
Share on other sites

can someone please give me the script to get full construction with all categories and prices if there is something like this, or at least a script that is close enough to give me all items in construction module, please.

Share this post


Link to post
Share on other sites

try putting

nul = [this] execVM "coinvars.sqf";

in the init field instead.

Share this post


Link to post
Share on other sites

i wold really apreciate you could send me a example mission because my english is not so good (im from spain) and i dont understand how to make the construcction module works thanks and wait for your reply

Share this post


Link to post
Share on other sites

put that mission folder so i get to know how and where to put the scripts im new in this

Share this post


Link to post
Share on other sites

I have the construction module up and running and figured out how to change starting funds and objects to be built. How do I get it to increase funds with kills? Not asking someone to do it for me, but would I have to transfer over more scripts from Warfare?

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  

×