OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ruffo76 on 29 Jan 2004, 04:58:30

Title: Random battle field flares illuminating a perimeter?
Post by: ruffo76 on 29 Jan 2004, 04:58:30
Is there an easy way to have random battlefield flares illuminating a fence-line during a mission?
Title: Re:Random battle field flares illuminating a perimeter?
Post by: Dubieman on 29 Jan 2004, 05:08:07
I think this is the script....
courtesy of Chris's script editor
i've used this before and I'm pretty sure it works :)



;  Constantly shoots flares into the air at a specified rate and
; hight. Can be turned on and off.
;
;  4 parameters needed:
;    1. Trigger flare will shoot from. (Object)
;    2. Color of flare. ("WHITE", "RED", "GREEN", "YELLOW") (String)
;    3. Number of seconds between flares. (Number)
;    4. Height to shoot flares. (50 - 200) (Number)
;
; Example how to use:
;    TRIGGER:
;    Radius: 0
;    Name: Light_1
;     Activation: Whatever needed (set CONDITION to TRUE to trigger at game start)
;     On Activation: [Light_1, "WHITE", 20, 120] Exec "FlareLight.sqs"
;
;  Turn it (them) off with FlareLight = false
;
;  By CHenderMan@cableone.net

; Get the parameters given
_trigger = _this Select 0
_color = _this Select 1
_rate = _this Select 2
_height = _this Select 3

; Create the global variable for turning it (them) on and off
FlareLight = True

; Get the position of the trigger
_posTrigger = GetPos _trigger

; Create the height to start the flares
_x = _posTrigger Select 0
_y = _posTrigger Select 1
_z = ( _posTrigger Select 2) + _height
_posFlare = [_x, _y, _z]

; Set the color
?(_color == "WHITE"): _color = ""
_type = "Flare" + _color

; Create the flare light
#CreateFlare
?(Not(FlareLight)): Exit
_flare = _type CamCreate _posFlare
CamDestroy _flare
~_rate
Goto "CreateFlare"
Title: Re:Random battle field flares illuminating a perimeter?
Post by: ruffo76 on 29 Jan 2004, 06:01:10
Thanks for your help...