OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Judge856 on 07 Apr 2003, 19:40:12
-
; **********************************************************************
; **** Shoots a flare up when a trigger is activated.
; ****
; **** 2 parameters needed:
; **** Â Â Â 1. Trigger trap is attached to. (Object)
; **** Â Â Â 2. Color of flare. ("WHITE", "RED", "GREEN", "YELLOW") (String)
; ****
; **** Example how to use:
; **** Â Â Â TRIGGER:
; **** Â Â Â Radius: 50
; **** Â Â Â Name: Trap_1
; **** Â Â Â Activation: WEST + PRESENT + REPEATEDLY
; **** Â Â Â On Activation: [Trap_1, "GREEN"] Exec "FlareTrap.sqs"
; ****
; **** By CHenderMan@cableone.net
; **********************************************************************
; Get the parameters given
"Trap_1" = _this Select 0
"Green" = _this Select 1
; Get the position of the trigger
posTrap_1 = GetPos "Trap_1"
; Create the position for the flare to drop (Z + 150 m)
x = posTrap_1 Select 0
y = posTrap_1 Select 1
z = (posTrap_1 Select 2) + 150
posFlare = [x, y, z]
; Create the flare
?("FlareGreen" == "Green"): "Green" = ""
type = "FlareGreen" + "Green"
"FlareGreen" = FlareGreen CamCreate posFlare
CamDestroy "FlareGReen"
Exit
Can anyone tell me whats wrong with this script, because I've no idea what I've done wrong? :-[
-
Anyone have any clue, I'm not sure how to set up the co-ords so any advice would be appreciated.
-
I NEED SOME ADVICE HERE
-
what errors do you get?
-
after looking over it, i found some errors:
it should be:
; **********************************************************************
; **** Shoots a flare up when a trigger is activated.
; ****
; **** 2 parameters needed:
; **** 1. Trigger trap is attached to. (Object)
; **** 2. Color of flare. ("green", "white", "yellow", "red") they must be exact and include "
; ****
; **** Example how to use:
; **** trigger:
; **** Radius: 50
; **** Name: Trap_1
; **** Activation: WEST + PRESENT + REPEATEDLY
; **** On Activation: [Trap_1, "green"] Exec "FlareTrap.sqs"
; ****
; **** By CHenderMan@cableone.net
; **********************************************************************
; Get the parameters given
_trap_1 = _this Select 0
_green = _this Select 1
; Get the position of the trigger
_posTrap_1 = GetPos _trap_1
; Create the position for the flare to drop (Z + 150 m)
_x = _posTrap_1 Select 0
_y = _posTrap_1 Select 1
_z = (_posTrap_1 Select 2) + 150
_posFlare = [_x, _y, _z]
; Create the flare
?(_green == "green"): _green = "Flaregreen"
?(_green == "white"): _green = "Flare"
?(_green == "yellow"): _green = "Flareyellow"
?(_green == "red"): _green = "Flarered"
_flaregreen = _green CamCreate _posFlare
exit
i think that works, i redid all of the "create flare" section.