Home   Help Search Login Register  

Author Topic: Flak on/flak off  (Read 740 times)

0 Members and 1 Guest are viewing this topic.

Korax

  • Guest
Flak on/flak off
« on: 27 Sep 2003, 02:12:25 »
Ok, so im using this flak script in a mission which creates random explosions around the plane..
But i want the explosions to stop once the plane has landed or has been destroyed, how would i do this? I also want the flak to start shooting again if a plane is back in flight...

Any ideas of how i would go about doing this?

Korax

  • Guest
Re:Flak on/flak off
« Reply #1 on: 27 Sep 2003, 03:34:00 »
Let me put it another way... how would i check if the plane is below a certain level? like 30m.
something like this?
getpos _target select 2 < 30 : goto "wait"
that doesnt seem to work but if i knew the command i could use a couple of loops in my script to do exactly what i want... i hope

thanks in advance

Korax

  • Guest
Re:Flak on/flak off
« Reply #2 on: 27 Sep 2003, 03:55:54 »
It's ok i figured it out  ;D
if anyones curious then heres what i did (i used pica's flak script and just added a loop with a couple of conditions, which will make the flak shells stop when you go below 30m, and begin again after you go above 31m)

Quote
;Created by Pica
;
;area of flak around target
;random  height of flak
;target aircraft
;game logic name
;ammo to use
;example
;[150,10,blackhawk,log1,"shell73"] exec "flak.sqs"


_area = _this select 0
_height = _this select 1
_target = _this select 2
_logic = _this select 3
_ord = _this select 4


#loop
_where = getpos _target
_logic setpos [(_where select 0) - random _area + random _area, (_where select 1) - random _area + random _area, (_where select 2) + random _height +10]

_bomb = _ord camcreate getpos _logic
_bomb = _ord camcreate getpos _logic

~random 2.5
;you can change the condition below the end
? (getpos _target select 2<30):goto "wait"

? alive _target : goto "loop"

#wait
~2.5
? (getpos _target select 2>31):goto "loop"
~2.5
goto "wait"

topic locked