Home   Help Search Login Register  

Author Topic: Custom flare effect  (Read 521 times)

0 Members and 1 Guest are viewing this topic.

Celeriac

  • Guest
Custom flare effect
« 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.  ;)

DBR_ONIX

  • Guest
Re:Custom flare effect
« Reply #1 on: 06 Jun 2004, 14:02:47 »
deadflare.sqs :
Code: [Select]
_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

Celeriac

  • Guest
Re:Custom flare effect
« Reply #2 on: 06 Jun 2004, 15:38:46 »
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

Code: [Select]
_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
« Last Edit: 06 Jun 2004, 16:06:25 by Celeriac »

DBR_ONIX

  • Guest
Re:Custom flare effect
« Reply #3 on: 06 Jun 2004, 16:26:57 »
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