Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 62

  Click here to go to the first Developer post in this thread.  

Thread: Construction interface problem

  1. #1

    Construction interface problem

    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/C...tion_Interface

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

    Code:
    _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"]];

  2.   This is the last Developer post in this thread.   #2
    Variable 'BIS_COIN_Funds' have to be global variable, not number.

    Try:
    Code:
    myMoney = 200;
    _coin setvariable ["BIS_COIN_funds",["myMoney"]];
    Alpha is alpha.

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

    Code:
    _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/C...tion_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.
    Last edited by pogoman979; Jun 5 2009 at 15:31.

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

  5. #5
    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

  6. #6
    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;

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

  8. #8
    Quote Originally Posted by pogoman979 View Post
    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!

  9. #9
    Quote Originally Posted by stuguy View Post
    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;
    Quote Originally Posted by pogoman979 View Post
    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?
    Last edited by stuguy; Jun 9 2009 at 06:44. Reason: too vague

  10. #10
    Quote Originally Posted by stuguy View Post
    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?

Page 1 of 7 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •