OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bobthedinosaur on 19 Jan 2004, 11:39:14
-
i found a giant script on the forums on how to make a unit invincible but i don't understand any of it, the other method i've found is to setcaptive true
is there any other easier command to make a unit unkillable? ???
-
setCaptive true does not make a unit unkillable. What it does is stop the enemy from shooting at the loon deliberately. It can still be killed by blast, driving accidents etc.
The best way (I believe) of making a loon invincible is to use the eventhandler "hit" to make the loon setDammage 0 whenever he is hit. Eventhandlers are like little script launchers that you can attach to unit and which activate when the event occurs. There are about six of them, there's a list in the EdDepot somewhere and no doubt a tutorial. However, you have to use the big script - invincibility is tricky and there is no absolutely certain way of achieving it.
-
Like Macguba said, EH's seem to be the only solution.
This AddEventHandler ["Hit", "(_this Select 0) SetDammage 0"]; This AddEventHandler ["Killed", "(_this Select 0) SetDammage 0"]
Just add that to the unit's init. field so he won't get injured when he gets shot.
Note: Sometimes they might die of an overload of attacks, I was testing this out and two guys were constantly firing, one threw a grenade and I died. This is your best bet for invincibility.
Beware the GrimMonkey
-
the most extravagant way to become a "tank" is to make a small addon:
all ya need is to alter the "Armor" in the config. make it some 12000 or alike ;D