Jump to content
Grumpy Old Man

[Release] GOM - Ambient AA V1.2.1

Recommended Posts

Sweet script thanks.  

Can't get it to work with the Faces of War Flak 36 but the Flak 30's fire fine.  

Share this post


Link to post
Share on other sites
14 hours ago, dystopian said:

Sweet script thanks.  

Can't get it to work with the Faces of War Flak 36 but the Flak 30's fire fine.  

 

Check if the position operating the flak36 gun is a gunner position. If it's a commander it might not work, could add a check for this in the future if that's the case.

 

Cheers

Share this post


Link to post
Share on other sites

Hey man, great script! I was wondering if it is possible to make AAA shoot in longer bursts (about 50 rounds and more). Wanted to make the new Praetorian (Phalanx CIWS) create a carrier defense ambience.

Share this post


Link to post
Share on other sites

Hi,

 

great Script looks realy nice

 

but i run in too some troubbles in my mission the AA guns will be destroyed and every time a plane destroys one i get this error

 

RPT Snapshot:

Error in expression <turret (assignedvehiclerole gunner _gun select 1);
_shotsleep = getNumber (confi>
Error position: <select 1);
_shotsleep = getNumber (confi>
Error Zero divisor
File C:\Users\*deleted*\Documents\Arma 3\missions\randommission.Tanoa\Ambient-AA\GOM_fnc_ambientAA.sqf, line 52

 

Share this post


Link to post
Share on other sites

@Grumpy Old Man Very nice ambient script, I found one bug, same as reported before me. I believe there are instances where the crew bails out which causes the 'assignedvehiclerole gunner _gun' array to be empty, so select 1 throws an error. I added the below line before it and I stopped seeing the error. Thanks.

 


if (assignedvehiclerole gunner _gun isEqualTo []) exitWith { true };

Share this post


Link to post
Share on other sites
15 hours ago, churrofighter said:

Since the DLC tanks the script is no longer working :down:

Interesting,

gonna look into it.

 

Cheers

Share this post


Link to post
Share on other sites

Updated to 1.2 with fixes as mentioned above and added parameter for custom rounds per salvo.

 

Cheers

  • Like 3

Share this post


Link to post
Share on other sites

Grumpy Old Boi i am currently working on a mission with your script, but both with it updated or with older version, i cant make ZSU39, Cheetah or Nyx to fire, they just turn the turret in right direction. I did tried with lot of other vechiles from CUP and RHS, no problem with them, can you assume what is the problem?

Share this post


Link to post
Share on other sites
46 minutes ago, Frenki said:

Grumpy Old Boi i am currently working on a mission with your script, but both with it updated or with older version, i cant make ZSU39, Cheetah or Nyx to fire, they just turn the turret in right direction. I did tried with lot of other vechiles from CUP and RHS, no problem with them, can you assume what is the problem?

ZSU39 and Cheetah should work fine, Nyx has the missiles selected by default, that might be causing the issue.

 

V1.2.1:

  • Fixed: Vehicles that had missiles selected as default would not fire

 

Let me know if you run into anything.

 

Cheers

 

  • Like 1

Share this post


Link to post
Share on other sites

I was using 20mm Nyx withouth rockets, but just like other two, he rises his gun towards sky but aint shooting. I will test it again today with 1.2.1 and will report back.

Share this post


Link to post
Share on other sites

I can see that theres some code in there to determine the firerate, but i'm an idiot and can't work out how to alter it? How would I do so?

Share this post


Link to post
Share on other sites
9 hours ago, Ketzl said:

I can see that theres some code in there to determine the firerate, but i'm an idiot and can't work out how to alter it? How would I do so?

Something like this will do:

 

test addEventhandler ["Fired",{
	params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
	_reloadTime = _unit getVariable ["TAG_fnc_fireRate",1];
     _unit setWeaponReloadingTime [_gunner, _muzzle, _reloadTime];
}];


test setVariable ["TAG_fnc_fireRate",0.75];

Where the value (0.75 as example) stands for seconds between rounds.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hey man, sorry to bother but I'm having a real headache here.

I created 5 AA guns and named them accordingly in the init field of the object.

this setVariable ["GOM_fnc_ambientAABatteryID","AABattery01",true];

The name "AABattery01" increases for each gun, so "AABattery02", "AABattery03" etc.
I created a trigger in my mission for present players with this in the "On Activation"-field

 

_battery = [AABattery01,AABattery02,AABattery03,AABattery04,AABattery05];
_AA = ["_battery",5] execVM GOM_fnc_ambientAA;


But everytime the trigger fires, it says "You need to specify AA guns through the object init field."
I checked the ambientAA.sqf myself and found out that if the _guns array returns empty, it says this.
If I try to put

_battery = [AABattery01,AABattery02,AABattery03,AABattery04,AABattery05];
_AA = [_battery,5] execVM GOM_fnc_ambientAA;

in the "On Activation"-field it says "Local variable in global space" and I cant save the trigger.

I don't know what I'm doing wrong, I'm not very good at scripting. Some help would be really appreciated, thank you!

Share this post


Link to post
Share on other sites

local variable: _battery , _AA

global one : battery, AA (no underscore)

 

In a trigger, use global ones or spawn/call the code.

Examples:
call {_battery = [AABattery01,AABattery02,AABattery03,AABattery04,AABattery05]; _AA = [_battery,5] execVM GOM_fnc_ambientAA; }

or

[] spawn {_battery = [AABattery01,AABattery02,AABattery03,AABattery04,AABattery05]; _AA = [_battery,5] execVM GOM_fnc_ambientAA; }

Share this post


Link to post
Share on other sites

Now its giving me undefined variable in expression "aabattery01"? I haven't changed anything in the obj init field?? And I straight up copied your examples, tried both of them.

Edit:
The "call" example is giving me an "generic error in expression" near the execVM order.

Edit2:
The "spawn" example is giving the undefined variable in expression "aabattery01". I didnt copy the other function in correctly. So neither of them is working unfortunately.

Edited by NeisAEL

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

×