Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
tmf:assigngear [2016/04/25 23:15]
snippers [Switching faction configs]
tmf:assigngear [2016/07/25 22:57]
morbo [Creating/Modifying your own faction config]
Line 18: Line 18:
  
 ==== Creating/​Modifying your own faction config ==== ==== Creating/​Modifying your own faction config ====
-Firstly if you want to tweak assigngear the best thing to do is use a text editor ​that can do syntax highlighting. I would recommend using notepad++If you wish to create your own the best thing to do is to copy an existing config and modify it. The first thing you then need is a short introduction on how classes work.+Text editors ​that support ​syntax highlighting ​are recommended for creating/​modifying assigngear loadouts, for example Notepad++ 
 + 
 +If you wish to create your owncopy an existing config ​from the Loadouts folder in the mission'​s folder ​and modify it. 
  
 === Config 101 === === Config 101 ===
Line 27: Line 29:
 <code cpp>​PROPERTY = VALUE;</​code>​ <code cpp>​PROPERTY = VALUE;</​code>​
  
-Each of these properties is responsible for different things. For example the '​displayName'​ property is used as a description for this particular kit so if you use '​displayName = "​Rifleman";'​ that will set the description of that role to Rifleman. Note there can not be two of the same property ​in a class.+Each of these properties is responsible for different things. For example the '​displayName'​ property is used as a description for this particular kit so if you use '​displayName = "​Rifleman";'​ that will set the description of that role to Rifleman. Note: There can not be two of the same property ​within ​a class.
  
 There are also array properties. Arrays are lists which take the format of: <code cpp>​PROPERTY[] = {"​element1",​ "​element2",​ ... };</​code>​ There are also array properties. Arrays are lists which take the format of: <code cpp>​PROPERTY[] = {"​element1",​ "​element2",​ ... };</​code>​
Line 36: Line 38:
 **Class Inheritance** **Class Inheritance**
  
-One really nice feature of classes is that can inherit from other classes ​for example 'class g : r' means that class g inherits from class r. In essence ​all the properties from r now exist in g with the same valueso 'class g : r {};' would make g exactly the same as r. Any property we now set in g will override the value that is inherited from r. For example:+Classes ​can inherit from others, ​for example 'class g : r' means that all the properties from class r now exist in class g with the same values. 'class g : r {};' would make class g exactly the same as class r. Any property we now set in g will override the value that is inherited from r. For example:
 <code cpp>​class g : r {  <code cpp>​class g : r { 
     displayName = "​Grenadier";​     displayName = "​Grenadier";​
 };</​code>​ };</​code>​
-g is still the same as r except the displayName has now be changed. This is really ​useful ​if for one kit you only want to make small changes.+Class g is still the same as r except the displayName has now been changed. This is useful for making variations of a given loadout; for example, often the only difference between a Grenadier and a Rifleman (g and r, respectively) is the primaryWeapon and the addition of launcher grenades:
  
-The last thing you can do with inheritance is specific to array attributes you can use the '​+='​ operator to append to an inherited array. For example: +<code cpp>​class ​r : baseMan 
-<code cpp> +
-class +    ​displayName = "​Rifleman";​ 
-    ​linkedItems[] = {"ItemWatch", "ItemMap", "ItemCompass"};+    headgear[] = {"rhsusf_lwh_helmet_marpatd"}; 
 + vest[] = {"​rhsusf_spc_rifleman"​};​ 
 +    primaryWeapon[] = {"​rhs_weap_m16a4_carryhandle"​};​ 
 +    attachment[] = {"​rhsusf_acc_anpeq15side"​};​ 
 +    magazines[] = 
 +    { 
 +        LIST_11("​30Rnd_556x45_Stanag"​), 
 +        LIST_2("30Rnd_556x45_Stanag_Tracer_Red"), 
 +        LIST_2("HandGrenade"), 
 +        LIST_2("​SmokeShell"​) 
 +    }; 
 + items[] = 
 +
 + LIST_3("​ACE_fieldDressing"​),​ 
 + "​ACE_morphine"​ 
 + };
 }; };
-class ftl : g { +class g : r 
-    ​linkedItems[] += {"Rangefinder", "ItemGPS"}; +
-} +    ​displayName = "​Grenadier";​ 
-</​code>​ +    primaryWeapon[] = {"​rhs_weap_m16a4_carryhandle_M203"​};​ 
-The linkedItems for ftl are now: "​ItemWatch"​,"​ItemMap","​ItemCompass""​Rangefinder"​ and "​ItemGPS"​Each of these will be given to a unit that matches ​the class.+    magazines[] += 
 +    ​{ 
 +        LIST_8("1Rnd_HE_Grenade_shell"), 
 +        LIST_4("1Rnd_Smoke_Grenade_shell"
 +    ​}; 
 +};</​code>​ 
 + 
 +As displayed abovethe primary weapon assigned to the Grenadier class overrides the one inherited from the RiflemanHowever, in the case of magazines, the '​+='​ operator is used to append ​to the inherited array. In the above example, the Grenadier ('​g'​) ​class is given all the same items as the Rifleman ('​r'​) class, but with the addition of smoke and HE grenades for his grenade launcher due to the use of the '​+='​ operator in the magazines array. 
  
 === Getting classnames === === Getting classnames ===
-The easiest way to get the classnames ​of items/​weapons/​uniforms etc. is use the virtual arsenal in arma 3 (accessible from the main menu via learn -> virtual arsenal). All you need to give in virtual aresnal is give yourself the items/​weapons etc. that you want the classnamesNext press the export buttonthe game will have now copied a script into your clipboard ​open up a text editor and paste it in. An example output will like this:+The easiest way to get the classname ​of items/​weapons/​uniforms etc. is to use ArmA 3's Virtual Arsenal ​(accessible from the main menu via Tutorials ​-> Virtual Arsenal). In VA, you can give yourself the gear you wish to include in a loadoutPressing ​the export button ​will copy the loadout to the clipboard. An example output will look like this:
 <code cpp> <code cpp>
 comment "​Exported from Arsenal by Snippers";​ comment "​Exported from Arsenal by Snippers";​
Line 88: Line 113:
 this linkItem "​ItemWatch";​ this linkItem "​ItemWatch";​
 </​code>​ </​code>​
-All you then need to do is find the classname in there that you are looking for and add it back to the role in the faction config.+It's recommended ​to paste the Virtual Arsenal export into an empty text file besides the config; From thereyou can find the classnames of the items you wish to use and paste them into the appropriate arrays ​in the faction config.
  • tmf/assigngear.txt
  • Last modified: 2020/07/04 19:25
  • by snippers