OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MOC_XIII on 04 May 2005, 01:36:02
-
Is it possible to make yourself have more health?
Like this
This addeventhandler ["hit", "this setdammage 0"]
Or would it just goto the "dead" screen. ???
-
well, for the player set dammage only works for hurting him, not healing him I think.
-
eh? No, I think setdammage works both ways...
-
Yes you can do that but its not enough. You need a setDammage 0 loop as well. Sometimes the hits come too fast for the EH to cope.
EH killed is no good: it revives you after the death cutscene starts.
This is very handy for testing missions. I also sometimes make myself setCaptive true. You can make your squad invincible but don't use setCaptive on them, otherwise the enemy loons don't react properly.
-
I remember testing this some time ago:
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=21523;start=0 (http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=21523;start=0)
this addEventHandler [{Hit}, {_this select 0 setDammage 0}];this addEventHandler [{Dammaged}, {_this select 0 setDammage 0}]
And I couldn't get myself killed in any way when I had that on my unit's initialization field. So you don't need a setdammage loop if you want to make your unit stay alive.
:)
But maybe this is not a good idea to put into a mission, only for testing purposes. Or if the unit really, really needs it for some very unrealistic reason, then it's OK.
-
ya I realized that might be wrong after I typed it. so i added I think.
Maby if you made a script that detected a bullet about to hit the player and made a random chance of deleting it, or sending it off somewhere else. or moveing the player very fast out of the way then back to the same spot.
-
They work fine for getting shot, most of the time. But if you get shot in head (sometimes), or grenaded, you die.
- Ben
-
DBR_ONIX, did you try the method I posted? I haven't found a way to kill a unit with that in it's initialization field (well closing OFP will do it but while playing).