Jump to content
Sign in to follow this  
Big Dawg KS

BD MultiGunFix

Recommended Posts

Well, there's nothing really left to do, so I'm releasing v2.0. This is quite a significant update from the previous version (1.4), so please be sure to examine the readme.

UPDATE - 2.5

Version 2.5 released to take advantage of engine changes, and to add BAF vehicles. Please read the updated readme before using v2.5.

Version 2.2 released to fix the problem Z-Game was experiencing.

Version 2.1 released to fix a script error.

Compatability:

BD MultiGunFix v2.5 requires ArmA 2: Operation Arrowhead build 74094 or greater. See readme for more details.

BD MultiGunFix v2.0 is fully compatable with either ArmA 2, Operation Arrowhead, or Combined Operations (ArmA 2 + OA). Some features will only be available in OA obviously.

Short Description:

In ArmA 2 (prior to OA), there is no native support for multiple muzzle positions for vehicle weapons. This addon provides a set of scripts both for existing BIS vehicles and for new addon vehicles that allows the proper simulation of multiple muzzle/launch positions for any type of weapon.

As of Operation Arrowhead, the engine natively supports multiple muzzles (at least for bullet firing weapons), but this addon is still compatable with those vehicles that use this new native feature, and can still be used for addons if the native solution is not possible/preferable.

As of v2.0 of this addon, there is a new feature that allows weapons with multiple muzzle/launch positions to converge on a single point at a given distance. This feature is present for ArmA 2 stand alone, but currently the range can not be adjusted by the player. In Operation Arrowhead, this feature is tied to the native zeroing system; your rounds will converge at the range at which you are currently zeroed. Note: some BIS vehicles that use convergence do not allow zeroing. In this case, a fixed convergence range is used.

In addition, this addon includes a system that allows addon makers to easily enable multiple barrels/launch positions for new vehicles using only model and config changes and little scripting knowledge.

This file also includes an optional addon to enable zeroing for the 2S6M Tunguska's 2A38M guns (seperate readme included).

Version 2.5 Changes:

-reworked scripts to take advantage of changes to the fired EH with recent beta builds

--this should fix any remaining problems with "one sided" rockets

--this also makes use of 'originalMuzzleEnd' unneccessary

-improved method for detecting ammo count for weapons on any turret

-added BAF vehicles

--Apache AH1

--Wildcat AH11

Version 2.2 Changes:

-fixed possibility for Mi24 rockets to be incorrectly placed

Version 2.1 Changes:

-fixed script error

Version 2.0 Changes:

-added vehicles from OA

--M2A2

--M2A3

--M6

--AH6

--Mi17 (CZ)

--Stryker (TOW)

--L39

-added feature: convergence

-added support for OA zeroing

-improved MP compatability

-additional config definitions for addons

Required Addons:

Still requires extended eventhandlers. It has no direct dependencies on CBA, but if you run XEH without CBA it might give you errors.

Feedback:

While I did test it pretty well, if you do notice any problems or have anything else worth noting, just post them here in this thread.

Readme:

+=====================+

| BD MultiGunFix v2.5 |

+=====================+

Author:

======

Big Dawg KS

Credits:

-------

Big Dawg KS - scripts

oyman - testing

The D - testing

Thanks:

------

Sickboy

Killswitch

Changelog:

=========

v2.5

-----

-reworked scripts to take advantage of changes to the fired EH with recent beta builds

--this should fix any remaining problems with "one sided" rockets

--this also makes use of 'originalMuzzleEnd' unneccessary

-improved method for detecting ammo count for weapons on any turret

-added BAF vehicles

--Apache AH1

--Wildcat AH11

v2.3

-----

-fixed possibility for rockets to be incorrectly placed (all vehicles)

v2.2

-----

-fixed possibility for Mi24 rockets to be incorrectly placed

v2.1

-----

-fixed script error

v2.0

-----

-added vehicles from OA

--M2A2

--M2A3

--M6

--AH6

--Mi17 (CZ)

--Stryker (TOW)

--L39

-added feature: convergence

-added support for OA zeroing

-improved MP compatability

-additional config definitions for addons

v1.4

-----

-fixed minor script error

-reworked MP compatability

-improved support for addons

v1.3

-----

-added more BIS vehicles

-added support for addons

v1.0

-----

Initial Release

Description:

===========

Multiple Muzzles:

----------------

In ArmA 2 (prior to OA), there is no native support for multiple muzzle positions for vehicle weapons. This addon provides

a set of scripts both for existing BIS vehicles and for new addon vehicles that allows the proper simulation of multiple

muzzle/launch positions for any type of weapon.

As of Operation Arrowhead, the engine natively supports multiple muzzles (at least for bullet firing weapons), but this

addon is still compatable with those vehicles that use this new native feature, and can still be used for addons if

the native solution is not possible/preferable.

Convergence:

-----------

As of v2.0 of this addon, there is a new feature that allows weapons with multiple muzzle/launch positions to converge

on a single point at a given distance. This feature is present for ArmA 2 stand alone, but currently the range can not

be adjusted by the player. In Operation Arrowhead, this feature is tied to the native zeroing system; your rounds will

converge at the range at which you are currently zeroed. Note: some BIS vehicles that use convergence do not allow

zeroing. In this case, a fixed convergence range is used.

Those vehicles that do not currently use zeroing are the AH-6J and Tunguska, which converge by default at 400 and 500

meters respectively.

BIS Vehicles:

------------

This addon contains a few simple scripts that fix the simulation of bullets and missiles firing from the correct places on BIS vehicles.

The following vehicles are effected:

ArmA 2 vehicles:

-Mi-24 (all factions & varients)

-ZU-23 (all factions)

-Shilka (all factions)

-Tunguska

-Ural ZU-23 (all factions)

-BRDM-2 ATGM (all factions)

-Avenger HMMWV

-BM-21 GRAD (all factions)

-MLRS

-Igla AA Pod

-Stinger AA Pod

-AH-1Z

-AH-64

-A-10

-AV-8B

-UH-1Y

-BMP-3

-Mi-8MTV

-Ka-52 (both varients)

-Su-25 (all factions & varients)

OA Vehicles (of those not included in ArmA 2):

-M2A2 Bradley

-M2A3 Bradley

-M6 Linebacker

-Mi-171Sh (CZ)

-AH-6J

-L-39

-Stryker (TOW)

BAF Vehicles:

-Apache AH-1

-Wildcat AH-11

All gun barrels, rocket and missile launchers are correctly simulated for these vehicles.

Addons:

------

In addition, this addon includes a system that allows addon makers to easily enable multiple barrels/launch positions for new vehicles using

only model and config changes and little scripting knowledge.

How to use the system for new vehicles:

1. Create a memory point with a named selection in your model for each position you want the projectiles to be fired from

2. In the vehicle's config, define a class called BD_MultiGunFix

3. In class BD_MultiGunFix, you can define any number of 'weapon groups'. A weapon group is one set of guns or launchers that when fired,

the projectiles will be distributed among all the positions defined in that group. For example, if your vehicle has 4x30mm cannons and 2 missile

launchers, you would have a 30mm cannon group and a missile group. The groups are defined as classes

4. For each group class, define an array called 'weapons' and an array called 'positions'. The positions array contains all of the selection names

you defined in your model that you want this group to use, and the weapons array contains the classnames of all the weapons that will use

that set of positions.

5. The last step is to simply ensure that BD_MultiGunFix is installed and loaded when you start up ArmA 2. Using this system will not make

your addon require BD_MultiGunFix, rather when the user is running your addon while using BD_MultiGunFix the fix will be applied, and

if not your addon will function normally without the fix (with a limit of only 1 firing position per weapon type).

Primary Config Definitions:

--------------------------

weapons[] - array of weapon classnames (strings):

for which weapons this configuration should be used

positions[] - array of model selections (strings):

which memory points of all new muzzles

Optional Config Definitons:

--------------------------

originalMuzzleEnd - model selection (string):

original muzzle position (helps improve "catching" the projectile)

Note: no longer serves any purpose as of v2.5

preMgFixCode - code (as string):

optional code you want to call (will be called by MgFix scripts)

before MgFix repositions the projectile; useful for scripts that

are dependent on the projectile being in its original position.

Note: if you use this, make sure you check in your code if

MultiGunFix is enabled (using global variable 'BD_MgFix_Init')

to avoid calling it twice (ie. once from MgFix and again by your

regular fired eventhandler).

zeroRanges[] - array of numbers:

(ArmA 2 only) possible zero (convergence) ranges

Note: currently there is no way to adjust zeroing in ArmA 2,

only the default value will be used (see defaultZeroIndex)

defaultZeroIndex - number:

(ArmA 2 only) index of zeroRanges to use as default zeroing

Note: currently there is no way to adjust zeroing in ArmA 2,

only the default value will be used

turretPath - string:

(OA only) the turret path (as it is used in turretUnit) of the

gunner who will use this configuration; used to get current zeroing

applyConvergenceOnly - boolean (number):

(OA only) if set to true (not 0), then MultiGunFix data will

only be used for convergence; this is if you want to use OA's

native support for multiple muzzles instead of MultiGunFix's

scripted workaround for positioning the projectiles, but still

want to use convergence from MultiGunFix

Config Example:

--------------

class CfgVehicles {

...

class MyVehicle { // your vehicle class

...

class BD_MultiGunFix {

// this example is for ArmA 2

class 30mm {

weapons[]={"30mmCannon"};

positions[]={"30mmMuzzle1","30mmMuzzle2","30mmMuzzle3","30mmMuzzle4"};

originalMuzzleEnd="konec hlavne"; // obsolete as of v2.5

zeroRanges[]={300,400,500};

defaultZeroIndex=1;

}

// this example is for Operation Arrowhead

class Missiles {

weapons[]={"MissileLauncher"};

positions[]={"missilePosition1","missilePosition2"};

originalMuzzleEnd="konec hlavne"; // obsolete as of v2.5

turretPath="[0]";

};

};

};

};

Global Variables:

----------------

There are two global variables you may or may not find useful.

BD_MgFix_Init - boolean

whether or not MgFix has been initialized locally (false for

clients who do not have MgFix installed locally)

BD_MgFix_OnServer - boolean

true (for all clients) if MgFix is running on the server

Multiplayer:

===========

As of v1.4 this addon should be fully MP compatable. The addon need only be installed on the server, and the changes will be applied

for all clients. If the addon is not installed on the server, it will be disabled for all clients, regardless of whether they have it installed.

As of v2.0, full JIP compatability should also be present. The addon still need only be installed on the server, and must be installed on the

server.

Expansions:

===========

BD MultiGunFix v2.0 fully supports both ArmA 2 and ArmA 2: Operation Arrowhead. It does not require either, and will

work on ArmA 2 stand alone, OA stand alone, or ArmA 2: Combined Operations (ArmA 2 + OA).

Note: some features/functionality will only be available in OA.

As of v2.5 however, this addon may not work in standalone ArmA 2. See the requirements below for details.

Requirements:

=============

THIS ADDON REQUIRES EXTENDED EVENTHANDLERS

This addon should also be compatable with any other addons provided they don't interfere with the XEH stuff.

AS OF VERSION 2.5 THIS ADDON REQUIRES BUILD 74094 OF OA OR GREATER

Specifically, this change:

[73642] New: event handler "fired" returns magazine name and object of projectile.

This means this addon WILL NOT WORK in regular ArmA 2 unless/until this change is added in a future patch.

Disclaimer:

==========

I am not responsible for ANYTHING that happens to your computer by using this addon. Use at your own risk.

Installation:

============

Install the pbo & bisign files into the Addons folder in your ArmA 2/OA directory or any mod directory. Install the

bikey file in your Keys directory.

Download:

Version 2.5

Armaholic (Thanks to Foxhound)

Mediafire

Version 2.2

Armaholic

Mediafire

Version 2.1

Mediafire

Version 2.0

ArmA 2 Files

Armaholic (thanks Foxhound)

Additional mirrors would be appreciated.

Edited by Big Dawg KS
Update released

Share this post


Link to post
Share on other sites

Thanks Foxhound.

Sorry about all the random newlines in the middle of the description. It was left over from copy/pasting from the readme. It's fixed now.

Edit: In case anyone is curious, the BD TunguskaZeroing is a totally optional fix that adds zeroing to the Tunguska, thus allowing the convergence to be adjusted (with the zeroing). Please see the readme for it before using it.

Edited by Big Dawg KS

Share this post


Link to post
Share on other sites
In the previous version, I found the problem when behaving fire any of Mi24 - much of missiles fly to left wing, not both equally, perhaps this is just me, i hope in this version will not be such, I can not understand this is only my - http://s51.radikal.ru/i133/1007/8c/a9bd39d6cde6.jpg

Did you try v2.0? It's the only version that is compatable with OA. If it still does not function properly, please tell me specific repro steps or if you are running any other addons/mods.

Share this post


Link to post
Share on other sites

Someone has pointed out quite a stupid error in one of my scripts. I will release a fix in a few minutes after some more testing.

---------- Post added at 10:35 AM ---------- Previous post was at 09:37 AM ----------

Fix released as v2.1. See first page for download. Mirror providers, please update your mirrors. Thanks.

The error didn't effect any of the BIS vehicles, but would have definately broken the system for addons trying to use it.

Thanks to CameronMcDonald for pointing out my idiocy. :o

Share this post


Link to post
Share on other sites

I only connect your addon or anything unchanged (http://s42.radikal.ru/i097/1007/08/a7f5439e0a19.jpg), the same problem was in previous versions 1.3 and 1.4 on a clean ArmA 2, at the moment I have installed ArmA 2 Combined Operations and in version 2.1 the problem persists. I'm just not Know is a problem only for me or is there More people

Share this post


Link to post
Share on other sites

Z-Game, I'll look into it. I was able to reproduce this, but only while running another script that modified the velocity of the rockets. Still, I think I can make it more robust to avoid this. Be patient and look out for another update.

Share this post


Link to post
Share on other sites

You know you can edit the thread title yourself right? Please do so ;)

Share this post


Link to post
Share on other sites
You know you can edit the thread title yourself right? Please do so ;)

I tried... didn't seem to work. It updated the title on the top of the post, but the thread title (as it appears among the other threads) didn't update... unless I'm doing it wrong?

Edited by Big Dawg KS

Share this post


Link to post
Share on other sites
I tried... didn't seem to work. It updated the title on the top of the post, but the thread title (as it appears among the other threads) didn't update... unless I'm doing it wrong?

Well I tested with a regular member account, posted a thread, then went to edit the first post, clicked advanced, changed the title and it updated the title?

Share this post


Link to post
Share on other sites

Placebo, usually there is a time limit. If you don't do it within a set amount of time (10 mins or so?) then you can't edit if you're a "blue" member. I'm pretty sure of this, it's like that on most VB based forums

Share this post


Link to post
Share on other sites
Well I tested with a regular member account, posted a thread, then went to edit the first post, clicked advanced, changed the title and it updated the title?

Did exactly that, and while it updated the title on the post itself, the title of the thread didn't change. Must be what Fox '09 said. Anyway, I'd really like to have the most recent version number in the thread title so the mirror providers will see an update has been released.

Share this post


Link to post
Share on other sites

Big Dawg KS, thanks for good addon. There is a bug or maybe typo in config, which appears from version 2.0.

All shilkas shoots to the left from the reticle center. This appears on the OA and A2. Please fix.

Screens:

82f51643631173abd3069ad3f3e4b968.jpg 3e028645d12680c2298f52d2bb64b338.jpg 3910fa48ef7e03b7b54b7b194ed2464e.jpg a2ca4e1f95b9d00663133d53186ac36d.jpg

Edited by SLAYER_RF

Share this post


Link to post
Share on other sites

Big Dawg KS thanks for having removed the small problem with the Mi24, I hope you're going to do More useful add-ons))

SLAYER_RF as arrows with Shilka, I did not even notice that she had little iskrevlenny sight, it's good that you noticed it))

Share this post


Link to post
Share on other sites

More the same problem found on 2 chopers (apparently after Mi42 I have not looked at once more)

c0c4eb93ff1c2d997215cf30dc1d18cc.jpg

13e7348aadb3dd41326ed6cc9e56d5b0.jpg

I used a different rate of fire!

Edited by Z-Game

Share this post


Link to post
Share on other sites

Yes, I only updated the Mi24s since I wasn't able to reproduce it ony any of the other aircraft, but the same fix should work on them. I dunno what it is you're doing to make it happen but I'll apply it to all aircraft in the next release. ;)

SLAYER_RF, I have reproduced it but I can't figure out the cause. It seems to be related to the FCS simulation that automatically leads the target when you lock on to it, but still haven't identified why it breaks my scripts.

Share this post


Link to post
Share on other sites

GJ Big Dawg.

There's minor flaw when player tries to use Your addon with ACE: since gunship rockets/Hind-F gun ammo count cannot be checked there (fixed weapons are utilized by pilot there), I suggest You replacing standard rocket repositioning decision code to:

if(_weap isKindOf "RocketPods")then{

_ammoC = if (isNil {_veh getVariable "BD_FiredCount"}) then {0} else {_veh getVariable "BD_FiredCount"};
_oPos = switch(_ammoC mod 2)do{
case 1:{_veh setVariable ["BD_FiredCount",0]; _veh selectionPosition "Rocket_1"};
default{_veh setVariable ["BD_FiredCount",1]; _veh selectionPosition "Rocket_2"};
};

That solution is a bit more "modproof" and can be executed for example on various kinds of helicopters without single change :)

Best regards,

zGuba

Share this post


Link to post
Share on other sites
GJ Big Dawg.

There's minor flaw when player tries to use Your addon with ACE: since gunship rockets/Hind-F gun ammo count cannot be checked there (fixed weapons are utilized by pilot there), I suggest You replacing standard rocket repositioning decision code to:

a snippet of my code

That solution is a bit more "modproof" and can be executed for example on various kinds of helicopters without single change :)

Best regards,

zGuba

As you can see, yes I did use that method as a workaround to limited functionality of the ammo command in places where it existed in the BIS stuff (the Mi8/17s). Also if you look at the scripts for addon support, it checks for this and automatically uses the workaround method when ammo fails.

Anyway, here's the problem I have with implementing it as standard for all BIS vehicles:

1. While it'd mostly be copy/paste, it's still quite a bit of work.

2. I have concerns that said workaround might not be as efficient, and may be more prone to failing in MP.

3. I don't like the idea of modifying my stuff to make it compatable with ACE. I don't really care for ACE, and don't like taking responsability to fix stuff that ACE tends to "break".

But it's certainly something to consider. In fact, the way I designed BD MultiGunFix should allow other addon makers to create a solution to this. You could make the modifications yourself, then make an addon that "patches" my code. If you want to know how to do this send me a PM.

However if you can convince me that using the setVariable method is better (besides ACE), I will certainly implement it for everything. Just come up with a compelling enough argument. :)

Edited by Big Dawg KS

Share this post


Link to post
Share on other sites

ace is a separate mod , not a standard.

Edited by Fox '09
wrong thread stupid me

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  

×