Morbo513

Gearsc

Jun 2nd, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.70 KB | None | 0 0
  1. Gearscript Walkthrough
  2.  
  3.  
  4. Introduction to Gearscripts
  5. A gearscript (GS) is a script file read by the mission to assign gear to infantry units and cargo to vehicles in a mission. One gearscript is required per faction - they operate on the NATO, AAF and CSAT troops, and each side's vehicle classes.
  6. Each side present in the mission is required to use a gearscript - we don't use alternatives such as DSF's factions. If it's not NATO, AAF or CSAT, it's incompatible with our zeus and mission framework. If you neglect this, don't complain if your mission is denied by QA.
  7.  
  8. Creating a gearscript can be as simple or as complex as you need or want. Putting time and thought into them is encouraged, and this walkthrough will take you through all the steps to make a comprehensive GS.
  9.  
  10. Glossary of terms:
  11. Side - The side of the unit; BLUFOR, OPFOR, INDFOR
  12. Class- The class of unit; Rifleman, Grenadier etc.
  13. Classname - The name by which the game refers to any item. This can be anything from a soldier class, a magazine, a hat or a banana.
  14. Define - A definition in a gearscript. Can be comprised of one or multiple classnames.
  15. Inheritance - Some classes may inherit properties from others, to avoid redundantly re-stating said properties.
  16. Property - A proprety of a class, as defined in a gearscript. This can be weapons, vests, uniforms, magazines etc.
  17. Export List - The right-hand list seen on the right-hand side of the screen in Virtual Arsenal
  18. Export Button - The Export button displayed beneath the Export list
  19. Vanilla Export Button - The Export button along the bottom of the screen in Virtual Arsenal.
  20.  
  21. Setup:
  22. Notepad++ - Probably the best, most lightweight text-editor for this purpose
  23. Notepad++ SQF Library - Highlights stuff and shit
  24. CMF - Mission framework, contains gearscript templates
  25. Mission making tutorial - If you haven't read this already, go do so first.
  26.  
  27.  
  28. == Starting off: ==
  29. 1: Open ArmA 3, and from the main menu go to Tutorials > Virtual Arsenal
  30. 2: Go through all the tabs on the left, and set each of them to empty, also setting them to "Sorted by Mod" in the top-left drop-down.
  31. 3: Once done, hit "Save" at the bottom and name the loadout "#empty".
  32. 4: Open cfgLoadouts.hpp in <missionname.island\ in Notepad++
  33. 5: Rename baseTemplate_EAST.hpp <missionname.island>\C\Loadouts to SOV.hpp, and open in Notepad++
  34. 6: Open common.hpp in <missionname.island>\C\Loadouts in Notepad++
  35.  
  36. Assuming you've already extracted the framework and given the mission a name and terrain, you will find 3 template .hpp files in <missionname.island>\C\Loadouts.
  37. These are baseTemplate_WEST, _EAST and _IND. Each is pre-configured with different gear sets, but all of it can be changed. If you know one side is going to be Americans, and the other Russians, EAST and WEST are the ones you want to look at.
  38.  
  39. Throughout this tutorial, we will be using ~50s-era Soviets as an example - if you want to follow in this fashion, that means we'll be starting with baseTemplate_EAST.hpp.
  40. The first thing we will do is give this gearscript a clear, concise name. Rename the baseTemplate_EAST file to "SOV.hpp".
  41.  
  42. We want to give it a clear, concise name because we're now going to change an entry in cfgLoadouts.hpp. !WARNING! - getting this wrong will result in an immediate CTD when loading the mission in the Eden editor.
  43. Looking at cfgLoadouts.hpp, we see this:
  44. https://i.gyazo.com/114c965649c91ab5d8ec2a916d5b1590.png
  45.  
  46. The only things we're concerned with are:
  47. allowMagnifiedOptics = 0; (default). Changing this to 1 will allow assignment of any magnified optics as defined by gearscript.
  48. For our example, we will be assigning a scope to Squad Leaders, so set it to 1.
  49.  
  50. allowChangeableOptics = 1; (default)
  51. This will allow players to select an alternative optic during SafeStart. We're going to assign an alternative scope to the Squad Leader, so leave this at 1.
  52.  
  53. And finally,
  54. class opf_f {//OPF
  55. #include "c\loadouts\civilians.hpp"
  56. };
  57. This is what we renamed the gearscript file for. Once again, pay attention here - we're switching the entry for opf_f to read "c\loadouts\SOV.hpp". If we crash when loading
  58. the mission in editor, we've done this wrong.
  59. <CFGLOADOUTS IMAGE 2 - OPF_F SET>
  60.  
  61. So, assuming we've done all this correctly, it's time to move on to the gearscript its self!
  62.  
  63. Gearscript:
  64. Opening up SOV.hpp (Previously baseTemplate_EAST.hpp), we are greeted with this:
  65. https://i.gyazo.com/be9f3a8e2ca6d6a8c4b287699f6b4ae0.png
  66.  
  67. As you see, between the two lines, some extra input is required. We now tab back into ArmA 3's Virtual Arsenal.
  68. <VIRTUAL ARSENAL IMAGE 1>
  69.  
  70. Let's break it down. On the left, we have the gear selections. This is divided up into primary weapons, sidearms, launchers, hats, vests, uniforms etc.
  71. On the right, we have our Export list. This is what we'll use to fill the initial part of the gearscript.
  72. Along the bottom, we have several controls. The one we're most concerned with is "Export" - referred to as "Vanilla Export" henceforth.
  73.  
  74. So, we want an early Cold-War Soviet gearscript. This calls for AKMs, RPG-7s, PKMs, not enough food and too much vodka.
  75. The first field to fill in is "Uniform". This is all 4 uniform items - Uniform, Helmet/Hat, Vest and Backpack. Go through each of the gear tabs on the left, and fill them in as appropriate.
  76. For this, we will choose the M88 uniform from RHS, the 6b47/Vydra-3M (Khaki) from RHSGREF, the SSh-68 (Olive) helmet from the Soviet Pack, and the Sidor backpack from RHS. Once we've filled all these slots, we'll hit "Add uniform" on the Export List.
  77. <VIRTUAL ARSENAL IMAGE 2 - UNIFORM ASSIGNED>
  78.  
  79. Now we have our uniform assigned, it's time to move on to weapons.
  80. First up is our standard Rifle. This is issued to AARs. For this we'll be using the AKM from RHS, but we want a random chance of it being an AKS-47 instead. For now though, we will just add the AKM in the same fashion.
  81. We select the AKM from the left-hand gear tab, and as before with the Uniform, we click "Set Rifle" on the Export list.
  82.  
  83. NOTE: If multiple magazine types are added to the arsenal man, these will be added to the export list. Make sure he only has the one type of magazine you want. It's best practice to use magazines from the same mod as the weapon, as some mods like RHS and NIArms have special shit going on with magazines.
  84.  
  85. NOTE: If you intend for the players to have optics (reddot or otherwise) or any other attachments, you should put them on the rifle via Arsenal before hitting "Set Rifle". This way, JIPs won't be stuck with ironsights.
  86.  
  87. <VIRTUAL ARSENAL IMAGE 3 - RIFLE ADDED>
  88.  
  89. The process is the same for all other weapon types:
  90. <VIRTUAL ARSENAL IMAGE 4 - EXPORT LIST FILLED>
  91.  
  92. At this point, we can hit the Export Button beneath the list, and paste it into the template for a functional gearscript, making sure to glance over it for anything anomalous.
  93. If any #DEFINE says "NotSet" you MUST fix this or bad shit will happen.
  94. A properly-exported gear list will look like this:
  95. <GEARSCRIPT IMAGE 2 - TEMPLATE FILLED>
  96.  
  97. NOTE: The Export List will aim to give Riflemen enough magazines to equal at least 300 rounds; ARs and MMG 500 rounds. Keep this in mind if assigning bolt-actions etc.
  98. You can reduce or increase the number of a given magazine by changing the number immediately following the classname, eg. "rhsgref_5Rnd_762x54_m38:60" to "rhsgref_5Rnd_762x54_m38:20".
  99.  
  100. Saving the gearscript and loading the mission, we should see OPFOR looking like this:
  101. <IG IMAGE 1 - GEARSCRIPT APPLIED>
  102.  
  103.  
  104. Further Customisation:
  105. However, in this example there are many things we want to change, add and remove. For example, the MP-443 pistol would be anachronistic in an early Soviet gearscript.
  106. Referring to our SOV.hpp, we see a list of #DEFINEs following everything we just pasted in.
  107. <GEARSCRIPT IMAGE 3 - DEFINES>
  108.  
  109. Adding to and changing defines isn't a worry, but be wary of subtracting from them. More on that later.
  110. For now, we want to replace the pistol with the Tokarev TT-33 from RHSGREF. As you've probably seen, there is no field for the pistol on the Export List. This is what the Vanilla Export button is for, at the bottom of the screen in Arsenal.
  111. Tab back into ArmA 3. Find the Tokarev TT-33 in the left-hand list, and check his vest/uniform to ensure there are magazines present.
  112. Next, hit the Vanilla Export button, and paste the result into an empty text document:
  113. <EXPORT IMAGE 1 - TOKAREV>
  114.  
  115. We are looking for the classnames related to the Tokarev and its magazines. The former will be around the bottom of the exported text, while the magazines will be in the meaty bit between the middle and top.
  116. <EXPORT IMAGE 2 - HIGHLIGHT TOKAREV & MAG CLASSNAMES>
  117.  
  118. As you see, the classnames we see are highlighted. We're going to copy and paste these into the pertinent #DEFINEs in the gearscript
  119. <EXPORT IMAGE 3 - GEARSCRIPT TRANSPLANT>
  120.  
  121. We must ENSURE that, since these are classnames, they are surrounded in quotes - ". Since we want more than one magazine, the classname will read as such: "classname:4".
  122.  
  123. Now we have our pistol and its magazines defined, great! Start the mission as an AR or SL, and check it out, ensuring players have the proper number of mags and no errors are thrown.
  124. <GEARSCRIPT IMAGE 4 - DEFINES DEFINED>
  125.  
  126. This process is the same for all the other pre-defined equipment.
  127.  
  128. Our next step, since we're making a historical gearscript, is to eliminate all pieces of equipment that don't fit the era/faction. In this case, we want to remove the NVGs, MicroDAGR, Chemlights and IR Strobes.
  129.  
  130. Removing NVGs and chemlights is simple. The NVGs are set in the definitions of the gearscript as BASE_LINKED alongside COMMON_LINKED. Simply removing ",NODS" (Make sure you get the comma too!) from this line will achieve this.
  131. Chemlights are defined along with BASE_GRENADES. The process is the same.
  132. <GEARSCRIPT IMAGE 5 - NODS & CHEM>
  133.  
  134. For the rest of these items, we need to go into Common.hpp. Note that if you make changes here, you should post it along with the gearscript on the forums.
  135.  
  136. Common.hpp contains many different definitions that are shared by all gearscripts. More on that later - for now, we're only concerned with the following:
  137. <COMMON IMAGE 1 - COMMON_TOOLS>
  138.  
  139. Once again, simply delete the pertinent classnames - in this case "ACE_MicroDAGR","ACE_IRStrobe", and save the file.
  140.  
  141.  
  142. Class Manipulation
  143. Classes are the gear-sets for each role in the ORBAT. By manipulating the classes, we can further customise each individual class to our preference. This has uses from giving Squad-Leaders different headgear to visually distinguish them, to giving everyone pistols since it's a special-forces team.
  144.  
  145. The first class we're going to concern ourselves with is Soldier_F, AKA Rifleman. This is the class that ALL others in the gearscript inherit from - if a class doesn't have a given property defined, it will use what is set for the Rifleman. This is expressed as, eg. "class Fic_Soldier_Carbine: Soldier_F". The first classname is the one we're defining here; The second is what it's inheriting its properties from. Note, all classes here reflect an existing unit's classname. These can be seen in the editor by mousing-over a unit in the right-hand list.
  146.  
  147. <GEARSCRIPT IMAGE 6 - CLASSES>
  148.  
  149. Here we can see all the properties as defined in Soldier_F. A list of all possible properties is seen immediately above.
  150.  
  151. So, for our gearscript we want to do five things:
  152. Give FTL+ a 1p29 scope
  153. Give SL+ a choice between the 1p29 or PSO-1
  154. Give SLs a Beret
  155. Give the Rifleman AT an RPG-carrier backpack.
  156.  
  157.  
  158. Gearscripts and AI
  159. - GP Count
  160. - Fake NVGs
  161.  
  162. Gearscripts and TvTs
  163. - Balancing armour v weapons
  164. - GP Count
  165. - Necessary equipment
  166.  
  167. Misc
  168. - Setting up alternate optic choices
  169. - Randomisation
  170. - Magazine Compatibility
  171. - RHS/NIA magazine-switching/foregrip systems
  172.  
  173. Troubleshooting
  174. - BAD VEHICLE TYPE
  175. - Missing [/{/]/}/=
Add Comment
Please, Sign In to add comment