Jump to content

HOW TO: Vehicles indestructible within plot area


BigEgg

Recommended Posts

Vehicles indestructible within plot is part of Epoch 1.0.7.1 now.

 

Looked around and saw that some people were requesting this, it is actually quite simple:

 

What it does:

Makes vehicles indestructible within the plot area (default 30 meters) , but only if they are locked and no players are in them.

 

Step 1:

In your custom compiles.sqf add: (NOTE - CHANGE THE FILE PATH TO FIT YOUR NEEDS)

fnc_veh_handleDam = compile preprocessFileLineNumbers "FILE\PATH\HERE\veh_handleDam.sqf";

below the if (!isDedicated) code block. Example:

if (!isDedicated) then {
	/*************/
	/* Code Here */
	/*************/
};

fnc_veh_handleDam = compile preprocessFileLineNumbers "FILE\PATH\HERE\veh_handleDam.sqf";

 

Step 2:

Copy veh_handleDam.sqf into your mission file from \z\addons\dayz_code\compile\veh_handleDam.sqf

 

Step 3:

In veh_handleDam.sqf find:

_total = _this select 2;

Below it add:

if (locked _unit && {count (crew _unit) == 0} && {count (_unit nearEntities ["Plastic_Pole_EP1_DZ", DZE_PlotPole select 0]) > 0}) exitWith {0};

 

Done!

 

NOTE:

You can change the distance it applies to by changing the DZE_PlotPole variable:

DZE_PlotPole = [30,90];

Or, you can set it independent of the variable by changing it to this:

if (locked _unit && {count (crew _unit) == 0} && {count (_unit nearEntities ["Plastic_Pole_EP1_DZ", 40]) > 0}) exitWith {0};

and modifying the number (in this case it is 40) to whatever you would like. Keep in mind that the number represents the radius from the plot pole in meters.

Link to comment
Share on other sites

hmm this didnt work for me.

Double checked the instructions and vehicles still take damage. One thing i did notice when i was testing zupas original script, the vehicles never took damage UNTIL i got in the driver seat.

Same thing happens here. as soon as i get in the driver seat and lock the vehicle, its able to take damage.

Link to comment
Share on other sites

5 minutes ago, theduke said:

hmm this didnt work for me.

Double checked the instructions and vehicles still take damage. One thing i did notice when i was testing zupas original script, the vehicles never took damage UNTIL i got in the driver seat.

Same thing happens here. as soon as i get in the driver seat and lock the vehicle, its able to take damage.

If you are using safezones, be sure to adjust the path there too. Chances are you have the path set back to default for veh_handleDam.sqf - if you don't adjust it, your client will take that variable and won't call the one in your mission.

Link to comment
Share on other sites

4 minutes ago, theduke said:

hmm this didnt work for me.

Double checked the instructions and vehicles still take damage. One thing i did notice when i was testing zupas original script, the vehicles never took damage UNTIL i got in the driver seat.

Same thing happens here. as soon as i get in the driver seat and lock the vehicle, its able to take damage.

are you sure you added

fnc_veh_handleDam = compile preprocessFileLineNumbers "FILE\PATH\HERE\veh_handleDam.sqf";

 

BELOW the isdedicated block? So after the };

it needs to get compiled on both to work, i made this mistake with the first test, i put it inside the { }; from it, it didnt work that way but works if you put it below it

 

Link to comment
Share on other sites

Just now, BigEgg said:

If you are using safezones, be sure to adjust the path there too. Chances are you have the path set back to default for veh_handleDam.sqf - if you don't adjust it, your client will take that variable and won't call the one in your mission.

actually im setting up a lingor server atm and dont have safezones yet. and right after i posted the above issue, I realized i was spawning it in with infistar.  So i jsut went back in and bought a vehicle. same thing...

Link to comment
Share on other sites

1 minute ago, LunatikCH said:

are you sure you added


fnc_veh_handleDam = compile preprocessFileLineNumbers "FILE\PATH\HERE\veh_handleDam.sqf";

 

BELOW the isdedicated block? So after the };

it needs to get compiled on both to work, i made this mistake with the first test, i put it inside the { }; from it, it didnt work that way but works if you put it below it

 

yes i did

Link to comment
Share on other sites

1 minute ago, theduke said:

actually im setting up a lingor server atm and dont have safezones yet. and right after i posted the above issue, I realized i was spawning it in with infistar.  So i jsut went back in and bought a vehicle. same thing...

Make sure you don't have fnc_veh_handleDam defined anywhere else. This is the only thing I can think of. 

Link to comment
Share on other sites

not sure if that matters since it is compiled on both, i have tested it 20 minutes with like every possible way of the vehicle beeing in/out of the zone with player in it and not, putting a plot next to the vehilce, removing a plot which is near a vehicle and what not, all works as it should regarding to positive/negative checks

Link to comment
Share on other sites

Just now, LunatikCH said:

not sure if that matters since it is compiled on both, i have tested it 20 minutes with like every possible way of the vehicle beeing in/out of the zone with player in it and not, putting a plot next to the vehilce, removing a plot which is near a vehicle and what not, all works as it should regarding to positive/negative checks

Do you have safezones??

Link to comment
Share on other sites

Just now, LunatikCH said:

sure, ofc i made the change for the veh_handleDam in there aswell, as said above, all works as it should

Yeah I am feeling like having safezones and not having them makes a difference. I am going to do some testing on this later.

Link to comment
Share on other sites

18 minutes ago, theduke said:

so this whole time i was testing out zupas old script....it probably was working haha ahh well i learnt something new today...check for overrides lol

Yes haha - very very important that there are no overrides!

Link to comment
Share on other sites

  • 2 weeks later...

Ok so yes i've been trying to get the locked vehicles in god mode with gear and over the map...

So i was trying way too hard to try to accomplish this lol

Simply remove the check for plot pole, done lol

if (locked _unit && (count(crew _unit)) == 0) exitWith {};

I've tested this, and it works great even with gear (one weapon and one magazine)

I was so overthinking it trying to use zupas old script haha

Thx @BigEgg

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Advertisement
  • Discord

×
×
  • Create New...