OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: DarkAngel on 09 Jul 2007, 13:36:22
-
Hi folks, am probably being really stupid here but for some reason this (very simple) script doesn't work and I wondered if someone could help! The aim is to create a series of flares above preset locations, to add atmosphere to a SF mission I'm working on...grateful for all help!
; flares.sqs
; creates flares at given point
_position_unit = _this select 0
_flare_number = _this select 1
~10
#flares
hint "Loop starting"
_flare1 = "FlareWhite_M203" camCreate [getPos _position_unit select 0, getPos _position_unit select 1, 30]
~20
_flare_number = _flare_number - 1
?_flare_number < 1: goto "end"
goto "flares"
#end
exit
-
Use createVehicle instead of camCreate in ArmA.
-
I had problems with flares last night. Couldn't get a lit one up in the air. Also found nothing on the wiki.
I was trying to get a badguy to fire one with the fire command but he was having none of it.
-
This works like a dream - thanks Mandoble! Architect, it's kind of cheating as it just creates the flares rather than having them fired, but am thinking it can be set to a team leader unit who could fire it every time the player is spotted, for example...
; flares.sqs
; creates flares at given point
_launch_unit = _this select 0
_flare_number = _this select 1
~5
#flares
_flare1 = "F_40mm_White" createVehicle [getPos _launch_unit select 0, getPos _launch_unit select 1, 150]
~20
_flare_number = _flare_number - 1
?_flare_number < 1: goto "end"
? getDammage _launch_unit > 0.9: goto "end"
goto "flares"
#end
exit
-
Yeah, I think in future I'll just camcreate
createvehicle them.
It's what I normally do, but I dug up an old script that had a guy do it himself. It's what I get for trying be to cute when my normal solution already works just fine.
Cheers guys, the above script can be easily and most heartily pinched.