OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gundernak on 13 Jan 2004, 21:51:12
-
Hi all,
1:
I would like to know is there more else eventHandler than the ones in the official com ref?
or
2: could you offer me an eventhandler detecting that my unit have killed another unit.
(I guess 'killed' eventHandler detects that the unt is killed by, and by whom)
I need a check for the moment when my unit is the killer...
thanks in advance
-
Hey !
This :
anyunit AddEventHandler ["Killed",{if (_this select 1==player) then {myconsequence}}]
should do the trick : _this select 1 returns the unit that kills in the case of "Killed" EHs (see here (http://www.ofpec.com/editors/resource_view.php?id=543)).
Ig.
-
am I right that I have to put this eventHandler to the potential victims init field?
If it is true and I have 50 potential victims each one has to got one eventhandler.
Will not it slow down the game?
-
Hey !
You can use a trigger covering your mission area, in the activation field of which you'll type :
"_x AddEventHandler [""Killed"",{if (_this select 1==player) then {myconsequence}}]" foreach thislist
Test it, unless your consequences require heavy scripting or all your units die at the same time, this should not slow down the game.
Ig.
-
thanks man!
understood ;)