OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: THobson on 15 Jul 2004, 11:43:12

Title: Un-killable
Post by: THobson on 15 Jul 2004, 11:43:12
How do I make an AI soldier un-killable?
Title: Re:Un-killable
Post by: cameronmc on 15 Jul 2004, 11:46:02
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
Title: Re:Un-killable
Post by: macguba on 15 Jul 2004, 12:20:48
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}]
Title: Re:Un-killable
Post by: DBR_ONIX on 15 Jul 2004, 12:36:28
That way works nicely
But if a grenade hits him, he's dead (And any one hit-one kill weapons)

- Ben
Title: Re:Un-killable
Post by: dmakatra on 15 Jul 2004, 12:39:05
Add a killed eventhandler too, just to be on the safe side.

:beat: *Gets Shot* :beat:
Title: Re:Un-killable
Post by: THobson on 15 Jul 2004, 20:45:54
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
Title: Re:Un-killable
Post by: THobson on 15 Jul 2004, 20:47:27
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.