OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: mr.sert on 29 Apr 2003, 09:26:38

Title: Death Trigger?
Post by: mr.sert on 29 Apr 2003, 09:26:38
I want to create a trigger that once you trigger it you slowly begin to die, but also if you move away from that area you will not continue to die, or get injured. What would be the easiest way to do this? Thanks in advance.........


- Mr. Sert
Title: Re:Death Trigger?
Post by: macguba on 29 Apr 2003, 10:32:37
Create the trigger, group it with the player so you get the special options in the on activation box.    Set it to repeatedly.

On Activation:    poison=true; [] exec "poisonScript.sqs"
On deactivation:   poison=false

In init.sqs write

poison=false

Name the player loon1.  Now create your script file

; this script slowly poisons the player to death while he is in the trigger area

#loop
?not poison:exit
?getdammmage loon1 >=0.96:loon1 setdammage 0
loon1 setdammage ((getdammage loon1)+0.05)
~1
goto "loop"


Syntax not guaranteed - check it.   This is not a working script, its just a sketch for you to use as a starting point.

You can change the parameters to suit yourself:  with this script loon1 will die after about 20 seconds but you can make it as fast or slow as you like.







Title: Re:Death Trigger?
Post by: mr.sert on 29 Apr 2003, 10:48:37
Thanks for the help....



- Mr. Sert
Title: Re:Death Trigger?
Post by: deaddog on 29 Apr 2003, 17:58:00
That's a cool idea... :toocool:

The only problem I see is that loon1 may not die if his "starting" damage is something like .11 or .02, etc .  When his damage is >=.96 and <1 he is set healthy again.