Home   Help Search Login Register  

Author Topic: Bad script???  (Read 465 times)

0 Members and 1 Guest are viewing this topic.

Judge856

  • Guest
Bad script???
« 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? :-[
« Last Edit: 07 Apr 2003, 20:22:04 by Judge856 »

Judge856

  • Guest
Re:Bad script???
« Reply #1 on: 07 Apr 2003, 20:52:54 »
Anyone have any clue, I'm not sure how to set up the co-ords so any advice would be appreciated.

Judge856

  • Guest
Re:Bad script???
« Reply #2 on: 08 Apr 2003, 00:32:17 »
I NEED SOME ADVICE HERE

_hammy_

  • Guest
Re:Bad script???
« Reply #3 on: 08 Apr 2003, 00:44:04 »
what errors do you get?

_hammy_

  • Guest
Re:Bad script???
« Reply #4 on: 08 Apr 2003, 01:01:08 »
after looking over it, i found some errors:
it should be:

Code: [Select]
; **********************************************************************
; **** 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.