Jump to content
Sign in to follow this  
Catalyst317

How to make bar gate indestructible in 3d editor

Recommended Posts

I am making some addons for a server I admin on with the 3d editor and do not know how to make objects like a bar gate indestructible. Do I do this in the sqf file or can i put a code in the init section of the object?

I tried:

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

in the init box, but when I go into the preview, it is not indestructible.

Share this post


Link to post
Share on other sites

It would be

this addEventHandler ["HandleDamage", {0}];

since boolean is differentiated from numbers in C#.

this [url="https://community.bistudio.com/wiki/allowDamage"]allowDamage[/url] FALSE;

works better, though.

Share this post


Link to post
Share on other sites

I tried adding both of those to the init of the bar gate, but when I go to preview, they are still taking damage and falling over.

Share this post


Link to post
Share on other sites

That's weird, I tested with either and both of them, all with the same result. Are you sure you don't have anything you tested in init.sqf interfering with it or something?

Share this post


Link to post
Share on other sites

No, I loaded an edit I made and never entered anything in. I even double checked it and the init is blank. When I place a hunter and test it in the preview, the gates still fall over and the hunter keeps going.

This is what my sqf looks like that I loaded in.

_vehicle_4 = objNull;

if (true) then

{

_this = createVehicle ["Land_BarGate_F", [15732.831, 17464.098, 3.8146973e-005], [], 0, "CAN_COLLIDE"];

_vehicle_4 = _this;

_this setDir -69.13829;

_this setPos [15732.831, 17464.098, 3.8146973e-005];

};

Edited by Catalyst317

Share this post


Link to post
Share on other sites

Did you save the mission before previewing? Also make sure you're not previewing the "old" playthrough (use restart). I'm not very familiar with the 3d editor but it seems to require these.

Share this post


Link to post
Share on other sites

That's it, I forgot to save the mission first. I can't believe I overlooked that. Thank you so much!!

Share this post


Link to post
Share on other sites

Corrections to my ill-advised counsel:

1) this addEventHandler ["HandleDamage", {false}]; works fine.

2) You should use it instead of allowDamage FALSE.

See your old thread for more.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×