;;Autoflare system for nightime illumination
;;requires a gamelogic as a marker
#START
?(Time>=Param1):exit
flare1="flaregreen" camcreate [getpos flarelogic1 select 0,getpos flarelogic1 select 1,1]
;;You can change these numbers. [0,0,0] will keep flare at spawn point until it goes out. Negative numbers reverse the direction
#LOOP
flare1 setvelocity [2,14,18]
?(flare1 distance flarelogic1) >100:goto "SLOWDOWN"
~0.1
goto "LOOP"
;;After getting X meters away from logic, flare goes to this number for slowing effect.
#SLOWDOWN
flare1 setvelocity [3,14,18]
;; Flare only burns for 15 seconds or so, so dont take it to high or far.
#end
exit
*************************************************************************
create a gamelogic named flarelogic1 where you want the flare to fire