OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Celeriac on 06 Jun 2004, 13:06:09
-
Hey there, :-*
IÂ'm making a DM map and thought about adding a special feature upon a unit dying: after a couple seconds a white flare rises slowly from the dead body like a soul or spirit floating away from ground level to the sky. This should be repeated every time a soldier dies.
As my scripting skills are close to plain zero, IÂ'd truly appreciate some basic examples and guiding if the script itself isnÂ't impossible to make. Of course I wonÂ't forget to mention the helping hand in the briefing. :)
Thanks in advance,
Celery. ;)
-
deadflare.sqs :
_unit = this select 0
_flare1 = "flare" camcreate getpos unit
_flare1 setpos [getpos _unit select 0, getpos _unit select 1, 2]
_flare1 setvelocity [0,0,20]
Right, for each playable unit, make a trigger
make a trigger
With a condition
!alive unitname
And in the onactivation:
unitname exec "flaredead.sqs"
Its the best way to do it :)
Oh, much around with the line with setvelocity in it.. Try [0,0,10], and [0,0,30] etc
See what looks best
You could also try the drop command.. But it's really complicated (Theres tutorials in the editor depot)
Good luck :)
- Ben
-
First of all, thanks for the quick helping reply! :)
Though IÂ'm sure it works, I get an error:
'_unit = _this select 0|#|': Error select: Type Bool, expected Array
_unit = _this select 0
_flare1 = "flare" camcreate getpos _unit
_flare1 setpos [getpos _unit select 0, getpos _unit select 1, 2]
_flare1 setvelocity [0,0,20]
I made a correct test trigger, but IÂ'm having problems with the script.
Respect,
Celery
-
Doh.. "_unit = _this select 0"
Should be :
_unit = this select 0
Woops..
It shoudl work okay now
If the trigger doesn't work.. Try this in the units INIT field :
this addeventhandler ["dead",this exec "flaredead.sqs"]
- Ben