Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies and more


Base Building 1.2 on Lingor 1.3


Recommended Posts

Thought I'd give it a shot and post here. I installed this mod last night and everything is working, I can set up structures, the recipe book works, etc. The only problem I am having is that the built objects are not writing to my database. This is the code I modified after reading the forums where this mod originated from:

 

I added this to server_function.sqf:

 

//Get instance name (e.g. dayz_1.chernarus)
fnc_instanceName = {
"dayz_" + str(dayz_instance) + "." + worldName
};

vehicle_handleInteract = {
private["_object"];
_object = _this select 0;
needUpdate_objects = needUpdate_objects - [_object];
[_object, "all"] call server_updateObject;
};

vehicle_handleServerKilled = {
private["_unit","_killer"];
_unit = _this select 0;
_killer = _this select 1;

[_unit, "killed"] call server_updateObject;

_unit removeAllMPEventHandlers "MPKilled";
_unit removeAllEventHandlers "Killed";
_unit removeAllEventHandlers "HandleDamage";
_unit removeAllEventHandlers "GetIn";
_unit removeAllEventHandlers "GetOut";
};

check_publishobject = {
private["_allowed","_allowedObjects","_object"];

_object = _this select 0;
_playername = _this select 1;
_allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"];
_allowed = false;

diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];

if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {
diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
_allowed = true;
};

_allowed
};

 

Then I added this to mod file player_build.sqf:

 

// Send to database
_object setVariable ["characterID",dayz_characterID,true];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
} else {cutText ["You need the EXACT amount of whatever you are trying to build without extras.", "PLAIN DOWN"];call _funcExitScript;};

 

 

This was written for 1.7.6.1 and I noticed the Lingor 1.3 runs on 1.7.5.1 but I have seen lingor 1.3 servers running this mod with no problems. Any help would be greatly appreciated. I am still fairly new to modding/scripting a server. Thanks!

 

This is the link where I found the mod: http://opendayz.net/threads/base-buildi ... ased.8579/

Share this post


Link to post
Share on other sites

Thought I'd give it a shot and post here. I installed this mod last night and everything is working, I can set up structures, the recipe book works, etc. The only problem I am having is that the built objects are not writing to my database. This is the code I modified after reading the forums where this mod originated from:

 

I added this to server_function.sqf:

 

//Get instance name (e.g. dayz_1.chernarus)
fnc_instanceName = {
"dayz_" + str(dayz_instance) + "." + worldName
};

vehicle_handleInteract = {
private["_object"];
_object = _this select 0;
needUpdate_objects = needUpdate_objects - [_object];
[_object, "all"] call server_updateObject;
};

vehicle_handleServerKilled = {
private["_unit","_killer"];
_unit = _this select 0;
_killer = _this select 1;

[_unit, "killed"] call server_updateObject;

_unit removeAllMPEventHandlers "MPKilled";
_unit removeAllEventHandlers "Killed";
_unit removeAllEventHandlers "HandleDamage";
_unit removeAllEventHandlers "GetIn";
_unit removeAllEventHandlers "GetOut";
};

check_publishobject = {
private["_allowed","_allowedObjects","_object"];

_object = _this select 0;
_playername = _this select 1;
_allowedObjects = ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"];
_allowed = false;

diag_log format ["DEBUG: Checking if Object: %1 is allowed published by %2", _object, _playername];

if ((typeOf _object) in _allowedObjects || (typeOf _object) in allbuildables_class) then {
diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];
_allowed = true;
};

_allowed
};

 

Then I added this to mod file player_build.sqf:

 

// Send to database
_object setVariable ["characterID",dayz_characterID,true];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
} else {cutText ["You need the EXACT amount of whatever you are trying to build without extras.", "PLAIN DOWN"];call _funcExitScript;};

 

 

This was written for 1.7.6.1 and I noticed the Lingor 1.3 runs on 1.7.5.1 but I have seen lingor 1.3 servers running this mod with no problems. Any help would be greatly appreciated. I am still fairly new to modding/scripting a server. Thanks!

 

This is the link where I found the mod: http://opendayz.net/threads/base-buildi ... ased.8579/

Share this post


Link to post
Share on other sites

Here is mine currently:

 

private ["_class","_uid","_charID","_object","_worldspace","_key"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID =		_this select 0;
_object = 		_this select 1;
_worldspace = 	_this select 2;
_class = 		_this select 3;

//if (!(_object isKindOf "Building")) exitWith {
//	deleteVehicle _object;
//};
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed) exitWith { };


//diag_log ("PUBLISH: Attempt " + str(_object));

//get UID
_uid = _worldspace call dayz_objectUID2;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid,true];

if (_object isKindOf "TentStorage") then {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

//diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);

 

Thanks for the response!

Share this post


Link to post
Share on other sites

Here is mine currently:

 

private ["_class","_uid","_charID","_object","_worldspace","_key"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID =		_this select 0;
_object = 		_this select 1;
_worldspace = 	_this select 2;
_class = 		_this select 3;

//if (!(_object isKindOf "Building")) exitWith {
//	deleteVehicle _object;
//};
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed) exitWith { };


//diag_log ("PUBLISH: Attempt " + str(_object));

//get UID
_uid = _worldspace call dayz_objectUID2;

//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;

_object setVariable ["ObjectUID", _uid,true];

if (_object isKindOf "TentStorage") then {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
};

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

//diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);

 

Thanks for the response!

Share this post


Link to post
Share on other sites

So I asked another server admin to send me his .pbo files so I could look them over because he is successfully running the mod and it's writing to the database. It appears everything is the same. I loaded his mission and server .pbo files onto my server and everything worked fine, except for the database. I am clueless as to why it's not writing. Could it not be identifying the database somehow?

 

The instructions say to backup and delete your current deployables list in SQL, then to run a script to modify the list for base building 1.2. I did this multiple times. I have linked the sql script. Everything on my server is working perfectly except this!

 

https://github.com/Daimyo21/BaseBuildin ... g/database

Share this post


Link to post
Share on other sites

So I asked another server admin to send me his .pbo files so I could look them over because he is successfully running the mod and it's writing to the database. It appears everything is the same. I loaded his mission and server .pbo files onto my server and everything worked fine, except for the database. I am clueless as to why it's not writing. Could it not be identifying the database somehow?

 

The instructions say to backup and delete your current deployables list in SQL, then to run a script to modify the list for base building 1.2. I did this multiple times. I have linked the sql script. Everything on my server is working perfectly except this!

 

https://github.com/Daimyo21/BaseBuildin ... g/database

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...