Jump to content

[Release] - A Plot for life v2.5. Keep your buildables on death. Take plot ownership


Recommended Posts

I so want to install this, but just know the second I get it working 1.5 will come out.

 

Haha, I know your pain.  The stuff I am spending hours on at the moment I am just hoping will not become obsolete when 1.0.5 is out (doubt it for the refueling stuff though).

 

I will amend this for 1.0.5 if needed though so no need to worry too much.

 

I will look at packaging it up as a download tonight.  Have been saying I would for a while but have never got round to it as I have to build another test server in order to do it which is a fiar bit of work / time.  Will give it priority and get the historicals update SQL sorted out so it ignores locakbles as well.

 

RB

Link to comment
Share on other sites

 

 

Hi MGM,

 

I use MySQL Workbench as it comes with the MySQL install (inc. the free community version) and is pretty powerful (although still far from perfect).  It also gives a baseline as everyone has it, just like vi on UNIX servers.

 

My suspicion is that NaviCat is not seeing the direct delimeter as the start of a code block and is therefore complaining at the end delimeter.

 

Suggestions

You could try MySQL Workbench and it should work without issue.

Run the first "drop" command and then run the second "create" block of code without the delimeters around it (take out the "DELIMITER | " at the start and the "| DELIMITER ; " at the end).  Worst that will happen is that it will not create the function.  If it fails try adding a ";" after the "END".

 

I am not near a MySQL server so cannot test for you so this is a bit of testing by proxy ;) .

 

Let me know which way you have tried and the result and we can go from there.

 

Thank you very much sir, in the light of your direction it took me 0.002 ms to sort it out (timing comes from MySQL :D).

I simply split the code into two and removed delimiter declaration in between - below it is for any other players who might have the same issue:

 

 

Part A

DROP FUNCTION IF EXISTS text2digits;

Part B

CREATE FUNCTION text2digits( str CHAR(32) ) RETURNS CHAR(32) 
BEGIN 
  DECLARE i, len SMALLINT DEFAULT 1; 
  DECLARE ret CHAR(32) DEFAULT ''; 
  DECLARE c CHAR(1); 
  SET len = CHAR_LENGTH( str ); 
  REPEAT 
    BEGIN 
      SET c = MID( str, i, 1 ); 
      IF c BETWEEN '0' AND '9' THEN  
        SET ret=CONCAT(ret,c); 
 else
SET ret=CONCAT(ret,"9");
      END IF; 
      SET i = i + 1; 
    END; 
  UNTIL i > len END REPEAT; 
  RETURN ret; 
END

And as expected I do not have any issues with charID-to-playerID conversion - proceeding with installation step #1 now.

Link to comment
Share on other sites

And as expected I do not have any issues with charID-to-playerID conversion - proceeding with installation step #1 now.

 

Cool.

 

Hold off the historic realignment sql at the end of the install if you have more than 99 characterIDs in the character_data table.  Locked doors use 3 digits and so you can have an overlap if you have valid characterIDs of XXX.  I need to amend the code to exclude lockables which I will do tonight.  The rest of the install is good though and will work fine. 

Link to comment
Share on other sites

Cool.

 

Hold off the historic realignment sql at the end of the install if you have more than 99 characterIDs in the character_data table.  Locked doors use 3 digits and so you can have an overlap if you have valid characterIDs of XXX.  I need to amend the code to exclude lockables which I will do tonight.  The rest of the install is good though and will work fine. 

Just came here to report installation success and read your message, thanks for the warning but I have only 4 players so far on this test server so no probs.

 

Having just completed installation on an Epoch 1.0.4.2a Server with a few scripts (self-BB, snap build, refuel/repair/rearm) with success, here is my feed back:

 
Installation Time/ZIP release:
It's a very useful piece of code so time is not an issue but it took 45 mins to update the files carefully + 15 mins to test, so this a good one hour investment. I think it would be ideal if you can finally get around to publishing your ZIP for standard Epoch latest version users so that they can simply unzip this :)
 
Instructions Comment #1:
In this step >> PVDZE_obj_Publish = [dayz_characterID,_object,[_dir,_location],_classname];and replace
I suggest you update the search string as >> PVDZE_obj_Publish = [dayz_characterID,_object,[_dir,_location],_classname]
(because simple copy & paste & search will then work)
 
Instructions Comment #2:
In this step >> call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
I suggest you update the search string as >> call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
(same reason - simple copy & paste & search will then work) (whitespaces you copy & paste are shortened by the forum that's why)
 
 
 
 
I also have a question:
Having installed this, and tested it by killing myself and seeing my new char is still able to remove locks from doors, so I assume it is working fine, I still have a small issue.
If you check the screenshots below, when I'm looking at the plot pole and also when I'm in a completely different part of the map, I still have several "Show Plot Boundary" mouse wheel options - is this intended? If it's not, any clue what mistake did I make during the installation?
 
Thanks again for your great contribution to the community!

 

 

 

Nw5Aqsi.jpg

 

GtOEDYa.jpg

Link to comment
Share on other sites

Check your fn_selfactions.sqf file as the part of the "show plot boundary" code that handles the removal of the menu item appears to be misconfigured so it is not being removed.

 

The option should be removed fromthe list when you look at another object.  If you do not look at another object (i.e. you always look at the floor) then the option will remain.  This is a limitation of the way it is coded and also affects the maintain area options as well.  Check out post in this thread for a detailed explainantion on how the items appear and disappear from the menu.

Link to comment
Share on other sites

Zip file added to first post.  That has pre-modified sqf files and directories for use on a clean install of vanilla Epoch (may overwrite other mods otherwise).l

 

Sorted out a coupe of lines in the install instructions that had "and replace" appended to them (issue with the forum editor).

 

Will look at the historical alignment sql tomorrow.

 

The zip downloaded was sanity tested with

  • Placing a plot pole
  • Building a half cinder wall
  • Upgrading the cinder wall
  • removing the cinder wall
  • removing the plot pole

 

Have not tested tagging in the zip file but should be fine.

 

Enjoy.

Link to comment
Share on other sites

Works wonderfully by the way. Only issue is that it broke elevators as they still look for charachter Id. I'm having issue adjusting the code so it can see the changes.

_canBuildOnPlot = false;


_distance = DZE_PlotPole select 0;
_needText = localize "str_epoch_player_246";
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];


{
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;


_IsNearPlot = count (_findNearestPole);


if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
// Since there are plots nearby we check for ownership and then for friend status
// check nearby plots ownership and then for friend status
_nearestPole = _findNearestPole select 0;
// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
// check if friendly to owner
if(dayz_characterID == _ownerID) then { //Keep ownership
// owner can build anything within his plot except other plots
_canBuildOnPlot = true;
} else {
_friendlies = player getVariable ["friendlyTo",[]];
// check if friendly to owner
if(_ownerID in _friendlies) then {
_canBuildOnPlot = true;
};
};
};
if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; };

_args = _this select 3;
_option = _args select 0;
switch (_option) do {
case "build": {
_obj = _args select 1;
_id = [_obj] call ELE_fnc_generateElevatorId;
if (_id == "") exitWith { cutText ["invalid elevator ID generated", "PLAIN"] };
if ((ELE_RequiredBuildTools call AC_fnc_hasTools) && {ELE_RequiredBuildItems call AC_fnc_checkAndRemoveRequirements}) then {
["Medic", ELE_MaxRange] call AC_fnc_doAnimationAndAlertZombies;
ELE_elevator = [_obj, _id] call AC_fnc_swapObject;
titleText ["Elevator Built", "PLAIN"];
};
};
case "build_stop": {
_obj = _args select 1;
if (isNil "ELE_elevator") exitWith { cutText ["no elevator selected", "PLAIN"] };
_dist = _obj distance ELE_elevator;
if (_dist > ELE_MaxRange) exitWith { cutText [format["Elevator Stop is to far away from Elevator (%1 > %2)", _dist, ELE_MaxRange], "PLAIN"] };
_id = [ELE_elevator] call ELE_fnc_getNextStopId;
if (_id == "") exitWith { cutText ["Elevator Stop already exists or to many (max. 9 per Elevator)", "PLAIN"] };
if ((ELE_RequiredBuildTools call AC_fnc_hasTools) && {ELE_RequiredBuildStopItems call AC_fnc_checkAndRemoveRequirements}) then {
["Medic", ELE_MaxRange] call AC_fnc_doAnimationAndAlertZombies;
_elevatorStop = [_obj, _id, ELE_StopClass] call AC_fnc_swapObject;
titleText ["Elevator Stop Built", "PLAIN"];
};
};
};

DZE_ActionInProgress = false;
s_player_elevator_upgrade = -1;
s_player_elevator_upgrade_stop = -1;

Link to comment
Share on other sites

Works wonderfully by the way. Only issue is that it broke elevators as they still look for charachter Id. I'm having issue adjusting the code so it can see the changes.

 

 

Ok, so the part of the code that checks the players id and the items owner id is this

// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
// check if friendly to owner
if(dayz_characterID == _ownerID) then { //Keep ownership

OwnerID gets the characterID of the object (currently changed to the PlayerUID after conversion to just numbers).

 

dayz_characterID is a variable sert elsewhere to match the players characterID.  It is this one we need to replace and it should all fall in to place.

 

Add a new variable in the Private line at the top of the file called .

find 

Private ["_

At the end of the line before the closing '];' add

,"_playerUID" 

Find

_findNearestPole = [];

Change to

_findNearestPole = [];
_playerUID = [player] call convertPlayerUID; 

Find 

if(dayz_characterID == _ownerID) then { //Keep ownership

Change to

if(_playerUID == _ownerID) then { //Keep ownership

That should be it (based on the code snippet you provided).

 

You may need to check AC_fnc_swapObject and I would search all of the code for dayz_characterID and use the mothod above to get and replace dayz_characterID with _playerUID (same technique as above).  Axemans elevator script seems to be using a set of functions for common tasks (medic action and call zombies for example) which is by far the smarter way to do it but as they are non standard I have no visibility.

 

Hope this helps. 

Link to comment
Share on other sites

Trying this out on 1.0.5 here in a few. So far nobody I know has been able to get it work but I don't have any more info than that sadly.

Edit:

One thing on the instructions... all "and" are now "&&". Just finished the install time time test.

Edit2:

Going to double check my install but it uses my charid instead of uid.

Link to comment
Share on other sites

Trying this out on 1.0.5 here in a few. So far nobody I know has been able to get it work but I don't have any more info than that sadly.

Edit:

One thing on the instructions... all "and" are now "&&". Just finished the install time time test.

 

The && was introduced in ARMA II OA 1.62 so changing 'and' to '&&' is just a code update to the most recent, and hopefully faster, method of doing the same thing.

 

I downloaded the mod last night but will need to windiff the old and new versions of all the files this mod touches to find the differences and then find the best way to account for them.

Link to comment
Share on other sites

The && was introduced in ARMA II OA 1.62 so changing 'and' to '&&' is just a code update to the most recent, and hopefully faster, method of doing the same thing.

 

I downloaded the mod last night but will need to windiff the old and new versions of all the files this mod touches to find the differences and then find the best way to account for them.

 

Hope you get time to do this soon! Don't really want to update without this great mod!

Link to comment
Share on other sites

Just replaced my Razer Blackwidow keyboard with an Armageddon Black Hornet after a spillage put the former out of action.  Since then I have been seeing some strange issues (repeating keys sometimes but not always, in Epoch the gear menu switches from working normally to opening and then instantly closing, in WIndows explorer shift locks on now and again - not caps lock etc) so I was looking at a rebuild of my desktop but I noticed last night that there is  raptr.exe (or something like it) crashing on shutdown and I suspect some old Razer software may be running in the background still causing issues with the new keyboard so may be able to track it down and just remove.

 

Tl;Dnr - Old keyboard software affecting new keyboard causing testing of Epoch modes to be problematic.

 

If that is it and it is fairly easy to resolve then I can take a look at sorting this mod out tonight but it may take a day or two as there are quite a high number of changes over multiple files.  I will probably release a test copy asap and once validated will put out the full version.

Link to comment
Share on other sites

This working fine for 1.0.5 Rimblock and will you update the zip with the new files?

 

Thanks

 

Do you mean that this is already working fine or when this is working fine ?.

 

I will do an additional zip file for 1.0.5 so people running either can still use this mod.

Link to comment
Share on other sites

Ok, after a quick check for differences I have found nothing significant so far.

 

The following files have differences between 1.0.4.2 and 1.0.5 in areas that affect this mod but the differences are pretty minor (as noted above the 'search for' needs "and" changed to "&&") and should be easy to sort out;

tagfriendly

player_updategui

fn_damageactions

fn_selfactions

 
I will put together a 1.0.5 zip file now for people to test on a new Epoch 1.0.5 install without other mods (or just install first).
 
I will update the install instructions probably over the weekend.
Link to comment
Share on other sites

I've gotten it to the point where built objects write to the database with playerUID, but I can't upgrade anything or remove anything as the plot pole isn't seeing me as the owner.

 

So check out remove.sqf and player_upgrade.sqf

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...