Akku14 Posted May 3, 2015 Report Share Posted May 3, 2015 While merging these two in my compile.sqf i have :o player_build = compile preprocessFileLineNumbers "Custom\A_Plot_for_Life\Action\modular_build.sqf"; and this :o player_build = compile preprocessFileLineNumbers "Custom\A_Plot_for_Life\Action\player_build.sqf" Since i wana use both the scripts how to deal with this ? :blink: Can i use IF or Else in compile.sqf in case yes please help how to do that Thanks ^_^ Link to comment Share on other sites More sharing options...
0 LunatikCH Posted May 3, 2015 Report Share Posted May 3, 2015 merge modular_build.sqf and the player_build.sqf together and change the path to the merged one. Link to comment Share on other sites More sharing options...
0 Akku14 Posted May 3, 2015 Author Report Share Posted May 3, 2015 I only wana change _friendlies = player getVariable ["friendlyTo",[]] // check if friendly to owner if(_ownerID in _friendlies) then { _canBuildOnPlot = true; }; to this _friendlies = _nearestPole getVariable ["plotfriends",[]]; _fuid = []; { _friendUID = _x select 0; _fuid = _fuid + [_friendUID]; } forEach _friendlies; _builder = getPlayerUID player; // check if friendly to owner if(_builder in _fuid) then { _canBuildOnPlot = true; }; As said in plot management do i need to paste player_build.sqf & modular_build.sqf as well ? cuz there is no such lines in modular.sqf Link to comment Share on other sites More sharing options...
0 raymix Posted May 3, 2015 Report Share Posted May 3, 2015 if you use modular modular build, then player_build is not used, so you can ignore that file (don't use both) modular is an updated version of it and split into several smaller files, it also comes with snap building with it. Link to comment Share on other sites More sharing options...
0 Akku14 Posted May 3, 2015 Author Report Share Posted May 3, 2015 I added the lines given by Plot management in to modular_build i can see GUI and can also add friend to plot via plot management and to door via door management but after he dies and come back and he can still open the door but he can’t build even he is still in the plotpole management. What do I do wrong? modular_build is( added over original file given by PP4L) //Check if building already in progress, exit if so. if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; private ["_itemConfig","_classname","_classnametmp","_require","_text","_ghost","_lockable","_requireplot","_isAllowedUnderGround","_offset","_isPole","_isLandFireDZ","_hasRequired","_hasrequireditem","_reason","_buildObject","_location1","_object","_objectHelper","_position","_controls","_cancel","_dir","_plot_check_result","_nearest_pole"]; /*Basic Defines*/ DZE_Q = false; DZE_Z = false; DZE_Q_alt = false; DZE_Z_alt = false; DZE_Q_ctrl = false; DZE_Z_ctrl = false; DZE_5 = false; DZE_4 = false; DZE_6 = false; DZE_F = false; DZE_cancelBuilding = false; call gear_ui_init; closeDialog 1; DZE_buildItem = _this; //This is a magazine! It's global to allow access to it from outside functions //count nearby objects. Returns [_cnt] number [] call player_build_countNearby; //Check illegal player states. Returns [_isFine] string [] call player_build_states; //check for nearby requirements (campfire, workshop, fueltank). [] call player_build_needNearby; //check config files and gather info about item (if using custom buildables, make your own similar function instead). _itemConfig = [] call player_build_getConfig; //define items collected from function _classname = _itemConfig select 0; //string _classnametmp = _itemConfig select 1; //string _require = _itemConfig select 2; // array _text = _itemConfig select 3; // string _ghost = _itemConfig select 4; //string _lockable = _itemConfig select 5; //int -- 0/1=No 2=lockbox, 3=combolock, 4=safe _requireplot = _itemConfig select 6; //int _isAllowedUnderGround = _itemConfig select 7; //int _offset = _itemConfig select 8; //array _isPole = _itemConfig select 9; //bool _isLandFireDZ = _itemConfig select 10; //bool //Check for nearby plotpoles. Returns [_IsNearPlot,_nearestPole,_ownerID,_friendlies] [int,Obj,int,array] _plot_check_result = [_isPole, _requireplot, _isLandFireDZ] call player_build_plotCheck; if (DZE_ActionInProgress) then { //needed otherwise _hasRequired gets RPT error _nearest_pole = _plot_check_result select 1; _distance = _plot_check_result select 4; //Check for build requirements (missing tools and items). Returns [_hasrequireditem,_reason] [bool,string] _hasRequired = [_require, _text, true, true] call player_build_buildReq; //define item collected from function _hasrequireditem = _hasRequired select 0; //bool if (_hasrequireditem) then { //Create object that is attached to a player (i.e Ghost preview if available) _buildObject = [_classname, _ghost, _offset, true, _requireplot, _nearest_pole,_distance] call player_build_create; //define items collected from function _location1 = _buildObject select 0; //array _object = _buildObject select 1; //Obj _objectHelper = _buildObject select 2; //Obj _controls = [_object, _isAllowedUnderGround, _location1, _objectHelper] call player_build_controls; //define items collected from function _cancel = _controls select 0; //bool _reason = _controls select 1; //string _position = _controls select 2; //array _dir = _controls select 3; //int //Publish item to a database [_cancel, _position, _classnametmp,_isAllowedUnderGround, _text, _isPole, _lockable,_dir, _reason,_requireplot] call player_build_publish; }; }; Link to comment Share on other sites More sharing options...
0 Akku14 Posted May 3, 2015 Author Report Share Posted May 3, 2015 Thanks for good hint raymix i put the same code in player build plot check :P and now it works thanks a lot :) raymix 1 Link to comment Share on other sites More sharing options...
0 raymix Posted May 3, 2015 Report Share Posted May 3, 2015 yeh, modular build is same old player_build, only split into several smaller files and modified to be better on performance. Don't forget to remove part you added in post #5, ofc. Glad you got it sorted out. Akku14 1 Link to comment Share on other sites More sharing options...
Question
Akku14
While merging these two in my compile.sqf i have :o
player_build = compile preprocessFileLineNumbers "Custom\A_Plot_for_Life\Action\modular_build.sqf";
and this :o
player_build = compile preprocessFileLineNumbers "Custom\A_Plot_for_Life\Action\player_build.sqf"
Since i wana use both the scripts how to deal with this ? :blink:
Can i use IF or Else in compile.sqf in case yes please help how to do that
Thanks ^_^
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now