Results 1 to 4 of 4

Thread: [function] Re-assign weapons for WW4

  1. #1

    Post [script] Re-assign weapons for WW4

    Equips individual units or whole groups with predefined sets of weapons. The weapon sets are based on the ones being used by the different types of WW4 units. It can also equip high dispersion (HD) ammo, suppressors, night vision goggles, antimaterial rifles (for the snipers) and grenade vests or flare pouches (for the grenadiers).

    The weapon value you pass to the script will be used as guidance for the weapons to be equipped. So, if you want to use M4s with Aimpoint sights you just need to set _weapon to "M4" and _sightInd to 1. The script will then assign that weapon to all the units in that group. When it finds a unit that uses a specialized version of that weapon (like a grenadier) it'll assign the one already used by the WW4 units that use M4Aim as default weapons. In the case of a grenadier would be a WW4_M4AimM203 (a M4 with attached grenade launcher and Aimpoint sight). This also applies to those who use specialized weapons. So, an auto-rifleman in this group will use an M-249, as that's the one used by the WW4 units that use M4Aim as default weapons. Etcetera.

    Weapons like rocket launchers and the like will be changed based on the origin of the weapon passed. For western or neutral ones SMAW, Carl Gustav, etc launchers will be assigned to the proper units. For easter ones RPG, AT4 launchers will be assigned instead.

    This script only allows one single instance to be running at any given time. You can still make as many simultaneous calls to this script as you want, but they will be executed consecutively to reduce the performance impact. It will take less than a second for a single instance of this script to finish for full groups (12 units). If you want to know when all the instances of this script are done you can check if the k_rawww4 variable is undefined. Example: if (format ["%1", k_rawww4] == "scalar bool array string 0xfcffffef") then { _scriptsFinished = true }

    Also, note that this script is supposed to be used at the start of the mission or for newly spawned groups, as it will reequip all the specified units with FULL ammo everytime this script is called.

    There's now two demo missions included in the .zip file. The first one is like the one provided with previous versions, with the addition of being able to assign weapons and equipment randomnly. The second one showcases the ability of this script to reassign weapons and equipment to large numbers of groups (eleven in this case) without too much performance impact. Be aware that the amount of units present in that demo mission (more than a hundred) will have a performance impact by itself depending on your computer specs.


    Latest version: 4.0
    DOWNLOAD: http://www.mediafire.com/download.php?dmbc85c363qe62b



    CONTAINS:
    • The script file (reassignweaponsww4.sqs)
    • Two demo missions (reassignweaponsww4_v4_demo1.Intro,reassignweapons ww4_v4_demo2.Intro)
    • Binarized versions of those missions (reassignweaponsww4_v4_demo1.Intro.pbo,reassignwea ponsww4_v4_demo2.Intro.pbo)
    • A folder with older versions of this script (\olderversions)



    ADDONS REQUIRED:



    SETTINGS:
    Spoiler:



    USE:
    [[array of units],"weapon type","sight type","suppressor","high dispersion",nv goggles?,_antimaterial?,"grenadier ammo"] exec "reassignweaponsww4.sqs"


    EXAMPLES:

    [[p1,p2],"m4",3,"","",true] exec "reassignweaponsww4.sqs"
    (equips p1 and p2 with M4s with Eotech sights -and equivalent weapons in that pack-, and with nv goggles)

    [units group this,"ak74m",2] exec "reassignweaponsww4.sqs"
    (equips all the units in the group with AK74Ms with Kobra sights -and equivalent weapons in that pack-)

    [units group this,"scar",2,"","",true,true] exec "reassignweaponsww4.sqs"
    (equips all the units in the group with SCAR-Ls with Reflex sights -and equivalent weapons in that pack-, nv goggles and assigns an antematiral rifle to the sniper)

    [units group this,"AKSU",2,"sd"] exec "reassignweaponsww4.sqs"
    (equips all the units in the group with silenced AK-SUs with Kobra sights -and equivalent weapons in that pack, which includes the VSS Vintorez in this case-)

    [units group this,"LR300",0,"","",false,false,"vest"] exec "reassignweaponsww4.sqs"
    (equips all the units in the group with LR300s -and equivalent weapons in that pack- and assign grenade vests to grenadiers)


    The script itself:
    Spoiler:


    ---
    CHANGELOG
    Spoiler:



    ------
    Use this, share this, modify this, etc as you please. Just put my name somewhere if you do so.
    Last edited by kenoxite; May 2 2012 at 12:13. Reason: script updated

  2. #2
    great post thank you for your time doing this!!

  3. #3
    I've updated the function file. Among other things, you can now assign all the weapons included in WW4 (previously only a selection was included) and you can now re-assign weapons to all the unit types in WW4 (previously recon and specop type of units weren't included).

    @njmatrix: Thanks!

    --
    EDIT: Function updated to version 3.0. Check the changelog to see what's changed, which is quite a lot this time.
    Last edited by kenoxite; Apr 27 2012 at 17:28.

  4. #4
    The file is updated again. This time comes with major changes.

    I've converted the function to script, to be able to include some sleep commands. Most of the code have been revised and tweaked, and a queue system has been included. All this has reduced the performance impact of this script significantly, and can now be used with huge numbers of groups without major problems.

    Check the updated info in the first post if you want to know more.

    This should also be the last update of this script (previous function).

Similar Threads

  1. WW4 Default Weapons Replacement
    By Vultar in forum ADDONS & MODS: COMPLETE
    Replies: 33
    Last Post: Jun 25 2012, 12:21
  2. How about a "Fire At Position" function for direct fire weapons???
    By Chris2525 in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 7
    Last Post: Jan 1 2011, 02:46
  3. Using "defend" function, AI not manning static weapons after being in a vehicle
    By Eclipse4349 in forum ARMA 2 & OA - TROUBLESHOOTING
    Replies: 2
    Last Post: Dec 21 2010, 10:38
  4. Using "defend" function, AI not manning static weapons after being in a vehicle
    By Eclipse4349 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Dec 21 2010, 03:41
  5. How do I assign British weapons?
    By Millzy85 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Dec 11 2010, 14:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •