OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: THobson on 15 Jul 2004, 11:43:12
-
How do I make an AI soldier un-killable?
-
Simple.
in a trigger condition, write
not (alive nameofmyguy)
and put in the activation bit
nameofmyguy setdammage 0
Simple (again!)
Oh yeah, you'll need to make the trigger activate repeatedly.
C"G"McD
-
I did that once (well actually using a looping script rather than a trigger) and found it was not always reliable. I had to add an eventHandler as well.
loon1 addEventHandler [{Hit}, {_this select 0 setDammage 0}]
-
That way works nicely
But if a grenade hits him, he's dead (And any one hit-one kill weapons)
- Ben
-
Add a killed eventhandler too, just to be on the safe side.
:beat: *Gets Shot* :beat:
-
Putting the following in the Initialisation field of a soldier:
this addEventHandler ["killed",{this setdammage 0}]; this addEventHandler ["Hit",{this setdammage 0}]
Seems to work. He even survives a satchel charge exploded under his feet - once he has landed that is!! It is very strange to watch.
Thanks everybody
-
By the way Armstrong. I love your dancing banana - but it makes it realy difficult for me to read your posts when I am in my open plan office at work.