Jump to content

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


Recommended Posts

Plot Pole Authorised Builder management - Proposed sucessor project.

 

Overview.

Tie owner and people who the owner authorises to build in a plot poles area to the plot pole.  Authorised builders will be managed via the plotpole and not via the tagfriendly system.  Depending on performance issues searching through all the authorised builder PlayerUIDs, the number of authorised builder could equal the number of players on the server and beyond.

 

Phases.

  1. Basic mechanics via mouse scroll wheel (much like the vehicle repair option leading to sub options).
  2. Possible window popup for builder management.

Phase 1 Suggestions.

  • Add an authorised builder (like tagging).
  • Remove an authorised builder (via plot pole).
  • Record builders PlayerUID & Name when added (Players can change names easily but not PlayerUIDs without a new game serial). 
  • Anything else ?.

Phase 2 Suggestions.

  • Move to a gui menu
  • Update builders names based on their PlayerUID when they login so if they change their name between logins it will be caught on the builders menu.

 

Feedback, suggestions or additional ideas most welcome. 

 

After the tagfriendly is sorted out on this release I will kick off the Plot Pole Builder Manager Mod project and possibly move it to its own thread.

 

RB

Link to comment
Share on other sites

Ok, strange.

 

My tagging seems to be doing what I want with my original code (correct number is going in the correct place in the hive) on the new built server.

 

The contents of my player_tagfriendly.sqf is

private["_target", "_caller", "_callerID", "_targetID", "_friendlies", "_rfriendlies"];
_target = _this select 0;
_caller = _this select 1;

call fnc_usec_medic_removeActions;
r_action = false;

_callerID = [_caller] call convertPlayerUID; 
_targetID = [_target] call convertPlayerUID; 

_friendlies = _caller getVariable ["friendlies", []];
_friendlies set [count _friendlies, _targetID];
_caller setVariable ["friendlies", _friendlies, true];

_rfriendlies = _target getVariable ["friendlies", []];

if !(_callerID in _rfriendlies) then {
    titleText [(localize "STR_EPOCH_ACTIONS_8"), "PLAIN DOWN"]; //To Caller
    /* PVS/PVC - Skaronator */
    PVDZE_send = [_target,"tagFriendly",[_target]]; //To Target
    publicVariableServer "PVDZE_send";
};

If your version is saving a single character in the currentstate column in the DB after installing the update then check the file above with what you have.

 

I have tested twice to double confirm mine is working.

 

The recognition of friendlies is not working as expected so friendlies cannot build.  Debugging that now.

 

RB

 

Link to comment
Share on other sites

Ok, I think I have found the issue.

 

In custom\ConvertpUID\convertpuid.sqf

 

Find

_number_string = getPlayerUID _player; 

Change to

_number_string = getPlayerUID _playertemp ;  

The bug was resulting in the players UID always being sent back.  Good some of the time but if you wanted the UID of your target (e.g. for tagging) it would send the wrong UID back.

 

Not able to test as the person I am testing with is now asleep but that is likely to be the source of the issue.

 

Will verify when home tomorrow.

 

RB

Link to comment
Share on other sites

Quick question. 

 

Anyone want the ability to turn on the plot outline (the circle of red and white sticks you get on building a plot pole) back on from the plot pole anytime you want ?.

 

"Should" be pretty easy to add in and it is a real pain not knowing where the boundaries are when building :) .

 

Any interest.  If so I will give it a go tonight.

 

RB

Link to comment
Share on other sites

Find

_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""];
Change to 
_action = _unit addAction ["Tag as friendly", "custom\\ConvertpUIDplayer_tagFriendly.sqf", [], 0, false, true, "", ""]; 
 

 

 On the change to the directory has a double slash ;)

 

SGCDayZ Server Management

Jonas

Link to comment
Share on other sites

Show Plot Boundary is now working from the Plot Pole menu.

 

I will put the install instructions together and post them up.  This one is very simple to do.

 

The boundary does not stay shown past reboot (same as the initial boundary doesn't when you first build a plot pole) but you can just turn it on again after.

 

RB

Link to comment
Share on other sites

Version changed to v1.1

 

Added "Show plot boundary" to the plot pole which will turn on the plot pole boundary markers again.  They will vanish on server reboot but can be turned on again from the plot pole if needed.

 

Install details at the bottom of the first post.

Link to comment
Share on other sites

Ok when i do the prechecks i get temp.character table doesn't exist?

 

Fixed.

 

I tested with temp_character_data as a table.  Have changed it back to character_data in the first post.  Checked the post install SQL (historical realignment of buildables) and they seem fine.

 

Have found two new issues.  Neither particularly big.

 

1. The Show Plot Boundary menu item does not disappear but stays on the scroll menu wherever you look.

  • Should be fairly easy to resolve.  Will look tomorrow as it is now midnight here.  (Non issue.  works fine on re-testing).

2. Friendly builders cannot build on another friendly owners plot until they look at the owner first (yep you hear that right :wacko: ).

  • This is part of the original (DayZ / Epoch) code and not anything I have added.

 Looking at the plot owner sets the "friendlyTo" variable if both are tagged as friendly to each other but the variable is not persistent.  I am having trouble understanding the logic for it rather than just checking the friendly variables of both the builder and owner but this is the way it is currently.

 

At this point I can

  • Leave it
  • Change it to check the friendlies value which is saved in the hive and is persistent.

If anyone has any background on why the friendlyTo variable is being used, I would love to hear.

 

Let me know your preferences for how to handle and I will go with the majority.   To change it is minor work but is in multiple files (already edited for this mod).

 

RB

Link to comment
Share on other sites

There is version info at the top of the first post.

 

v1.0 -> v1.1 only has the addition of the plot pole boundary which can be done independently if desired so has its own install section at the bottom of the first post.

 

Bug fixes are in individual posts when found and fixed with info on what needs to be changed based on the main install so people with it installed already just need to make those small changes.  The first post is also updated to reflect the bug fix for new installers.

 

The issue posted above with the plot pole boundary menu item not disappearing is a non-issue.  It is working just fine.  Just takes a few seconds if the menu is up and you turn away before it vanishes from the options.

 

RB

Link to comment
Share on other sites

To make it simple for new server builders, I will be packaging a release of this mod for download.

 

This package will only be for installing on new Epoch server builds as it will overwrite key files that other mods may be dependant on.

 

Will post with a link when the package is ready for download.

 

RB

Link to comment
Share on other sites

Ok, will take a look.

 

I don't believe tagging affects opening packs as non-friendlies stealing from people while they are trading seems to be an issue on servers.  It may be something to think about though.

 

Do you have any other mods installed ?.

 

Glad the tagging for building is verified.

 

Thanks

Link to comment
Share on other sites

That is probably the reason.

 

The old tagging used the charID.  The new tagging used the PlayerUID converted in to a number (some playerUIDs can have letters as well).

 

The conversion needs to be done on anything that used the tagging to check.

 

If you are able to direct me to the post or post the code up here I can probably advise on the changes that need to be made.  They are probably pretty simple.

 

RB

Link to comment
Share on other sites

I think i found it and looks easy enough.

 

fn_gearmenuchecks i have this

// IN SAFE ZONE
if( !canbuild ) then
{
	if( isPlayer cursorTarget and alive cursorTarget and vehicle cursorTarget == cursorTarget ) then
	{
		_friendlies = player getVariable ["friendlyTo",[]];
		_ownerID = cursorTarget getVariable ["CharacterID", "0"];

		_friend = _ownerID in _friendlies;

		// check if friendly to owner
		if( !_friend ) then {
			cutText["\n\nBag access is restricted in safe trader zones except with those tagged as friendly.", "PLAIN DOWN",0];
			_display closeDisplay 1;
		};
	};
};

I changed CharacterID to playerUID and added it to the private array at the top, this should fix it correct?

Link to comment
Share on other sites

Just tested on my server, works fine! :)

Thank you for the release!

 

 

Thanks, it is always good to hear it is working as expected.

 

I think i found it and looks easy enough.

 

fn_gearmenuchecks i have this

// IN SAFE ZONE
if( !canbuild ) then
{
	if( isPlayer cursorTarget and alive cursorTarget and vehicle cursorTarget == cursorTarget ) then
	{
		_friendlies = player getVariable ["friendlyTo",[]];
		_ownerID = cursorTarget getVariable ["CharacterID", "0"];

		_friend = _ownerID in _friendlies;

		// check if friendly to owner
		if( !_friend ) then {
			cutText["\n\nBag access is restricted in safe trader zones except with those tagged as friendly.", "PLAIN DOWN",0];
			_display closeDisplay 1;
		};
	};
};

I changed CharacterID to playerUID and added it to the private array at the top, this should fix it correct?

 

Almost.

 

As some PlayerUIDs can have characters and the ids are being stored in a numberic field (object_data -> characterID) for the buildables, we need to convert, where needed, to numeric.

 

To run the conversion we use (<> denotes a value you need to put in, without the "<>".

<result variable> = [<object>] call convertPlayerUID;

<Result variable> = The variable you need the converted PlayerUID placed in.

<object> = The input object that have the PlayerUID you need to convert.

 

For your case I would try.

 

FInd

_ownerID = cursorTarget getVariable ["CharacterID", "0"]; 

Change to

_ownerID = [cursorTarget] call convertPlayerUID;

RB

Link to comment
Share on other sites

Thanks.

 

I have tried to make it as [copy] -> [find] -> [copy] -> [paste] as possible.

 

I will get round to releaseing a package which people can then just extract to a vanilla Epoch server and be good to go.  Probably will get this done over the weekend.

 

Good to hear it has stood up well with such numbers.  This solution will work for now and I have tried to build in some longevity by allowing it to convert any characters in the PlayerUID rather than just known combinations that exist today as other mods have but I will get out a much more robust solution soon(ish) after I finish my Better Refueling project.  The better solution will not use any conversion so the PlayerUIDs will always be unique and buildables will be linked to the plot poles rather than the players.  Plot pole owners and authorised builders will be saved with the plot pole data. 

 

@Line2.lv : Any luck with that script ?.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...