Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About badguy360th

  • Rank
  1. badguy360th

    Arma Languages support for Atom

    At the moment, this is not possible. To open up the documentation in a fast way, click on your SQF command and press CTRL+SPACE to open the autocomplete dialog.
  2. badguy360th

    A LoadoutFramework for Arma 3

    Good news. But its a very strange behavior. Feel free to ask, if you have further questions.
  3. badguy360th

    A LoadoutFramework for Arma 3

    Ok, I tested your code in the editor and it is working for me. Here is the proof:
  4. badguy360th

    A LoadoutFramework for Arma 3

    Could you provide me a RPT-file and/or the mission itself? Does nothing change after applying the loadout?
  5. badguy360th

    A LoadoutFramework for Arma 3

    hi boosterchen, local means that the code is executed on the machine, which owns and controls the unit. If it is an enemy AI unit, this code has to be executed on the server or headless client which controls the unit. If this unit is an ai unit, which is controlled by a player, this code needs to be executed on the player client machine. And if the loadout is applied to a player, this code has to be executed on the players machine. A good explanation about locality and MP scripting you can find here: http://killzonekid.com/arma-scripting-tutorials-basic-multiplayer-coding-v2/ Personally I used the onPlayerRespawn.sqf script to apply the loadouts to players. With this method, i make sure that the script is only executed on the players machine. With AI you can use if (!local this) exitWith {}; in init line to make sure, that the code is only be executed on the correct machine. Some questions/remarks to your problem: - is xmen an AI unit? - please try: if (!local this) exitWith {}; [this, "Rifleman"] call BG_fnc_applyLoadout; in init line. Could you post your cfgLoadouts.hpp and cfgTemplates.hpp. Did you use the current github repository? Hopefully some of my remarks can help you. Maybe you have found a bug. In the future I will provide an advanced example, how to use this script in mp-missions. Maybe I can provide this tomorrow. BadGuy
  6. Hello Community, I'm visiting this forum very often and I like to the informative threads here. Now I want to give something back to the community. It is a loadout framework for Arma 3: LoadoutFramework The LoadoutFramework simplifies the creation of unit loadouts in Arma 3. This script based approach uses config class definitions as loadout definitions. Due to this technique, class inheritance is possible and simplifies the mission editors life. Usage Setup Copy the loadoutFramework folder to your mission folder Edit your description.ext and include following: #include "loadoutFramework\base.hpp" class CfgFunctions { #include "loadoutFramework\cfgFunctions.hpp" }; Create Loadouts Every user created loadout is described in loadoutFramework/cfgLoadouts.hpp. In this file, only classes inherited from the Collection-class should be inserted. The Collection-class The Collection-class is the base class for all classes defined in the framework. This class describes the basic loadout-slots used in the framework. class Collection { uniform[] = {}; // Uniform. e.g. {'U_B_CombatUniform_mcam'} vest[] = {}; // Vest headgear[] = {}; // Headgear like helmets goggle[] = {}; // Goggles backpack[] = {}; // Backpack primaryWeapon[] = {}; //primary Weapon primaryWeaponOptic[]={}; // Scope for primary Weapon primaryWeaponMuzzle[]={}; // Muzzle Attachment for prim. Weapon primaryWeaponBarrel[] = {}; // Barrel Attachment for prim Weapon primaryWeaponResting[] = {}; // Weapon Resting Attachment like bi-pods primaryWeaponLoadedMagazine[] = {}; // the loaded magazine secondaryWeapon[] = {}; // secondary Weapon secondaryWeaponOptic[]={}; // same like primaryWeaponOptic see above secondaryWeaponMuzzle[]={}; secondaryWeaponBarrel[] = {}; secondaryWeaponResting[] = {}; secondaryWeaponLoadedMagazine[] = {}; handgun[] = {}; // handgun handgunOptic[]={}; // same like primaryWeaponOptic see above handgunMuzzle[]={}; handgunBarrel[] = {}; handgunResting[] = {}; handgunLoadedMagazine[] = {}; binocular[] = {}; // Binocular Item magazines[] = {}; // all magazines which can be stored in uniform, vest or backpack depending on space. E.g. {{"30Rnd_65x39_caseless_mag_Tracer",3},{"30Rnd_65x39_caseless_mag",6}}; for 3x 30 Rnd 6.5x39mm caseless Tracer and 6x 30 Rnd 6.5x39mm caseless magazines items[] = {}; // all other items (magazines are also possible) which can be stored in uniform, vest or backpack depending on space. Same definition like magazines[]. itemsUniform[] = {}; // all items (magazines are also possible) which have to be stored in uniform. Same definition like magazines[]. itemsVest[]={}; // all items (magazines are also possible) which have to be stored in vest. Same definition like magazines[]. itemsBackpack[] = {}; // all items (magazines are also possible) which have to be stored in backpack. Same definition like magazines[]. linkedItems[]={};// all items which are linked to a special slot (NVG, Map, Watch etc.). E.g. {"ItemWatch","ItemCompass","ItemMap","NVGoggles"}; script[]={};// A script which is executed after applying loadout. }; Every property is defined as an array. This allows the user to define multiple e.g. uniforms. The system chooses then one uniform randomly. Custom Loadout By inheriting the Collection-class (class MyLoadout : Collection), you can define your custom loadout by filling the properties. As class inheritance is possible, you can define additional loadouts based on other loadouts. Additional, you are able to aggregate sub-collections. Maybe you want to have a medical backpack and some weapons with a predefined magazine loadout, you can create some sub-collections which can be added to your unit-loadout. class Weapon_MX : Collection { // ideally added to cfgTemplates.hpp but not necessary primaryWeapon[] = {"arifle_MX_F"}; primaryWeaponOptic[]={"optic_Aco"}; primaryWeaponLoadedMagazine[]={"30Rnd_65x39_caseless_mag"}; primaryWeaponBarrel[] = {"acc_pointer_IR"}; magazines[] = {{"30Rnd_65x39_caseless_mag_Tracer",3},{"30Rnd_65x39_caseless_mag",6}}; }; class AnotherClass : Collection { ... }; class Rifleman : Collection { uniform[] = {"U_B_CombatUniform_mcam"}; vest[] = {"V_PlateCarrierL_CTRG"}; headgear[] = {"H_HelmetB_camo"}; goggle[] = {"G_Combat"}; backpack[] = {"B_AssaultPack_mcamo"}; handgun[] = {"hgun_P07_F"}; magazines[] = {{"16Rnd_9x21_Mag",2}}; itemsBackpack[] = {{"FirstAidKit",3}}; linkedItems[]={"ItemWatch","ItemCompass","ItemMap","NVGoggles"}; class PrimaryWeaponClass : Weapon_MX { // Some Collections added to Rifleman Collection primaryWeaponOptic[]={}; // Change optic to iron sight for this collection }; class AnotherSubCollaction : AnotherClass {}; }; As shown in this example, you can simply overwrite certain properties (primary weapon was changed to iron sight), if you wish to change the loadout for some loadouts. Sub-collections which are not usable standalone, should be created in the cfgTemplates.hpp-file. Applying the Loadout The function BG_fnc_applyLoadout applies the loadout to a unit. Syntax: [<unit>,<loadoutName>] call BG_fnc_applyLoadout; Note: <unit> has to be local! That's it. You can find this script on my GitHub account: GitHub