Jump to content
Sign in to follow this  
FartParty

Making the AI Sandstorm fire?

Recommended Posts

This is probably a question that gets asked a lot, and I've found a few threads on it, but none that are any help

I'm working on a PVP mission, and I need the Sandstorm MLRS tanks to fire at a distant target

the target is not important, I just want the tanks firing

I've tried doTarget and doFire but they don't seem to doAnything

how can I get them to fire their rockets up into the air?

Share this post


Link to post
Share on other sites

Assuming someTarget is something like an invisible helipad way up high.

someSandstorm doWatch someTarget;
_shotFired = someSandstorm fireAtTarget [someTarget, "rockets_230mm_GAT"];

Just remember what goes up must come down...

Share this post


Link to post
Share on other sites

Well, the doWatch can go in the init. That'll raise the weapon up. Then just use the fireAtTarget whenever you wanted it to fire.

Share this post


Link to post
Share on other sites

oh okay, so the fireAtTarget would have to be in a script, then?

---------- Post added at 19:21 ---------- Previous post was at 19:12 ----------

I think i'm getting close, but still not there

What's wrong with this?

if (! isServer) exitWith {};

while {this} do

{

_shotFired = roc1 fireAtTarget [Target, "rockets_230mm_GAT"]; sleep 2;

_shotFired = roc2 fireAtTarget [Target, "rockets_230mm_GAT"]; sleep 2;

_shotFired = roc2 fireAtTarget [Target, "rockets_230mm_GAT"]; sleep 20;

};

---------- Post added at 19:21 ---------- Previous post was at 19:21 ----------

that is arty.sqf, called from a trigger

---------- Post added at 19:31 ---------- Previous post was at 19:21 ----------

nevermind, i got it working

thanks for your help!

Share this post


Link to post
Share on other sites

You should tell the thread what you did to get it working.

Share this post


Link to post
Share on other sites

I use this. Works a treat. Place 3 Sandstorms called mortar1 mortar 2 etc. Then target objects unit1 etc.

It's a thing of beauty watching those rain down :D

I'll have to find the original script writer on here. Props to them.

for "_i" from 10 to 30 do {  //--- set range of how many cycles you want the mortars to run 


   _mortar = [mortar1, mortar2, mortar3] call BIS_fnc_selectRandom;    //--- selects a random mortar unit out of array 
   _uni = [unit1, unit2, unit3] call BIS_fnc_selectRandom;             //--- selects a unit to target the round at 
   _center = getpos _uni;                                              //--- central point around which the mortar rounds will hit 
   _radius = 25;                                                       //--- random radius from the center turn lower for closer hits 

_pos = [ 
   (_center select 0) - _radius + (2 * random _radius), 
   (_center select 1) - _radius + (2 * random _radius), 
   0 
   ]; 


_mortar commandArtilleryFire [ 
                   _pos, 
                   getArtilleryAmmo [_mortar] select 0, 
                   2 //--- number of shots per turn per unit 
               ];                             


sleep 1; //--- delay between rounds 

};

Share this post


Link to post
Share on other sites

One thing I don't fully understand is how this part works.

for "_i" from 10 to 30 do {  //--- set range of how many cycles you want the mortars to run

Hats off to Camaris for the script.

Share this post


Link to post
Share on other sites

How at activate the script using a trigger?

I have created the script and then I wanted to make a trigger that can activate the script using radio.

My problem is I can't find the correct line to type in the trigger.

I have tried with exec "arty.SQF"; or execVM "arty.SQF"; and also without " but nothing helps.

Hope someone can tell me how to do this.

Thank you so much.

Share this post


Link to post
Share on other sites

Radio trigger Alpha or whatever

In the On Act field.

script=[] execVM "mortar.sqf";

Works with the scorcher as well. Which is better because they have launch sounds at the moment unlike the MRLS.

By god they make a proper mess of a town :D

---------- Post added at 10:16 PM ---------- Previous post was at 10:13 PM ----------

They run out of Ammo real fast so if you want to keep them chugging out rounds you can cheat with this in the init field of the arty unit.

this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]

Share this post


Link to post
Share on other sites

So my guns are firing, but now i'm having a different problem

the first salvo of rockets are great, they all go in the same direction

but after that salvo, the turrets start looking around like idiots and by the time they start the next salvo, rockets are going all over the place

i've tried disableAI "AUTOTARGET"

but that doesn't seem to work

neither did disableai "MOVE", they would still run away when enemy vehicles showed up, even with that code

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  

×