Jump to content
Sign in to follow this  
OmniMax

indestructible/Invincible Objects

Recommended Posts

Hi, I haven't played ARMA and I'm getting back just now into ARMA II.

I browsed over the comref and I can't find a way to make a unit or object indestructible.

I understand there is the old OFP method of

[b]Condition:[/b] GetDammage objectName >= 1
[b]On Activation:[/b] objectName SetDammage 0

And it works, but graphically it doesn't look good (if the object in question that takes too much damage at once dies and the trigger doesn't activate fast enough, it will go to the destroy animation then back to the living animation)

Is there a easier and more efficient way to do this in ARMA II?

Thank you in advance.

Share this post


Link to post
Share on other sites

Looking here, the new "HandleDamage" event handler might be good. Don't know if there's any documentation on it, though.

Share this post


Link to post
Share on other sites

Assuming I haven't made a typo, put this in the init line of the unit

this addeventhandler ["hit", {(_this select 0) setdamage 0;}];
this addeventhandler ["dammaged", {(_this select 0) setdamage 0;}]; 

Share this post


Link to post
Share on other sites
Assuming I haven't made a typo, put this in the init line of the unit
this addeventhandler ["hit", {(_this select 0) setdamage 0;}];
this addeventhandler ["dammaged", {(_this select 0) setdamage 0;}]; 

Even better, you can just use this (I've just found out):

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

Share this post


Link to post
Share on other sites
Even better, you can just use this (I've just found out):

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

Excellent find mate, I'll give it a try - anything that simplifies code has got to be good :)

Share this post


Link to post
Share on other sites
Excellent find mate, I'll give it a try - anything that simplifies code has got to be good :)

Well, it's working fine for me in a mission I'm working on... stopping those camo nets from falling over whenever someone remotely goes near them with a vehicle ;)

Share this post


Link to post
Share on other sites

Whoa, you guys beat me to it.

Yeah the eventhandler 'handleDamage', set it to false.

like so:

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

even the player will be invulnerable to death (in the editor, anyway)

Worked like a charm, I didn't want this AA fortification (Earthen Artillery Nest) destructible by itself or a LGB.

Also, I never got into heavy scripting with OFP, so let this be a lesson for me (and everyone else reading).

JamesF1, when you say

this addeventhandler ["hit", {(_this select 0) setdamage 0;}];

_this select 0 is in reference to the eventhandler hit, in which case the comref says in short hand [unit, causedBy, damage]. select 0 being the unit the eventhandler is assigned to.

Okay, one more dumb question. Why _this select as opposed to this? I forget, it's been awhile. :(

Share this post


Link to post
Share on other sites

You use _this select when selecting a specific item from within an array. For instance the "hit" eventhandler automatically creates an array as you've pointed out that contains the following items [unit, causedBy, damage]. _this select 0 just identifies the first item in that array eg. _unit

Share this post


Link to post
Share on other sites

Okay, one more dumb question. Why _this select as opposed to this? I forget, it's been awhile. :(

_this returns script input parameters in an array format, and in your example, everything enclosed in { } is treated as a script, of which input param is this.

Share this post


Link to post
Share on other sites

Does anyone know if code like this could be used to stop the random paradrop casualties that occur? I've searched the forums but not found much.

I’ve tried using

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

and

unitname allowdamage false;

in the waypoint activation fields for both the paratroopers and the jump.sqs activation, but no joy. I am replacing the 'unitname' with the paratrooper's group names however, but i dunno if this would make a difference.

Thanks in advance for any assistance.

Share this post


Link to post
Share on other sites

I don't think you can specify a group name for those. Maybe, but think it has to be a single unit. And I would assume allowDamage false would work.

Share this post


Link to post
Share on other sites
Does anyone know if code like this could be used to stop the random paradrop casualties that occur? I've searched the forums but not found much.

I’ve tried using

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

and

unitname allowdamage false;

in the waypoint activation fields for both the paratroopers and the jump.sqs activation, but no joy. I am replacing the 'unitname' with the paratrooper's group names however, but i dunno if this would make a difference.

Thanks in advance for any assistance.

This placed in a trigger or waypoint will work

{_x allowdamage false } forEach thisList; 

A trigger may be the best option and you will have to turn the damage back on again.

Share this post


Link to post
Share on other sites

Ok, that sounds promising, i'll give it a go.

Ta very much :)

Hmmmm, sorry to be a pain, but ive tried entering

{_x allowdamage false } forEach thisList;

in the waypoints, and creating a trigger which activates repeatedly when BLUFOR enter, but i'm still getting injuries, deaths etc. Do I need to list the groups to be affected anywhere etc., or am I just being too much of a noob? ;)

Edited by OuchShot

Share this post


Link to post
Share on other sites

It does work up to a point but repeating triggers don't really repeat unless they are reset. It also requires the units to stay with in the trigger area while dropping.

I just looked at the para script I had and placed that just after the unassigned vehicle command.

(_jmp select _i) allowDammage false;

not knowing the script you using I can't be more precise.

_ jmp is the unit and _I is the index for the next unit.

Share this post


Link to post
Share on other sites

No need mate, I stuck that in the jump script, and entered

{_x allowdamage true } forEach thisList;

in a group's first waypoint after paradrop, and they land without dying, and can be killed as soon as they begin moving to that waypoint.

Ta very much mate, really helped me out :)

Share this post


Link to post
Share on other sites

I want to make a couple of attack choppers invincible for a mission, so they can be effective and not just die after 10 seconds.

I have used the this addEventHandler ["handleDamage", { false }]; code in the init box of the choppers, which seems to work in the single player editor. However, when I convert it to an MP map, and play it with friends, this seems to fail, and the choppers go back to dying.

Any Help?

note; I just realised that part of the problem is that the pilots can die, even though the chopper is invincible. Since the pilots are not defined as 'units' they have no init, and therefore cannot be made invincible.

Thanks,

Leving.

Edited by Leving

Share this post


Link to post
Share on other sites

How would you go about making a preplaced building on the map indestructable, script?

Share this post


Link to post
Share on other sites
How would you go about making a preplaced building on the map indestructable, script?

Hi,

MY_building allowDamage false;

_neo_

Share this post


Link to post
Share on other sites

Since I don't know how to script whatsoever mind walking me through how i'd use that? For something like the construction site in Chernogorsk(A2 Vanilla)

Share this post


Link to post
Share on other sites
Since I don't know how to script whatsoever mind walking me through how i'd use that? For something like the construction site in Chernogorsk(A2 Vanilla)

Easiest way would be:

Create a game logic in the editor on top of the building and put the following into its init line:

(nearestBuilding this) allowDamage false;

_neo_

Share this post


Link to post
Share on other sites

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

FYI, not sure why, but this doesn't seem to work, when used for static units such as an manned M2 tripod.

Share this post


Link to post
Share on other sites

Hey there!

How to make a small object indestructible, like evidence (files or photos)?

Thanks!

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  

×