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?

Share this post


Link to post
Share on other sites

In the object's init:

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

You could write script that applies this to all objects of a type as well.

Also, this is the wrong forum for this question. It would be better asked in ARMA 3 MISSION EDITING & SCRIPTING.

Share this post


Link to post
Share on other sites

Thanks, I will give it a try. Also, thanks for letting me know the best section to address my question. I thought here would be the best, but I'll try there instead.

Thanks again!

EDIT: I tried putting that into the init box, but when I go into preview, it's still not indestructible.

Edited by Catalyst317

Share this post


Link to post
Share on other sites

The code definitely works. Did you copy/paste?

Share this post


Link to post
Share on other sites

allowDamage won't work in this case, as it runs locally. It will work in SP or for the MP host (or preview when editing for MP), but not on a dedi. If a player were to try to drive through the gate, they would succeed, but the gate would still appear to be undamaged. Also, allowDamage is useless against "one-hit" damage, like a satchel.

Share this post


Link to post
Share on other sites

Catalyst317 made another thread here before this thread was moved to the correct forum.

Harzach's info was completely new to me, and sounded so weird I had to check it... Yeah, it is the case, and even the event handler seemed to fail half the time, with same behaviour as explained above. I wish the wiki had something on this.

Share this post


Link to post
Share on other sites
...and even the event handler seemed to fail half the time...

Really? I've never seen that before. How were you using it?

Share this post


Link to post
Share on other sites

this addEventHandler ["HandleDamage", {false}]; in the init field like you suggested. Half the time was out of four tries, though. I think I backed over it with a HEMTT in both cases.

Share this post


Link to post
Share on other sites
allowdamage is working on dedi server

Not with the bar gate, at least, I just tried it. Makes me wonder if the command has other objects that have similar chances to fail. Edit: The command itself shouldn't run locally, though, at least according to wiki, so I assume it's related to the locality of the actual object. Or would it help to execute allowDamage through init.sqf, for example?

Share this post


Link to post
Share on other sites

Wow, bargates are really fucked up in a dedi environment.

I made a quick MP mission with three bargates:

- normal

- this allowDamage false

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

I then put this mission up on my dedi.

I drove through each bargate in a Hunter. For each bargate, the effect was that of destroying the bargate (resistance, crashing sound, debris), yet none of the bargates actually appeared to have been destroyed - they all remained standing. I could then drive through each as if they weren't there.

I got out of the Hunter, and got back in, making it a "new" vehicle.

I drove through each bargate again. Each was then behaving as one would expect - the normal one was actually destroyed, falling flat (though it sort of snaps into the destroyed position rather than falling smoothly), while the other two were indeed indestructible.

Adding a second player makes things even more confusing, but ultimately it boils down to the bargate not "initializing" properly. It also seems that simply joining, leaving, then joining the server again initializes everything properly, though I haven't tested that thoroughly - in fact, the more testing I do, the less predictable the behavior seems to be.

In the end, I know that allowDamage is unpredictable at best, but it appears to be working here. I have never had an issue with the event handler method.

https://www.youtube.com/watch?v=HJkQafC7_e0

Edited by Harzach

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  

×