Jump to content
Sign in to follow this  
Paco1

Scripting geniuses Plz read!!

Recommended Posts

I am looking for a script that will some how shoot of a flare!  I am working on a night time map and i want to put a trigger in that will shoot of a flare to light up there area. If someone could do this it would be greatly appreciated!!!!!!!! Plz E-mail me

(Edited by Paco1 at 2:26 am on Dec. 18, 2001)

Share this post


Link to post
Share on other sites

Hey on the site ofpeditingcenter.com there is an uber tutorial. If you look at that it walks you through triggering a flare to fire.

Share this post


Link to post
Share on other sites

This should help...

;//for use only by player triggerd Flaretraps in SP

;//might look funny when it is not triggerd by the player

;//

;//Parameters:

;//

;// _fire : guys that fires a flare, use an officer in night equipment

;//

;// _flaretype: Needs to be a String!!!

;// use "Flare", "FlareRed", "FlareGreen", "FlareYellow"

;// as values

;// (Note officer MUST already have one of those flares)

;//

;// _x : The X-Coord where the flare is suppost to appear

;// _y : The Y-Coord where the flare is suppost to appear

;// _zf : The Z-Coord where the flare is suppost to appear

;//

;// _safex : A Safe (!!!) place (X-Coords) out of the way where

;// a Infantry guy won't die

;// _safey : A Safe (!!!) place (Y-Coords) out of the way where

;// a Infantry guy won't die

;// _lock : a Gamelogic Variable which is used to determain if a flare

;// fireing is still in use (only needed when trigger is set on "repeatedly")

_fire = _this select 0

_flaretype = _this select 1

_zf = _this select 2

_x = _this select 3

_y = _this select 4

_safex = _this select 5

_safey = _this select 6

_lock = _this select 7

;Hint "test"

;officer1 RemoveMagazines "flare"

;officer1 addmagazine "flareyellow"

;determain if already locked if not lock

?(Getdammage _lock == 1):exit

_lock setdammage 1

_fire setdammage 0

;remove everything

_fire removemagazines "flare"

_fire removemagazines "flareRed"

_fire removemagazines "flareYellow"

_fire removemagazines "flareGreen"

removeAllweapons _fire

;add Flare (in right color) and Launcher

_fire AddMagazine _flaretype

_fire AddMagazine _flaretype

_fire AddMagazine _flaretype

_fire AddMagazine _flaretype

_fire Addweapon "AK74GrenadeLauncher"

;start firing flare

_fire fire ["GrenadesMuzzle", _flaretype, _flaretype]

~0.7324

;beam to flaretrap

_fire setpos ([_x,_y,_zf])

~0.05

;beam to safety

_fire setpos ([_safex,_safey,0])

;wait till he's dead then revive

~2

_fire setdammage 0

;wait till guy got up again

~4

;release lock

_lock setdammage 0

Exit

To activate the script...

This works by teleporting a dude in to fire a flare, and then removing him. This process takes only 0.05 seconds.

For this script to work you need an officer with night equipment (actually any infantry guy should do).

Paramters:

the offers name

the flare-colour you want to fire, allowed values are "flare" (white) "flarered", "Flaregreen" "flareyellow"

the height the flare should appear (meters above the ground)

the X-Coords where the flare should appear

the Y-Coords where the flare should appear

X-Coord of a safe spot for the officer (where he does not !!!! die)

Y-Coord of a safe spot for the officer (where he does not !!!! die)

the name of a game logic unit which will be used to determine if the script is currently running (only needed when the trigger is set on "repeatedly")

As an example:

[officer1,"flare",5,getpos barrel1 select 0,getpos barrel1 select 1, getpos outofway select 0,getpos outofway select 1,outofway] exec "flare.sqs"

Share this post


Link to post
Share on other sites

waywaywayway to complicated. here i have sent au a mission of mine that makes a man appear in a flash that soots a flare then dissapears.

Share this post


Link to post
Share on other sites

Why don't you just CAMCREATE one where its needed?

_Target = _This select 0

_Flare camCreate [(_Target select 0),(_Target select 1),100]

exit

Just create an invisible H at the location you want the flare and name it, and then call the script, passing the H's name. (you can change the "100" to whatever value you prefer, it relates to how high the flare will appear.

Which method you use, I suppose, depends on whether you prefer teleporting blokes around, or using scripts.

(Edited by Space Cadet at 6:56 pm on Dec. 18, 2001)

Share this post


Link to post
Share on other sites

HHHMMMMM! I appreciate all the info guys, but I'm thinking this is too complicated for me. I was kinda hoping that someone allready had something thrown together (file) and i could judt throw it in. But thanks for all the info. I will try to make heads and tails out of it!

(Edited by Paco1 at 7:44 pm on Dec. 18, 2001)

Share this post


Link to post
Share on other sites

uuuh hello anyone there. i said i sent u a quick mission tester of mine that i through together for u.

Share this post


Link to post
Share on other sites

Hey Man Thanks! I got I really appreciate it!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Quote: from Rob on 9:48 am on Dec. 18, 2001

waywaywayway to complicated. here i have sent au a mission of mine that makes a man appear in a flash that soots a flare then dissapears.

<span id='postcolor'>

I like complicated thing's wink.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×