• Announcements

    • Graim

      Web Archive of exilemod.com   07/30/2019

      Archived content is available at the link:
      http://web.archive.org/web/20190717131018/https://www.exilemod.com/ You can copy the contents of this address and add them to exilemod.net. This provides interactive support.
Sign in to follow this  
Followers 0
Whitey

DualArms - Two Primary Weapons

4 posts in this topic

///////////////////////////////////////////////////

///     Ersteller Andrew_S90     ///

//////////////////////////////////////////////////

 

Dual Arms

This is mod that allows use of two primary weapons, one in your main slot one in your launcher slot.

You can download the mod from here: http://steamcommunity.com/sharedfiles/filedetails/?id=1334412770

Now on A3Launcher! Thanks Maca!

There are some important overrides that need to be made to make this work with Exile, out of the box it has iffy results and sometimes the eventhandlers would overwrite each other I will provide instructions how to combine my eventHandlers with Exiles. Once the overrides work, then this will work great, just like it would in singleplayer.

 

Current bug: See the second weapon in the trader with an error image. Will take a look tomorrow solving this so you will not be able to see them in the trader.

Current feature: will stand up if you swap weapons while crouching/prone. This acts like exiles autorun.

 

 

Installation 

Client:

Step 1:

Paste the following into your description.ext - its very important because you need to override my hook file to disable the eventhandlers!! Otherwise it will break.

#include "custom\dual_arms\CfgSecondaryWeapons.hpp"

Inside CfgSecondaryWeapons you can turn addactions on and off, drop weapons on death on and off, block weapons as well as override any of my script files.

In mission.sqm please add "secondary_weapons" to addons to require players to have the mod, plus the server needs it as well. Like this:

addOns[]=
	{
		"exile_client",
		"secondary_weapons",
		"a3_map_altis"
	};

You will need to launch the @DualArms mod with your server.

 

Step 2:

The following overrides need to be made

ExileClient_gui_hud_event_onKeyUp

On line 170 (original files)

The code needs to be modified to:

			//Dual Arms Start
				private _dialog = uiNameSpace getVariable ["RscDisplayInventory", displayNull];

				if (secondaryWeapon player != "") then
				{
					if (((secondaryWeapon player) splitString "_") select ((count ((secondaryWeapon player) splitString "_"))-1) == "secondary") then 
					{
						if(!(SecondaryWeaponsSwapping) && (_dialog isEqualTo displayNull)) then
						{
							(primaryWeapon player) spawn SecondaryWeapons_events_swapSecondaryWeapon;
						};
					} else {
						if (secondaryWeapon player != currentWeapon player) then
						{
							player selectWeapon (secondaryWeapon player);
						};
					};
				} else {
					if (primaryWeapon player != "") then 
					{
						if(!(SecondaryWeaponsSwapping) && (_dialog isEqualTo displayNull)) then
						{
							(primaryWeapon player) spawn SecondaryWeapons_events_addSecondaryWeapon;
						};
					};
				};
				//Dual Arms End

ExileClient_object_player_event_onInventoryClosed

after like 16:

//Dual Arms
call SecondaryWeapons_events_onInventoryClosed;

ExileClient_object_player_event_onInventoryOpened

Most important override!!

  Reveal hidden contents

ExileClient_object_player_event_onKilled

After line 41 - not inside the brackets add:

//Dual Arms
_this call SecondaryWeapons_events_onKilled;

ExileClient_object_player_event_onTake

After line 15 and before the if statement I added:

//Dual Arms
_this call SecondaryWeapons_events_onTake;

Server:

Step 1:

Handling a disconnecting player, for Exile you will need to modify/make an override for ExileServer_system_network_event_onHandleDisconnect.sqf

You will need the following bit of code to save the users pointer attachment (IR Laser/Flashlight etc and UGL Ammo (HE Rounds etc))

//Dual Arms Start

		_SWInfo = _unit getVariable ["SecondaryWeaponsWeaponInfo", []];
				
		if(count _SWInfo > 0) then
		{
			_uniform = uniformContainer _unit;
			_vest = vestContainer _unit;
			_backpack = backpackContainer _unit;
			_containers = [_uniform, _vest, _backpack];
			{
				_item = _x;
				_className = "";
				_array = false;
				_added = false;
				if(typeName _item isEqualTo "ARRAY") then
				{
					_array = true;
					_className = _x select 0;
				} else {
					_className = _x;
				};
				
				{
					if (!(isNull _x)) then 
					{
						if (_x canAdd [_className, 1]) exitWith 
						{
							if(_array) then
							{
								_unit addMagazine [_className, _item select 1];
							} else {
								_className = [_className, 0, -10] call BIS_fnc_trimString;
								_unit addItem _className;
							};
							_added = true;
						};
					};
					if (_added) exitWith {};
				} forEach _containers;
			} forEach _SWInfo;
		};	
		//Dual Arms End

 

ExileClient_gui_traderDialog_updateInventoryListBox

see override on github to not display secondary weapons in trader menus.

 

Please see this github for an example mission edits:

https://github.com/Andrew-S90/DualArms

Download again is here: http://steamcommunity.com/sharedfiles/filedetails/?id=1334412770

Please post if you have any questions or mods to be added, they will be added in batches.

The current list of supported mods is:

RHSUSAF : http://steamcommunity.com/sharedfiles/filedetails/?id=843577117
RHSAFRF : http://steamcommunity.com/sharedfiles/filedetails/?id=843425103
RHSGREF : http://steamcommunity.com/sharedfiles/filedetails/?id=843593391
RHSSAF : http://steamcommunity.com/sharedfiles/filedetails/?id=843632231
NIArms : http://steamcommunity.com/sharedfiles/filedetails/?id=1208517358
Project Infinite : http://steamcommunity.com/sharedfiles/filedetails/?id=807038742
Exile Mod : http://www.exilemod.com/downloads/
ADR-97 Weapon Pack : http://steamcommunity.com/sharedfiles/filedetails/?id=669962280
Operation: TREBUCHET : http://steamcommunity.com/sharedfiles/filedetails/?id=769440155
Cup Weapons : http://steamcommunity.com/sharedfiles/filedetails/?id=497660133
NATO_Rus_Weapons : http://steamcommunity.com/sharedfiles/filedetails/?id=500929500
Specialist Military Arms (SMA) : http://steamcommunity.com/sharedfiles/filedetails/?id=699630614
The_Unsung_Vietnam_War_Mod : http://steamcommunity.com/sharedfiles/filedetails/?id=943001311
FFAA Mod : http://steamcommunity.com/sharedfiles/filedetails/?id=820994401
VME PLA : http://steamcommunity.com/sharedfiles/filedetails/?id=655153321
2035: Russian Armed Forces : http://steamcommunity.com/sharedfiles/filedetails/?id=543460260
FHQ Firearms : http://steamcommunity.com/sharedfiles/filedetails/?id=402601958
BWMod : http://steamcommunity.com/sharedfiles/filedetails/?id=1200127537
SFP: Swedish Forces Pack : http://steamcommunity.com/sharedfiles/filedetails/?id=826911897
3CB BAF Weapons : http://steamcommunity.com/sharedfiles/filedetails/?id=893339590
Faces of war : http://steamcommunity.com/sharedfiles/filedetails/?id=891433622
IFA3_AIO_LITE : http://steamcommunity.com/sharedfiles/filedetails/?id=660460283
Arma 3 Aegis (Beta) : http://steamcommunity.com/sharedfiles/filedetails/?id=949252631

 

Edited by Whitey

Share this post


Link to post
Share on other sites

Does this still work? I tried to implement the github altis example mission/server overwrites on my Exile server and it does not work for me.

Share this post


Link to post
Share on other sites

I think it still works but it is very buggy !!!

If you have the mod on the server duplicate axes, rocket launchers etc.

We have removed the mod because of that.

Share this post


Link to post
Share on other sites

For me, I found the issue in CfgSecondaryWeapons.hpp, this is turned off by default:

    UseAddActions = "false";

^^ I set this to "true" and the context menu started working.

I'll keep an eye out for these bugs. Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0