Jump to content

[Release] 2.1 Plot Management - UPDATED Object Counter


Zupa

Recommended Posts

Hey Guys,

 

Not sure why, but when i maintain at a plotpole, its takes the full amount, however only maintains a single item. I have to maintain for each item, being charges the full amount each time. not sure if this is something which i've done :/

 

I'm using the Single Currency version of PM.

private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option"];
disableSerialization;

if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;

player removeAction s_player_maintain_area;
s_player_maintain_area = 1;
player removeAction s_player_maintain_area_preview;
s_player_maintain_area_preview = 1;

_target = cursorTarget;

_objectClasses = DZE_maintainClasses;
_range = DZE_PlotPole select 0;
_objects = nearestObjects [_target, _objectClasses, _range];

_objects_filtered = [];
{
    if (damage _x >= DZE_DamageBeforeMaint) then {
        _objects_filtered set [count _objects_filtered, _x];
   };
} count _objects;
_objects = _objects_filtered;

_count = count _objects;

if (_count == 0) exitWith {
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
			_result =  format["Objects to maintain: %1" , _count];
			_ctrl ctrlSetText   _result;
		
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
			_result =  format["Price to maintain: %1 %2" , 0, CurrencyName];
			
			_ctrl ctrlSetText   _result;	
	DZE_ActionInProgress = false;
	s_player_maintain_area = -1;
	s_player_maintain_area_preview = -1;
};

_theCost = _count * 100;
_requirements = [[CurrencyName,_theCost]];


_option = _this select 0;
switch _option do {
	case "maintain": {
		
		_wealth = player getVariable["headshots",0];
		_missing = "";
		_missingQty = 0;
		_proceed = true;
		{
			_itemIn = _x select 0;
			_countIn = _x select 1;
			if (_wealth < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _wealth); _proceed = false; };
		} count _requirements;

		if (_proceed) then {
			_newWealth = (_wealth - _countIn);
			player playActionNow "Medic";
			[player,_range,true,(getPosATL player)] spawn player_alertZombies;

			player setVariable["headshots",_newWealth,true];

			PVDZE_plr_Save = [player,(magazines player),true,true];
			publicVariableServer "PVDZE_plr_Save";
			
			PVDZE_maintainArea = [player,1,_target];
			publicVariableServer "PVDZE_maintainArea";
			
			
			cutText [format[(localize "STR_EPOCH_ACTIONS_4"), _count], "PLAIN DOWN", 5];			
			
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
			_result =  format["SUCCESS : Objects maintained: %1" , _count];
			_ctrl ctrlSetText   _result;
		
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
			_result =  format["SUCCESS : Price maintained: %1 %2" , _theCost, CurrencyName];
			_ctrl ctrlSetText   _result;	
				
		} else {
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
			_result =  format["FAILED: Objects to maintain: %1" , _count];
			_ctrl ctrlSetText   _result;
		
			_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
			_result =  format["FAILED: Price to maintain: %1 %2" , _theCost, CurrencyName];
			_ctrl ctrlSetText   _result;	
			
			cutText [format[(localize "STR_EPOCH_ACTIONS_6"), _missingQty, CurrencyName], "PLAIN DOWN"];
		};
	};
	
	case "preview": {
		_cost = "";
		{
			_itemIn = _x select 0;
			_countIn = _x select 1;
			if (_cost != "") then {
				_cost = _cost + " and ";
			};
			_cost = _cost + (str(_countIn) + " " + CurrencyName);
		} count _requirements;
			
		cutText [format[(localize "STR_EPOCH_ACTIONS_7"), _count, _cost], "PLAIN DOWN"];
			
		_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7012);
		_result =  format["Objects to maintain: %1" , _count];
		_ctrl ctrlSetText   _result;
		
		_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7013);
	    _result =  format["Price to maintain: %1 %2" , _theCost, CurrencyName];
		_ctrl ctrlSetText   _result;								
	};
};

DZE_ActionInProgress = false;
s_player_maintain_area = -1;
s_player_maintain_area_preview = -1;
Link to comment
Share on other sites

For some reason with plot management anybody is able to remove any non-locked doors even if they are not on the plot pole or the one who placed the object

 

 

I am getting this issue too. People are able to remove any modular object on the server, owner or not, on the plot pole or not.

 

We are using snap pro and vector building, not sure if one of these has an issue.

Link to comment
Share on other sites

OK updated to 2.2

 

Instructions updated on place 5C and 6 to support the removing of objects correctly.

 

OPTIONAL FOR YOU

 

Replace your Defines.sqf and plotManagement.hpp from your folder with the ones from github to have a visual update. 

 

The visual update wil make the buttons into blue buttons like the following dialog:

 

7xKeniR.jpg

Link to comment
Share on other sites

so I'm a little confused on the practical difference between plot management and plot for life. In this script if you add yourself to the management group then you retain your plot poles after you die correct. 

 

So why would you even need the plot for life?

 

PlotManagement runs the best ON plot 4 life. ( but can be used individually if preferred)

 

  1. You don't need to put yourself on the plot (P4L) - You will always be the biggest boss on the plot ( even when a friend removes u)
  2. You can delete your walls that are not in plotradius ( P4L)
  3. Claim Plot ( P4L)

 

P4L is not just a script for only plotpoles, it affects any object in game where other scriptwriters can take advantage of ^^

Link to comment
Share on other sites

PlotManagement runs the best ON plot 4 life. ( but can be used individually if preferred)

 

  1. You don't need to put yourself on the plot (P4L) - You will always be the biggest boss on the plot ( even when a friend removes u)
  2. You can delete your walls that are not in plotradius ( P4L)
  3. Claim Plot ( P4L)

 

P4L is not just a script for only plotpoles, it affects any object in game where other scriptwriters can take advantage of ^^

Ahh. ok. Think i understand now thank you zupa. This will be my next upgrade so i wanted to get it clear in my head first.

Link to comment
Share on other sites

ooh I didn't notice the fancy appearance update until now, but I was going to note that what you had suggested about the change to items count worked perfectly and cars, zombies, players and loot piles are no longer being counted against the build limit. :D

 

I was also wondering if there was a specific method of doing a damage action on items for a decay of indestructible bases that would work best with plot/door management, or if it really makes any difference at all how I choose to do it?

Link to comment
Share on other sites

Hey Zupa I got this problem:

Got SC2.0v0.4 and Vector Build + Snap Pro installed (no P4L)
Placed some buildables to test snap build .. all working, I get remove option (important) looking at the things.
After I installed plot management on top of that I cant seem to be able to remove things anymore, I do not get any options for removal.

Tried adding me to the plotpole, nothing, restarted server, nothing aswell.
This is kinda weird, why isn't working, I dont want to have to use P4L, because with P4L for my earlier missionfile it worked always flawlessly.

Link to comment
Share on other sites

Hello,

After installing I'm having problems connecting to the server at all - I get stuck on 'wait for host'.

Using Snap Pro, DZGM, Epoch Admin Tools, and a few others..

I've already got a define.hpp file declared in description.ext from DZGM as well as 'dialog.hpp' from I'm not really sure how to combine them, or if they can exist simultaneously.

 

Here is the define.hpp from DZGM

 

class W_RscText {

idc = -1;

type = 0;

style = 0x00;

colorBackground[] = { 1 , 1 , 1 , 0 };

colorText[] = { 1 , 1 , 1 , 1 };

font = "Zeppelin32";

sizeEx = 0.025;

h = 0.25;

text = "";

};

class W_RscStructuredText

{

access = 0;

type = 13;

idc = -1;

style = 0;

colorText[] = {0.8784,0.8471,0.651,1};

class Attributes

{

font = "Zeppelin32";

color = "#e0d8a6";

align = "center";

shadow = 1;

};

x = 0;

y = 0;

h = 0.035;

w = 0.1;

text = "";

size = 0.03921;

shadow = 2;

};

class W_RscList

{

type = 5;

style = 69;

idc = -1;

text = "";

w = 0.275;

h = 0.04;

colorSelect[] = {1, 1, 1, 1};

colorText[] = {1, 1, 1, 1};

colorBackground[] = {1,1,1,1};

colorSelectBackground[] = {0.40, 0.43, 0.28, 0.5};

colorScrollbar[] = {0.2, 0.2, 0.2, 1};

arrowEmpty = "\ca\ui\data\ui_arrow_combo_ca.paa";

arrowFull = "\ca\ui\data\ui_arrow_combo_active_ca.paa";

wholeHeight = 0.45;

rowHeight = 0.04;

color[] = {0.7, 0.7, 0.7, 1};

colorActive[] = {0,0,0,1};

colorDisabled[] = {0,0,0,0.3};

font = "Zeppelin32";

sizeEx = 0.023;

soundSelect[] = {"",0.1,1};

soundExpand[] = {"",0.1,1};

soundCollapse[] = {"",0.1,1};

maxHistoryDelay = 1;

autoScrollSpeed = -1;

autoScrollDelay = 5;

autoScrollRewind = 0;

class ScrollBar

{

color[] = {1, 1, 1, 1};

colorActive[] = {1, 1, 1, 1};

colorDisabled[] = {1, 1, 1, 1};

thumb = "\ca\ui\data\ui_scrollbar_thumb_ca.paa";

arrowFull = "\ca\ui\data\ui_arrow_top_active_ca.paa";

arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa";

border = "\ca\ui\data\ui_border_scroll_ca.paa";

};

};

class W_RscPicture

{

idc = -1;

type = 0;

style = 48;

font = "Zeppelin32";

sizeEx = 0.023;

colorBackground[] = {};

colorText[] = {};

x = 0.0; y = 0.2;

w = 0.2; h = 0.2;

text = "";

};

class W_RscButtonBase {

idc = -1;

type = 16;

style = 0;

w = 0.183825;

h = 0.104575;

color[] = {0.95, 0.95, 0.95, 1};

color2[] = {1, 1, 1, 0.4};

colorBackground[] = {1, 1, 1, 1};

colorbackground2[] = {1, 1, 1, 0.4};

colorDisabled[] = {1, 1, 1, 0.25};

periodFocus = 1.2;

periodOver = 0.8;

class HitZone {

left = 0.004;

top = 0.029;

right = 0.004;

bottom = 0.029;

};

class ShortcutPos {

left = 0.004;

top = 0.026;

w = 0.0392157;

h = 0.0522876;

};

class TextPos {

left = 0.05;

top = 0.025;

right = 0.005;

bottom = 0.025;

};

animTextureNormal = "\ca\ui\data\ui_button_normal_ca.paa";

animTextureDisabled = "\ca\ui\data\ui_button_disabled_ca.paa";

animTextureOver = "\ca\ui\data\ui_button_over_ca.paa";

animTextureFocused = "\ca\ui\data\ui_button_focus_ca.01.paa";

animTexturePressed = "\ca\ui\data\ui_button_down_ca.paa";

animTextureDefault = "\ca\ui\data\ui_button_default_ca.paa";

textureNoShortcut = "";

period = 0.4;

font = "Zeppelin32";

size = 0.023;

sizeEx = 0.023;

text = "";

soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.09, 1};

soundPush[] = {"\ca\ui\data\sound\new1", 0.09, 1};

soundClick[] = {"\ca\ui\data\sound\mouse3", 0.07, 1};

soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.09, 1};

action = "";

class Attributes {

font = "Zeppelin32";

color = "#E5E5E5";

align = "left";

shadow = "1";

};

class AttributesImage {

font = "Zeppelin32";

color = "#E5E5E5";

align = "left";

};

};

class W_RscButton : W_RscButtonBase {

w = 0.183825;

h = 0.0522876;

style = 2;

color[] = {1, 1, 1, 1};

color2[] = {1, 1, 1, 0.85};

colorBackground[] = {1, 1, 1, 1};

colorbackground2[] = {1, 1, 1, 0.85};

colorDisabled[] = {1, 1, 1, 0.4};

class HitZone {

left = 0.002;

top = 0.003;

right = 0.002;

bottom = 0.016;

};

class ShortcutPos {

left = -0.006;

top = -0.007;

w = 0.0392157;

h = 0.0522876;

};

class TextPos {

left = 0.002;

top = 0.014;

right = 0.002;

bottom = 0.005;

};

animTextureNormal = "\ca\ui\data\igui_button_normal_ca.paa";

animTextureDisabled = "\ca\ui\data\igui_button_disabled_ca.paa";

animTextureOver = "\ca\ui\data\igui_button_over_ca.paa";

animTextureFocused = "\ca\ui\data\igui_button_focus_ca.paa";

animTexturePressed = "\ca\ui\data\igui_button_down_ca.paa";

animTextureDefault = "\ca\ui\data\igui_button_normal_ca.paa";

animTextureNoShortcut = "\ca\ui\data\igui_button_normal_ca.paa";

class Attributes {

font = "Zeppelin32";

color = "#E5E5E5";

align = "center";

shadow = "1";

};

};

 

Is it possible to just copy the relevant parts from Plot Management's define.hpp and paste it into my existing one?

Also I made a custom copy of 'server_monitor.sqf' and redirected it in 'init.sqf', do I have to do the same for 'server_updateObject.sqf' ? If so, where do I enter the new file path (couldn't find in init)?

I've already changed the filepaths for player_upgrade, player_buildingDowngrade and player_build.

 

EDIT: Fixed - went through the .rpt file and looked at the errors individually.

 

What did you do to fix the error with the admin tools looked in the define.hpp and the plotman. and tools dialog.hpp use the class RscShortcutButton. 

 

 

 

NEVER MIND just merged the two and no errors now.

Link to comment
Share on other sites

Has anybody gotten their mantain to work properly? Mine for some reason will maintain the items but will not reset my damage, thus not updating the items in the database, which then get deleted for not being updated, so now I have a prevent cleanup SQL running to update them automatically, but of course after a while abandoned bases pile up

Link to comment
Share on other sites

Hey guys ive tried to fix this for like 3 hrs now finally broke down and cant take no more lol. please help !

 

its working fully now but soon as server restarts it forgets all plotfriends  and have to replace the plothole if owner died still and re add everyone so kind of defeats the purpose lol

 

Am i missing something where it stores the data ?

 

much <3 great mod

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