hypno toad 0 Posted August 1, 2007 Is there something I can type into a unit to make it invincible, I am asking because I would like to make the squad leader in a mission invincible. Share this post Link to post Share on other sites
Battousai567 0 Posted August 1, 2007 this allowDammage false; Share this post Link to post Share on other sites
kronzky 5 Posted August 1, 2007 allowDammage has been non-functional for a looong time. Lacking that command, there is no reliable method to achieve true invincibility (you can protect yourself against injuries, but not against instant kills). But you should ask this in the editing forum anyway... Share this post Link to post Share on other sites
Balschoiw 0 Posted August 1, 2007 You can have a little loop script running that sets the dammage of the unit to 0 in short intervals. Still, if he receives damage <= 1 from a shot or explosion he will probably instantly die before the script can reset the damage value. Share this post Link to post Share on other sites
norrin 9 Posted August 1, 2007 Try adding this to the init line of the unit in the editor: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">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
ColonelSandersLite 0 Posted August 1, 2007 norrin's way just above is how I traditionally do it. It seems to protect against everything but headshots. Adding setcaptive true in there also makes it so they don't deliberately fire at you. this addeventhandler ["hit", {_this select 0 setdamage 0}]; this addeventhandler ["dammaged", {_this select 0 setdamage 0}]; this setCaptive true; Share this post Link to post Share on other sites
ArMoGaDoN 0 Posted August 9, 2007 I have a problem that is directly related to this, in detecting when a building is destroyed. Have tried using the killed and dammaged (+ getdammage) event handlers to reliably detect the destruction of the building, however this is proving unreliable. One or other of the handlers will fire most times, killed fires if the building gets killed in 1 hit (i.e. satchels) nut does not fire if the destruction takes several shots to accomplish. Similarly the hit event handler won't fire if the building is destroyed in 1 hit. That being said, sometimes NEITHER fire in multiplayer. And the map that need to detect this is therefore 'buggy', although the bug ain't mine. Only way I have found to do this sorta reliably is to make a polling script for all buildings to be monitored, fine until the script eventually dies or crashes for god knows what reason. I really think that killed should fire, even if the damage taken is a gradual happening, not a 1-shot-kill. Is this a current plan to change this, or? Share this post Link to post Share on other sites
Rejn 0 Posted August 10, 2007 I've used Colonel Sanders suggestion howevever I don't like the idea of the unit appearing blue after I setcaptive to it and make it part of my squad (seems to also cause crashing on savegames either that or its another one of my scripts..) Is there anyway to revive a unit from the dead after it has been killed? Making it come back to life without having to respawn it.. or is there a way to shield it 100% from death without setcaptive? thanks. Is there perhaps a way to increase the units hitpoints to 10,000?? Thanks. Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted August 12, 2007 @Rejn: In mp, the eventhandlers work 100% in my experience. In sp, they do not stop headshots, and there is no way around it. You *could* make a custom addon unit that's invincible, but it would only be 99%. In ofp we used to have cheat unit built into the game for use in cutscenes and the like, dunno if they're still around in arma or not. Even those would still die sometimes. Share this post Link to post Share on other sites