Home   Help Search Login Register  

Author Topic: Real Flares  (Read 1804 times)

0 Members and 1 Guest are viewing this topic.

Chris330

  • Guest
Real Flares
« on: 19 Apr 2005, 08:57:46 »
Dear All,

I am thinking of making a script which makes a unit fire flares from his gun rather than using camcreate to make flares. I have two main problems which I could use some help with.

Firstly how do I get the unit to fire flares from his gun. I assume it is along the lines of this:

_unit fire ["M16","Flare","FlareGreen"]

But I could do with some guidance on that ;)

Secondly how do I get the unit to reload his gun so he can fire more flares. This one I'm really stumped on as I have no idea to make them do this. As for getting them to fire at the right angle up in the air I think I am okay on this one. Any help greatly appreciated ;)

Edit: I should add that maybe it is not possible ??? If not I have a great script made by someone else that will still simulate flares very well :D
« Last Edit: 19 Apr 2005, 10:16:37 by Chris330 »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Real Flares
« Reply #1 on: 19 Apr 2005, 10:05:54 »
What you want to do is perfectly possible - I am at work at the moment.  If you don't have an answer by this evening I will respond then.  In the meantime if you are in a hurry you could download my mission Defensive Strike and de-pbo it to get the flare scripts I used.

Chris330

  • Guest
Re:Real Flares
« Reply #2 on: 19 Apr 2005, 10:17:14 »
I am at work also ;D Thanks for getting back to me. I would be very interested to know how it is done ;)

StonedSoldier

  • Guest
Re:Real Flares
« Reply #3 on: 19 Apr 2005, 10:24:45 »
i think its something like

man fire [m203muzzle,flarered]

but i forget, its ages since ive worked with the fire command, best thing i can suggest is playing as a guy with flares, add this to the units INIT

Code: [Select]
this addeventhandler ["Fired",{hint format ["this fire [%1,%2]",_this select 2,_this select 3]}]
and it will tell you exactly how to use the fire cammand

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Real Flares
« Reply #4 on: 19 Apr 2005, 10:29:28 »
loon1 fire "flarered"

He reloads automatically as long he has more flares.  

There are two versions of the fire command:  everybody always wants to use the difficult and complicated one rather than the simple one, but I don't know why.
Plenty of reviewed ArmA missions for you to play

Chris330

  • Guest
Re:Real Flares
« Reply #5 on: 19 Apr 2005, 10:54:42 »
Thanks for the replies :D I think I will use the basic fire command ;) I was thinking of using dowatch to make the soldier look at a game logic unit placed up in the air which would set the firing angle. The only thing I have heard is that the soldiers tend to fire directly up in the air when using the fire command. Can this be prevented by using the dowatch command ???

StonedSoldier

  • Guest
Re:Real Flares
« Reply #6 on: 19 Apr 2005, 12:14:40 »
try dotarget i had a bit of sucess combining that with the fire command

Chris330

  • Guest
Re:Real Flares
« Reply #7 on: 19 Apr 2005, 12:23:34 »
Great idea :D I'll give it a go when I get back from boring old work tonight and let you know how it goes ;)

Chris330

  • Guest
Re:Real Flares
« Reply #8 on: 19 Apr 2005, 18:04:00 »
I can do everything aprt from reload.

_unit fire "flaregreen" does not work. I eventually found the command after using stonedsoldier's suggestion. Correct syntax is:

_unit fire ["M203Muzzle","Flaregreen"]

He fires no problems. BUT I cannot find the action to get him to reload. Does anyone know how to do this?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Real Flares
« Reply #9 on: 19 Apr 2005, 18:07:52 »
In case you are still interested this is a script I use:

Code: [Select]
;WhiteFlareForeverBase1.sqs - script to cause Night Officers to fire white flares
;
;Format:  [unit,delay,timegap] exec "whiteflareForever.sqs"
; NB  unit must be an office with night equipment, not in SAFE or CARELESS mode

_unit = _this select 0
_delay = _this select 1
_timegap = _this select 2


~ 0.9*_delay + 0.2*(random _delay)

#Loop
if not (alive _unit) then {goto"End"}
_unit fire ["GrenadesMuzzle","flare"]
_unit addmagazine"flare"

;NB interval (timegap) between flares is +-20%
~ (0.8*_timegap + 0.4*(random _timegap))
goto"Loop"


#End

exit

Chris330

  • Guest
Re:Real Flares
« Reply #10 on: 20 Apr 2005, 08:54:29 »
I am certainly still interested :D. Can I ask though, does that script get the unit to auto reload his flares each time the script is run ???

I did a search and found out that it is impossible to get a unit to reload via the action command. What a shame. I think that should have been sorted in one of the games patches >:(

StonedSoldier

  • Guest
Re:Real Flares
« Reply #11 on: 20 Apr 2005, 09:03:30 »
_unit fire ["M203Muzzle","Flaregreen"] seems to work flawlessly for me, i can do it over and over again and the guy fires then reloads

Chris330

  • Guest
Re:Real Flares
« Reply #12 on: 20 Apr 2005, 09:07:32 »
Cheers mate ;), can you give me the full script you use. Do you have to add a magazine each time he fires ??? Or do you just run the fire command over and over again ???

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Real Flares
« Reply #13 on: 20 Apr 2005, 09:13:06 »
Quote
Can I ask though, does that script get the unit to auto reload his flares each time the script is run
You can certainly ask.  I thought though the title of the script would be a give away.
Quote
WhiteFlareForever
;)

Quote
each time the script is run
With this script you run it once only.  The unit you select will then continue to fire flares until he is dead.  It should be easy to change it for your needs.

I seem to remember there is some difference between east and west units, something like one of them only firing a flare on the second time of asking - but thereafer being okay.  I can't remember all the details, just experiment a bit.
« Last Edit: 20 Apr 2005, 09:13:58 by THobson »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Real Flares
« Reply #14 on: 20 Apr 2005, 09:14:51 »
Yes you do need to keep adding magazines or he will stop when he has run out.