Question about "cargo tower"

Question about "cargo tower"

« posted: Nov 26, 2019, 12:15 PM »
Hello

One of players on our server asked, if it's possible to Increase "durability/HP" for destructible objects from general store like is cargo tower.
Is there a way how to do it? Now it's like the tower can survive one, two hits from launcher/APDSFS .

I don't want to make them immortal only more durable.

Thank you for any idea.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2581

Re: Question about "cargo tower"

« Reply #1 posted: Nov 26, 2019, 02:13 PM »
Add this in vehicleSetup.sqf immediately after clearItemCargoGlobal _vehicle;

Code: [Select]
// Make cargo towers more durable
if (_class isKindOf "Cargo_Tower_base_F") then
{
_vehicle setVariable ["A3W_handleDamageEH", _vehicle addEventHandler ["HandleDamage", { (_this select 2) * 0.1 }]];
};

0.1 is the damage multiplier, adjust it as you see fit.

Re: Question about "cargo tower"

« Reply #2 posted: Nov 26, 2019, 04:27 PM »
Thank you again Rev :)

Re: Question about "cargo tower"

« Reply #3 posted: Nov 26, 2019, 07:12 PM »
And if i want to extend this damage reduction to other buildings like
"Land_Repairdepot_01_green_F"
Should I add it into code like
Code: [Select]
if ({_class isKindOf _x} count ["Cargo_Patrol_base_F","Cargo_Tower_base_F","Repairdepot_base_F"] > 0) then
{
_vehicle setVariable ["A3W_handleDamageEH", _vehicle addEventHandler ["HandleDamage", { (_this select 2) * 0.5 }]];
};

Or somehow else?
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2581

Re: Question about "cargo tower"

« Reply #4 posted: Nov 26, 2019, 07:13 PM »
Yup

Re: Question about "cargo tower"

« Reply #5 posted: Nov 26, 2019, 07:20 PM »
thank you :)