OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: MOC_XIII on 04 May 2005, 01:36:02

Title: easier gameplay
Post 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. ???
Title: Re:easier gameplay
Post by: penguinman on 04 May 2005, 05:14:53
well, for the player set dammage only works for hurting him, not healing him I think.
Title: Re:easier gameplay
Post by: Fragorl on 04 May 2005, 09:13:43
eh? No, I think setdammage works both ways...
Title: Re:easier gameplay
Post by: macguba on 04 May 2005, 09:52:07
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.
Title: Re:easier gameplay
Post by: Baddo on 04 May 2005, 13:35:46
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)

Code: [Select]
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.
Title: Re:easier gameplay
Post by: penguinman on 04 May 2005, 23:56:23
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.
Title: Re:easier gameplay
Post by: DBR_ONIX on 13 May 2005, 15:44:46
They work fine for getting shot, most of the time. But if you get shot in head (sometimes), or grenaded, you die.
- Ben
Title: Re:easier gameplay
Post by: Baddo on 15 May 2005, 13:21:17
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).