Jump to content

[Outdated] [release] 1.0.6 - Deploy Anything 2.8.2 - Now with Epoch building! | Customizable: DB saving | Plot | Vehicles/Buildings | Packing


mudzereli

Recommended Posts

We're having a problem where players have worked out that you can build a bike half into a wall, get on it and pass through the wall without triggering the anti-wall protection.

In the deploy config I see we can add a condition at the end. does anyone know what the code would be to not let players deploy a bike within x metres of a plot pole?

Thanks

Link to comment
Share on other sites

Just now, ReDBaroN said:

We're having a problem where players have worked out that you can build a bike half into a wall, get on it and pass through the wall without triggering the anti-wall protection.

In the deploy config I see we can add a condition at the end. does anyone know what the code would be to not let players deploy a bike within x metres of a plot pole?

Thanks

maybe a better idea is add a nearest wall restriction in player_deploy.sqf

Spoiler

FIND:
//### BEGIN MODIFIED CODE: player_deploy
//_classname =    getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
//_classnametmp = _classname;
//_require =  getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
//_text =         getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
//_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
_classname      = _index call getDeployableClass;
_classnametmp   = _classname;
_require        = [];
_text           = _index call getDeployableDisplay;
_ghost          = "";
//### END MODIFIED CODE: player_deploy

PASTE BELOW:



_pos = [player] call FNC_GetPos;
_NOTALLOW = ["WoodSmallWall_DZ","CinderWallHalf_DZ","CinderWall_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorway_DZ","WoodSmallWallThird_DZ",
"WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","Land_DZE_WoodDoor","Land_DZE_WoodDoorLocked","Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","WoodLargeWall_DZ",
"WoodLargeWallWin_DZ","WoodLargeWallDoor_DZ","Land_DZE_LargeWoodDoor","Land_DZE_LargeWoodDoorLocked"];

_nearRestr = count nearestObjects [_pos, _NOTALLOW, 5] > 0;

if (_nearRestr && (_classname isKindOf "MMT_Civ")) exitWith {
dayz_actionInProgress = false;
systemChat("Bikes Not Allowed near of walls");
};

if ure using Two diferents bikes.. then add another check:

_pos = [player] call FNC_GetPos;
_NOTALLOW = ["WoodSmallWall_DZ","CinderWallHalf_DZ","CinderWall_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorway_DZ","WoodSmallWallThird_DZ",
"WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","Land_DZE_WoodDoor","Land_DZE_WoodDoorLocked","Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","WoodLargeWall_DZ",
"WoodLargeWallWin_DZ","WoodLargeWallDoor_DZ","Land_DZE_LargeWoodDoor","Land_DZE_LargeWoodDoorLocked"];

_nearRestr = count nearestObjects [_pos, _NOTALLOW, 5] > 0;

if (_nearRestr && (_classname isKindOf "MMT_Civ")or (_classname isKindOf "Old_bike_TK_INS_EP1")) exitWith {
dayz_actionInProgress = false;
systemChat("Bikes Not Allowed near of walls");
};

Link to comment
Share on other sites

12 minutes ago, juandayz said:

maybe better is add a nearest wall restriction in player_deploy.sqf


FIND:
//### BEGIN MODIFIED CODE: player_deploy
//_classname =    getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
//_classnametmp = _classname;
//_require =  getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
//_text =         getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
//_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
_classname      = _index call getDeployableClass;
_classnametmp   = _classname;
_require        = [];
_text           = _index call getDeployableDisplay;
_ghost          = "";
//### END MODIFIED CODE: player_deploy

PASTE BELOW:



_pos = [player] call FNC_GetPos;
_NOTALLOW = ["WoodSmallWall_DZ","CinderWallHalf_DZ","CinderWall_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorway_DZ","WoodSmallWallThird_DZ",
"WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","Land_DZE_WoodDoor","Land_DZE_WoodDoorLocked","Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","WoodLargeWall_DZ",
"WoodLargeWallWin_DZ","WoodLargeWallDoor_DZ","Land_DZE_LargeWoodDoor","Land_DZE_LargeWoodDoorLocked"];

_nearRestr = count nearestObjects [_pos, _NOTALLOW, 5] > 0;

if (_nearRestr && (_classname isKindOf "MMT_Civ")) exitWith {
dayz_actionInProgress = false;
systemChat("This Object is Not Allowed near of a wall");
};

 

I think this is a really good solution, but I think it should be further down after you place the deployable, since the player can be away from the wall/door but the deployable can be "inside" it

Link to comment
Share on other sites

1 minute ago, salival said:

I think this is a really good solution, but I think it should be further down after you place the deployable, since the player can be away from the wall/door but the deployable can be "inside" it

Good point. Maybe if we increase the distance from walls? Same distance as the offset of the bike?

Link to comment
Share on other sites

This is the version I settled on:

in player_deploy.sqf find this line (or similar): 

	if (!(_index call getDeployableBuildOnRoad)) then {if (isOnRoad [_position select 0, _position select 1, 0]) then { _cancel = true; _reason = localize "STR_EPOCH_BUILD_FAIL_ROAD";};};

Add this code block after it:

	if (_classname isKindOf "MotorCycle") then {
		if (count (nearestObjects [_position, ["Building","DZE_Housebase"], 5]) > 0) then {
			_cancel = true; 
			_reason = format ["%1 can not be built near a wall/door",_text];
		};
	};

 

Link to comment
Share on other sites

  • 1 month later...

We use "Land_MBG_Garage_Single_A" as a deployable garage and link virtual garage to this building. When a player deploys this they will only get the pack option during that life. If they die, they lose the option.

["ItemToolbox",[0,9,2],5,0.9,false,true,false,true,true,false,false,["Land_MBG_Garage_Single_A"],[],["ItemTopaz"],"true"]

As you can see above, we have the option "_packAny      | can anyone repack the deployable?" set to false to prevent random players packing the garage and getting the garage owner's Topaz but, I think it's this that's linking it to character ID which refreshes for players each time they die.

Is there a way to modify the code somehow so it works the same way as other epoch base parts since Plot for Life was built in with version 106?

Link to comment
Share on other sites

4 hours ago, ReDBaroN said:

We use "Land_MBG_Garage_Single_A" as a deployable garage and link virtual garage to this building. When a player deploys this they will only get the pack option during that life. If they die, they lose the option.


["ItemToolbox",[0,9,2],5,0.9,false,true,false,true,true,false,false,["Land_MBG_Garage_Single_A"],[],["ItemTopaz"],"true"]

As you can see above, we have the option "_packAny      | can anyone repack the deployable?" set to false to prevent random players packing the garage and getting the garage owner's Topaz but, I think it's this that's linking it to character ID which refreshes for players each time they die.

Is there a way to modify the code somehow so it works the same way as other epoch base parts since Plot for Life was built in with version 106?

you could keep it as anyone can repack the deployable and then add it to the garage to restrict removal variable in your ConfigVariables.sqf. The restrict removal option keeps anyone from removing anything from your plot thats in that array without permission on the plot pole first.

Link to comment
Share on other sites

I'm using your script and it runs fine, works etc. However players are saying they don't get the option to pack or its very difficult to see (EG it only stays for half a second and then they have try and get it again). Whenever I look at the bike its very easy to pack, is there a reason why its hard for players to see the option?

Link to comment
Share on other sites

@Runewulv Thanks for that idea! :smile: 

@l1nkrx7 DB saving already works. Check the config file and make sure you have the DB saving set to true for the deploy option you're having problems with

@Rust You need to add exceptions to your Allowed actions array in infistar:

/*  ALLOWED Actions "_dayzActions" are only used if you have "_CSA =  true;"  */
_dayzActions =
[
......,"DZE_ACTION_DEPLOYABLE_PACK_0","DZE_ACTION_DEPLOYABLE_PACK_2"
];

So, in my example above the first option in the config to deploy that you also want to pack is DZE_ACTION_DEPLOYABLE_PACK_0. I don't need to pack the next on the list but, do with the 3rd hence, DZE_ACTION_DEPLOYABLE_PACK_2

Hope that makes sense... :) 

Link to comment
Share on other sites

On 8/22/2017 at 2:10 PM, salival said:

I'm at work at the moment but I stopped using publish_vehicle2 or whatever it is and just used obj publish, there's other stuff to be done to fix it but that's the general thing.

I may look at releasing my fork at some point (there's lots of changes not on my repo 9of my fork) that fixes a lot more things and is designed for static guns/building deployables.s.

@l1nkrx7 This was posted by @salival and this is the fix. I'll show you what my player_deploy.sqf looks like: 

search for if (_proceed) then {

Spoiler

if (_proceed) then {
            if([player,_index] call getHasDeployableParts) then {
                [player,_index] call removeDeployableParts;
                [format[localize "str_build_01",_text],1] call dayz_rollingMessages;
                _tmpbuilt setVariable ["OEMPos",_location,true];
                if (_index call getPermanent) then {
                    _tmpbuilt call fnc_set_temp_deployable_id;
                    if(_index call getDeployableSimulation) then {
                        PVDZ_obj_Publish = [call fnc_perm_deployable_id,_tmpbuilt,[_dir,_position],(_index call getDeployableClass)];
                        publicVariableServer "PVDZ_obj_Publish";
                    } else {
                        PVDZ_obj_Publish = [call fnc_perm_deployable_id,_tmpbuilt,[_dir,_position],(_index call getDeployableClass)];
                        publicVariableServer "PVDZ_obj_Publish";
                    };
                } else {
                    _tmpbuilt call fnc_set_temp_deployable_id;
                };
                if . . . . . ... . . . .. . 

so if you just have it save as object as @salival said then it will work as intended.

Link to comment
Share on other sites

Spoiler

 

On 11/30/2017 at 9:58 PM, ReDBaroN said:

@Runewulv Thanks for that idea! :smile: 

@l1nkrx7 DB saving already works. Check the config file and make sure you have the DB saving set to true for the deploy option you're having problems with

@Rust You need to add exceptions to your Allowed actions array in infistar:



/*  ALLOWED Actions "_dayzActions" are only used if you have "_CSA =  true;"  */
_dayzActions =
[
......,"DZE_ACTION_DEPLOYABLE_PACK_0","DZE_ACTION_DEPLOYABLE_PACK_2"
];

So, in my example above the first option in the config to deploy that you also want to pack is DZE_ACTION_DEPLOYABLE_PACK_0. I don't need to pack the next on the list but, do with the 3rd hence, DZE_ACTION_DEPLOYABLE_PACK_2

Hope that makes sense... :) 

Thanks for that, worked perfect 

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

Hi all !

When I deploy a HeliPad (for salival's VirtualGarage script) I see a message "This vehicle is permanent and will persist through server restarts!".

But after restart a helipad disappears. I using this line in config:

["ItemToolbox",[0,9,2],5,0.9,false,true,false,true,true,false,true,["HeliHCivil"],[],[],"true"]

And one more question:

Where can I change the width of buttons? Screenshot.

Link to comment
Share on other sites

I have the same problem
8 hours ago, WLF said:

Hi all !

When I deploy a HeliPad (for salival's VirtualGarage script) I see a message "This vehicle is permanent and will persist through server restarts!".

But after restart a helipad disappears. I using this line in config:


["ItemToolbox",[0,9,2],5,0.9,false,true,false,true,true,false,true,["HeliHCivil"],[],[],"true"]

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...