I'm running 1.0.4, I have CPC Indestructible Bases script, which I modified a bit so that locked doors are excluded. I modified the array in dayz_server -> system\server_monitor.sqf to reflect the changes I wished to make, so that when server starts, any walls or floors that are in the database will be indestructible, except of course for the locked doors, which I commented out.
/ ### [CPC] Indestructible Buildables Fix _cpcimmune =[ "WoodFloor_DZ", "WoodFloorHalf_DZ", "WoodFloorQuarter_DZ", "WoodLargeWallDoor_DZ", "WoodLargeWallWin_DZ", "WoodLargeWall_DZ", "WoodSmallWallDoor_DZ", "WoodSmallWallWin_DZ", "Land_DZE_WoodDoor", //"Land_DZE_WoodDoorLocked", "Land_DZE_LargeWoodDoor", //"Land_DZE_LargeWoodDoorLocked", "Land_DZE_GarageWoodDoor", //"Land_DZE_GarageWoodDoorLocked", "WoodLadder_DZ", "WoodStairsSans_DZ", "WoodStairs_DZ", "WoodSmallWall_DZ", "WoodSmallWallThird_DZ", "CinderWallHalf_DZ", "CinderWall_DZ", "CinderWallDoorway_DZ", "CinderWallDoor_DZ", "Land_DZE_LargeWoodDoor", "MetalFloor_DZ", //"CinderWallDoorSmallLocked_DZ", //"CinderWallDoorLocked_DZ", "CinderWallSmallDoorway_DZ", "CinderWallDoor_DZ" ]; // ### [CPC] Indestructible Buildables Fix
// ### [CPC] Indestructible Buildables Fix if (typeOf(_object) in _cpcimmune) then { _object addEventHandler ["HandleDamage", {false}]; _object enableSimulation false; }; // ### [CPC] Indestructible Buildables Fix
This works great as long as no one messes with your building until a restart. CPC already had a fix for that too, I took player_build.sqf from the dayz_code and modified it with the necessary fix, plus another fix, of course, for excluding locked doors.
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; _object setDir _dir; _object attachTo [player,_offset]; // ### [XXX] Destructible Locked Doors Fix _lockdoor = [ "Land_DZE_LargeWoodDoorLocked", "Land_DZE_WoodDoorLocked", "Land_DZE_GarageWoodDoorLocked", "CinderWallDoorSmallLocked_DZ", "CinderWallDoorLocked_DZ" ]; if (typeOf(_object) in _lockdoor) then { _object addEventHandler ["HandleDamage", {true}]; _object enableSimulation true; }; if (!(typeOf(_object) in _lockdoor)) then { _object addEventHandler ["HandleDamage", {false}]; _object enableSimulation false; };
This all works fine and dandy, except when *upgrading* your structure. I first noticed it when I could shoot a half concrete wall all day with a rocket launcher, but as soon as I upgraded it, it became vulnerable to destruction. The same goes for all upgradable structures, namely from open-doorways to doored-doorways if you get my drift.
After playing around with player_build.sqf for a bit, I realized that this file is not used at all when upgrading a structure. Now I am at a loss, because I have no idea what to do next! What I really need to know right now is, where can I get or access the script that is called when a player upgrades an existing structure?
Thanks in advance.
EDIT: I figured it out on my own. I had to get this player_upgrade.sqf file from vbawol's repository. I edited it a little bit to reflect the changes I was wanting to make:
// Create new object _object = createVehicle [_classname, [0,0,0], [], 0, "CAN_COLLIDE"]; // Set direction _object setDir _dir; // Set location _object setPosATL _location; // ### [XXX] Handle Custom Destructibles if (!(_classname in DZE_DoorsLocked)) then { _object addEventHandler ["HandleDamage", {false}]; _object enableSimulation false; cutText [format["This %1 is now indestructible. Swapping it for the old %2",_classname,_oldclassname], "PLAIN DOWN", 10]; }; // ### [/XXX]
Saved it in my custom folder, then in fn_selfActions file I called it to execute instead of the generic one from dayz_code (which wasnt even in my dayz_code, weird) and it works great! All builds are indestructible except for locked doors. :-)