Jump to content
Sign in to follow this  
guziczek101

Effect tank firing on Random place's

Recommended Posts

If someone could write a script who will force the tank to shoot in random places if it's not a problem if the tower motion can be limited to 60 degrees to the right / left shot to the distance to 100 - 250 meters

I also add a image to explain what I mean (unfortunately I'm not Picasso)

obrazeku.th.jpg

Share this post


Link to post
Share on other sites

only way is downloading the Invisible targets by FOX or some another invisible targets, so the tank will shoot to their position.

Other way would be with the "Fire" command for example "tank1 Fire "NameofShellor Sabot"

Share this post


Link to post
Share on other sites

hi,

If someone could write a script who will force the tank to shoot in random places if it's not a problem if the tower motion can be limited to 60 degrees to the right / left shot to the distance to 100 - 250 meters

I also add a image to explain what I mean (unfortunately I'm not Picasso)

obrazeku.th.jpg

Here's a script to do what you want.

Addon needed: N/A

Addon suggested: N/A

Version: 1.0

By: Nikiller

Credits: Nikiller

MP compatable: yes

Required version: OFP 1.96 or CWA (ofp 1.99)

Description: this script makes a tank fire at random places in a defined area. Mission maker can choose the distance, axe X and axe Y.

installation: put the fx folder in your mission folder, give the unit a name and write in the unit's init field or in the init.sqs [vehicleName,axeX,axeY,distance] exec "fx\force_fire\tank_fire.sqs".

Note: for performance purpose I strongly recommand to make an array to define the vehicles name (i.e nik_west_m1a1=[WestM1A11,WestM1A12]) in the init.sqs

init.sqs

;********************************
;init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;********************************

nik_host=local server
nik_west_m1a1=[WestM1A11,WestM1A12]

;-----------------------------------------------------------------------------------------
; Force tank to fire
;-----------------------------------------------------------------------------------------
{[_x,150,100,100] exec "fx\force_fire\tank_fire.sqs"} forEach nik_west_m1a1

exit

tank_fire.sqs

;******************************************************
;Tank Fire Script by Nikiller v0.9b
;Force tank to fire on a defined area
;Note: Place a game logic named server on the map
;contact: nikillerofp@hotmail.fr
;[vehicleName,axeX,axeY,distance] exec "scriptName.sqs"
;example: [WestM1A11,200,100,100] exec "scriptName.sqs"
;******************************************************

~1+random 3

_u = _this select 0
_sx = _this select 1
_sy = _this select 2
_d = _this select 3

if nik_host then {} else {goto "ende"}

_u setBehaviour "COMBAT"
_del1=5
_del2=0.5
_g=gunner _u
_m=(magazines (_u) select 0)
_pu=getPos _u
_diru=getDir _u
_t="fire" createVehicle [0,0,0]
_t setPos [(_pu select 0)+_d*sin _diru,(_pu select 1)+_d*cos _diru,+0]
~_del2
_u doWatch _t
_pt=getPos _t

#l
~_del1
if ((canFire _u) && (alive _g)) then {} else {goto "ende"}
_cx=_pt select 0
_cy=_pt select 1
_cz=_pt select 2
_cx=_cx+(-_sx+random 2*_sx)
_cy=_cy+random _sy
_cz=0
;hint format ["%1", getPos _t]
_t setPos [_cx,_cy,_cz]
~_del2
_u fire (weapons (_u) select 0)
if (someAmmo _u) then {goto "l"}

~_del1
if ((canFire _u) && (alive _g)) then {_u removeMagazines _m; _u addMagazine _m; goto "l"}

#ende
_u doWatch objNull
~_del1
_t setPos [0,0,0]
~_del1
deleteVehicle _t
;hint "DEBUG: exit tank_fire.sqs"

exit

Here's a demo to show how it works: DEMO LINK

cya.

Nikiller.

Edited by Nikiller

Share this post


Link to post
Share on other sites

thanks Nikiller i was try to modify your script of forcing AA fire but I do not know still in mathematics

Share this post


Link to post
Share on other sites

Every time I place Mg(this works with mg?) that fire(firepit) keep on appearing around place where mg is firing!!! and i dont know how to remove it!!!

Share this post


Link to post
Share on other sites

hi,

thanks Nikiller i was try to modify your script of forcing AA fire but I do not know still in mathematics

What you asked to force AA fire and to force tank fire is not the same. I forgot about fireplace. I updated the script to don't see the fireplace anymore.

NEW DOWNLOAD LINK HERE

Every time I place Mg(this works with mg?) that fire(firepit) keep on appearing around place where mg is firing!!! and i dont know how to remove it!!!

It can be compatable with MG but you have to change the loop delay to be faster. If you are a bit more patient I'll post a script especially designed for MG in the next days.

cya.

Nikiller.

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  

×