Jump to content
Sign in to follow this  
Militant1006

Tactical Weapon Attachment Template

Recommended Posts

this is true, this is why I didn't include it in the first version, I don't know, at this stage though, I am still working on the RH version, will get everything done then think about it.

For singleplayer user, a compromise might be to call yourself box1, it should make you an armourer lol.

Share this post


Link to post
Share on other sites

Strange bugs here in desert example mission:

Error in expression <g [false, false];

["Receiving",5] call RMM_fnc_loadingScreen;

if (!isNil "para>

Error position: <RMM_fnc_loadingScreen;

if (!isNil "para>

Error Undefined variable in expression: rmm_fnc_loadingscreen

Dependency problem?

Share this post


Link to post
Share on other sites

hmmm, probably because I am missing a preload module in the editor or something, well actually there could be a few things, I'll look into it, cheers.

Share this post


Link to post
Share on other sites
I wouldn't be able to get that working, since it uses the self interaction menu in either CBA or ACE.

Note that.

Share this post


Link to post
Share on other sites

Would it be awfully wrong to assume this has been tested and works in multiplayer?

-k

Share this post


Link to post
Share on other sites
Would it be awfully wrong to assume this has been tested and works in multiplayer?

-k

tested the otherday with the creator on a non-deticated, worked with a M16A2 but had no other weapons at the time that where in the script.

Share this post


Link to post
Share on other sites

Yeah, in thoery, and due to rommel's genius, it should work on Multiplayer fine, I have only tested an older version in multiplayer though (this script originated from a need to attach and detach a PVS-4 sight on the FAL).

Share this post


Link to post
Share on other sites

Tested on a dedicated server. Script worked very well. We're still seeing some errors with -showscriperrors parameter enabled and sometimes you have to 'F' select the weapon after configuring attachments.

Beyond this the implementation is flawless.

Share this post


Link to post
Share on other sites

Ok, great to know, I don't know about the errors really, would have to consult Rommel when he gets back from Canada, but it should actually affect anything within the mission.

Share this post


Link to post
Share on other sites

I just found this script and like what I see. Couple of questions, anyway to use this and not be dependent on ACE? Nothing against ACE, I am just not using it.

Being able to attach and remove a silencer would really be a nice addition in a lot of missions. I know it is dependent on the weapon having a model with and without a silencer.

Nomadd

BTW- Love the name of this script.

Share this post


Link to post
Share on other sites

hi.

isn't there any vanilla version for this?

thanks

Share this post


Link to post
Share on other sites

Ever hear anything from rommel on the script errors? Our Dev Team Manager for Military Gaming said the errors are not good, and that it would take a lot of work to resolve it, basically hinting at a rewrite.

UPDATE:

Here is the first main init.sqf error I am finding. The ones following are an example of what continues, even though I am not using M4A1.

Error in expression <g [false, false];

["Receiving",5] call RMM_fnc_loadingScreen;

if (!isNil "para>

Error position: <RMM_fnc_loadingScreen;

if (!isNil "para>

Error Undefined variable in expression: rmm_fnc_loadingscreen

File C:\Users\Justin M. Alderman\Documents\ArmA 2 Other Profiles\Capt%2e%20Alderman\mpmissions\TWAT.Desert_E\init.sqf, line 9

Error in expression <ons\M4A1\ccosd\fn_menuDef.sqf","main"],["Weapons\M27IAR\ironrco\fn_menu>

Error position: <"Weapons\M27IAR\ironrco\fn_menu>

Error Missing ""

Error in expression <ons\M4A1\ccosd\fn_menuDef.sqf","main"],["Weapons\M27IAR\ironrco\fn_menu>

Error position: <"Weapons\M27IAR\ironrco\fn_menu>

Error Missing ""

Error in expression <s\M4A1\rcom203\fn_menuDef.sqf","main],["Weapons\AK103\1p29gp30\fn_menuDef>

Error position: <"Weapons\AK103\1p29gp30\fn_menuDef>

Error Missing ""

Error in expression <s\M4A1\rcom203\fn_menuDef.sqf","main"],["Weapons\AK103\1p29gp30\fn_menuDef>

Error position: <"Weapons\AK103\1p29gp30\fn_menuDef>

Error Missing ""

Edited by Alderman
ERROR UPDATE

Share this post


Link to post
Share on other sites

Hmm, I could swear that never popped up when I just wrote it, weird.

Anyway, other things have really gotten out of hand, so I really don't know if I would be able to fix it. If you get the time though feel free to update it and put it in this thread and I'll edit the first post.

Share this post


Link to post
Share on other sites

Looks like we will just do a entirely new script, as we can do what is needed with far less scripting and effort than updating/fixing this one.

Share this post


Link to post
Share on other sites

This really a replacement for all the default weapons! I'd use it if I didn't have to use editing tools.

Share this post


Link to post
Share on other sites

It's NOT necessary to rewrite these scripts.

The first error you're seeing is because the loadingscreen is not included in that TWAT.Desert sample mission. Don't bother adding a preload manager module, just comment out the loading screen commands (there's an endloadingscreen command at the end of the init.sqf, too).

There are other errors which may be related to race conditions or overloading the menuing system - they may be innocuous, I haven't proven that, but I do know they are random. Sometimes it's one weapon (not the one I'm holding), other times it's other weapons. If it's not innocuous and random weapons are broken every time you load, then the solution is to restrict the number of weapons using this TWAT system. Edit the initweapons.sqf to remove the ones you don't need.

My buddy Mik and I tailored this only for the M4A1SOC and fixed a couple of issues:

1) you no longer need to press F or control F to get back to firing mode - using the SWITCHWEAPON action fixes that (the chosen index in the was-now code below might be specific to this weapon, but for other weapons you can experiment to find the index that works, and it might always be 1),

2) we removed the restriction on being near a crate, but to represent a delay and prevent you from switching modes essentially between rounds fired, there's a "bandaging" animation that closes with a "kneeling with weapon idle" animation. The bandaging animation actually places the gun on the ground, so it does appear as if you're working on your weapon. If you want a longer animation to force a longer delay, choose a longer animation (http://community.bistudio.com/wiki/ArmA2:_Moves).

If you want to do this, edit your fn_menuDef.sqf files (all of them) to include the changes shown below:

WAS:

["Add Suppressor",{ player removeweapon "ACE_SOC_M4A1"; player addweapon "ACE_SOC_M4A1_SD_9" },"", "", "", -1, 1, (primaryweapon player == "ACE_SOC_M4A1") && player distance box1 < 10],

["Remove Suppressor",{ player removeweapon "ACE_SOC_M4A1_SD_9"; player addweapon "ACE_SOC_M4A1" },"", "", "", -1, 1, (primaryweapon player == "ACE_SOC_M4A1_SD_9") && player distance box1 < 10]

NOW:

["Add Suppressor",{ player removeweapon "ACE_SOC_M4A1"; player playmove "AinvPknlMstpSlayWrflDnon_medic"; player switchmove "aidlpknlmstpslowwrfldnon_idlesteady02"; player addweapon "ACE_SOC_M4A1_SD_9"; player action ["SWITCHWEAPON", player, player, 1] },"", "", "", -1, 1, (primaryweapon player == "ACE_SOC_M4A1") ],

["Remove Suppressor",{ player removeweapon "ACE_SOC_M4A1_SD_9"; player playmove "AinvPknlMstpSlayWrflDnon_medic"; player switchmove "aidlpknlmstpslowwrfldnon_idlesteady02"; player addweapon "ACE_SOC_M4A1"; player action ["SWITCHWEAPON", player, player, 1] },"", "", "", -1, 1, (primaryweapon player == "ACE_SOC_M4A1_SD_9") ]

obviously leaving the weapon classes as is (just add the playmove, switchmove and SWITCHWEAPON commands and remove the && player distance box1 < 10 from the condition. Mik reconfigured the options for the M4A1SOC to A) remove the M203 because we would not screw around with adding or removing that in the field and if you want one you can get a weapon that already has an M203, B) remove the CCO because if you have a Holo (which allows for the 4x option) why bother with a CCO?, and C) added an option to have the 4x Holo attachment if there's no suppressor. So you can do long range or close quarters and in long range mode you don't have the suppressor option, and all these are "reasonable" to be changed out in the field, so we think. Having removed the F / control F interruption but adding the animation improves the immersion while preventing instant switching "between rounds fired", and we feel that's better than restricting it to crate proximity (if you're near a crate, just pick a different weapon).

many thanks to the source authors,

enjoy,

Stick

Share this post


Link to post
Share on other sites

hmm, never though of using a switchWeapon animation, looks good though thanks for putting time into improving it, the group I'm playing with isn't using ACE atm so I sorta abandoned this a bit, might go through it again if I get the time. Also using every weapon the script is made for is redundant, I have never used more than 5 at a time when putting it in missions, so good point to make.

Share this post


Link to post
Share on other sites

Hell, I'd never heard of the SWITCHWEAPON action until Mik and I started working with these scripts. Good stuff drives research to make it perfect. :)

Another approach to the F / control F issue might be to require the weapon mode to be SAFE before allowing an attachment switch (even more realistic), then remove the SWITCHWEAPON action. So the user must go to SAFE mode first then must come out of SAFE mode after the operation is complete. I like that idea and intend to implement it, but I only know how to do it using ACE. The condition can have this added to it:

and (weaponState player select 2 == "ACE_Safe")

and the SWITCHWEAPON action should be removed.

enjoy,

Stick

Share this post


Link to post
Share on other sites

The TWAT module is used in my Aliabad mission package, (http://www.armaholic.com/page.php?id=16877). I've used a similar fix as did Stick_Hogue.

However I've made an updated version which is easier to maintain, and more crucially doesn't require a certain chain of attachments to be added. Previously to get a M4a1 with a 203, eotech and silencer, you HAD to do eotech first, then silencer, then 203. etc. In my tweak you can add these attachments in any order.

I'll upload it once I get home. :)

-k

Share this post


Link to post
Share on other sites

[EDIT] Never mind the below note; as of now it appears to be working...

Unfortunately, I've learned that the weaponstate command is problematic at the moment.

https://dev-heaven.net/issues/28763

That's really a shame. Are there no other methods of detecting if a weapon safety is on?

Edited by Stick_Hogue

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  

×