Jump to content

[How To] [CPC] Indestructible Bases


ToejaM

Recommended Posts

So I added the building class names to CPC. It didn't work at first. I then added the buildings directly via the database. Those ones are now indestructible. Now I simply have to find an easy way to move my map additions from SQF to the Database. But the script it self works great and has allowed me to open up new avenues for combat without risking constant base destruction.

Link to comment
Share on other sites

Not a good idea to move everything to the database, just apply the indestructible changes to the objects in the SQF file that has to work! :)

this script is just disableing the damage handler and the simulation like this, so what otter said should work!

_object addEventHandler ["HandleDamage", {false}];
_object enableSimulation false;

that is all you have to apply to every single object in the SQF.

Link to comment
Share on other sites

Not a good idea to move everything to the database, just apply the indestructible changes to the objects in the SQF file that has to work! :)

this script is just disableing the damage handler and the simulation like this, so what otter said should work!

_object addEventHandler ["HandleDamage", {false}];
_object enableSimulation false;

that is all you have to apply to every single object in the SQF.

 

So I have that a shot here is snippet from my SQF that loads extra buildings.

_bldObj = objNull;
if (true) then
{
  _bldObj = createVehicle ["MAP_A_Castle_Bergfrit", [2630.4084, 1235.0073, 2.7270193], [], 0, "CAN_COLLIDE"];
  _object addEventHandler ["HandleDamage", {false}];
  _object enableSimulation false;
  _bldObj setDir 183.18703;
  _bldObj setPos [2630.4084, 1235.0073, 2.7270193];
};

I updated the sqf with the added code. Restarted the server and the buildings still takes damage and collapses. Any advice?

Link to comment
Share on other sites

_bldObj = objNull;
if (true) then
{
  _bldObj = createVehicle ["MAP_A_Castle_Bergfrit", [2630.4084, 1235.0073, 2.7270193], [], 0, "CAN_COLLIDE"];
  _bldObj addEventHandler ["HandleDamage", {false}];
  _bldObj enableSimulation false;
  _bldObj setDir 183.18703;
  _bldObj setPos [2630.4084, 1235.0073, 2.7270193];
};
Link to comment
Share on other sites

_bldObj = objNull;
if (true) then
{
  _bldObj = createVehicle ["MAP_A_Castle_Bergfrit", [2630.4084, 1235.0073, 2.7270193], [], 0, "CAN_COLLIDE"];
  _bldObj addEventHandler ["HandleDamage", {false}];
  _bldObj enableSimulation false;
  _bldObj setDir 183.18703;
  _bldObj setPos [2630.4084, 1235.0073, 2.7270193];
};

 

This worked great. Thank you for the help!

Link to comment
Share on other sites

Hi, all, I need your help.

I don't want Indestructible bases but I want to reduce damage for list of my objects (buildings)
but cant find where damages is registering for created buildings.

I tried many files but can't find it.
Maybe somebody know in which file I can find it?

Or how to increase armor level for buildings?

Link to comment
Share on other sites

I believe that it possible if you will use a EH  something like this addEventHandler ["Hit", { ((_this select 2) * 0.5)}];

but I don't know how exactly

Or find place where Epoch read first time from "cfgVehicle"  armor value of building and then we can increase it

Link to comment
Share on other sites

I used to just run this step one, the server_monitor.sqf changes and this does NOT work by itself any longer.

 

Not sure as to why, but yeah. I just satcheled a bunch of stuff down on my server only running that first step.

 

Can anyone confirm that they are only doing the server_monitor changes and that it is fully functioning for them?

 

My only difference is my setpos is setposATL. Would that break it?

 

_object setdir _dir;
_object setposATL _pos;
_object setDamage _damage;
// ### [CPC] Indestructible Buildables Fix
if (typeOf(_object) in _cpcimmune) then {
_object addEventHandler ["HandleDamage", {false}];
_object enableSimulation false;
};
// ### [CPC] Indestructible Buildables Fix
if (count _intentory > 0) then {
Link to comment
Share on other sites

When youre in the editor and create a object put this in the "init" line of it:

 

_this addEventHandler ["HandleDamage", {false}]; _this enableSimulation false;

 

Nice Halv , but i call it like this !

_this setVehicleInit "this addEventHandler [""HandleDamage"", {false}];";

Has been tested and worx !

Link to comment
Share on other sites

Thx a lot Gagi.

 

Normaly I use _tmpbuilt, but for some test I replace it with _object, I will change again for _tmpbuilt

 

I will modify for upgrade and downgrade and test it!

Link to comment
Share on other sites

 It's ok, but only upgrade item doesn't work

 

I do this in server_swapObject.sqf

 

 

_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];

// Test disabling simulation server side on buildables only.

// ### CPC Swap Object Fix

_object addEventHandler ["HandleDamage", {false}];

// ### CPC Swap Object Fix

 

 

Gagi: "also you have only edited the build function not the upgrade or downgrade so the objects are still destroyable after upgrading or downgrading again..."

 

I don't exactly understand what you explain, I can't find "upgrade" or "downgrade" files to modify in tuto.

Link to comment
Share on other sites

It's really weird, because in the pas iI hven't do this modifications on "upgrade" or "downgrade" and everything was ok, since I install Snapping it doesn't work... and it's a real big problem for the players on my server

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...