Jump to content
Sign in to follow this  
chronicsilence

Making Map Objects Invincible

Recommended Posts

Hey folks,

I'm having some difficulties here. I'd like to make the walls to one of the Altis military compounds invulnerable, so they can't be knocked over. I can get the object by its ID, but none of the standard methods to ignore damage seem to be working, it will still fall over if you hit it with a rocket. This is what I've tried:

_nObject = [0,0,0] nearestObject 444472; // get the object by ID

_nObject allowDamage false;

_nObject addEventHandler["HandleDamage",false];

_nObject addEventHandler["Hit",{_this select 0 setdammage 0}];

_nObject addEventHandler["Dammaged",{_this select 0 setdammage 0}];

_nObject addEventHandler["Killed",{_this select 0 setdammage 0}];

None of these things are working, and none of them are triggered when the wall is hit with something. Can you not add event handlers to map objects? I need SOME way to make these things invincible.

Share this post


Link to post
Share on other sites

I think there was a thread a while back that was similar to this (not exactly the same) but I think it came to the conclusion that some mission objects aren't animated, therefore allowDamage and other similar commands won't work. I don't know if that's the case here. Sorry can't be able to find that thread atm.

Share this post


Link to post
Share on other sites

You could still try _nObject enableSimulation false;

Share this post


Link to post
Share on other sites

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

This will overwrite the default damage added to _nObject with 0 making it indestructable.

Edited by waltenberg

Share this post


Link to post
Share on other sites
You could still try _nObject enableSimulation false;

Tried this, it has no effect.

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

This will overwrite the default damage added to _nObject with 0 making it indestructable.

As JShock said above, this won't work because the objects "aren't animated" and don't listen to event handlers.

Share this post


Link to post
Share on other sites

I don't know what objects we're talking about here, but I added this event handler to a building and shot multiple times at it with a tank. I queried the damage, it was 0. I did the same thing with an SUV, so it works for buildings and vehicles at least.

Now what kind of object is _nObject in your case that this does not work?

_nObject allowDamage false;

works as well (at least for buildings and vehicles).

Btw, setDammage is a deprecated command and does nothing. Use setDamage (with 1 "m") instead.

Edited by waltenberg

Share this post


Link to post
Share on other sites

He referenced walls at the bottom of his OP, so I guess he is talking "already" on map wall objects.

Share this post


Link to post
Share on other sites
He referenced walls at the bottom of his OP, so I guess he is talking "already" on map wall objects.

That is correct, it's a "mil_wallbig_4m" object at the compound just north of Athira on Altis. It's on the map by default. I would also be OK with some way of just deleting it, so I could put a new one on it in the editor and tell the new one to 'allowDamage false'. I can set its damage to 1 so it falls over and the ones I added are still there, but then I have a compound surrounded by knocked over walls hovering in the air. Unfortunately, I don't think it's possible to delete objects built into the map.

Share this post


Link to post
Share on other sites
Here is the thread I was referencing earlier, the last post seems to be closely related to the topic currently at hand here, and may answer the question your asking.

http://forums.bistudio.com/showthread.php?184777-How-to-Make-Original-Map-Fences-Indestructible

Yeah, it comes to the conclusion that those things aren't animated to save performance. They can still be knocked over though, and you can manipulate their damage value through scripts, which is kind of weird. In any case, maybe there's a way to delete them then?

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  

×