Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| tmf:assigngear [2016/03/19 14:23] – [Creating your own faction config] snippers | tmf:assigngear [2025/08/03 14:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Assign Gear ==== | ==== Assign Gear ==== | ||
| - | Assign gear is the name of the feature that handles gear assignment. We do not support using arsenal loadouts for players. This is because it is tedious to hand craft for each player and has often in the past been bugged. | ||
| - | The assigngear system makes use of faction configs. These configs can either be in a mission or included in the modpack. | + | Assign gear is the name of the feature that handles gear assignment. TMF does not support using arsenal loadouts for players as assign gear renders it inefficient and avoids its past bugs in doing so. |
| - | Every faction config contains a bunch of different roles (e.g. Squad Leader/ | + | |
| - | ==== Configuring | + | The assigngear system makes use of faction configs. These configs can either be in a mission or included in the modpack. Every faction config contains all roles within that faction (Eg. Rifleman, Fireteam Leader). Through the editor, you can then assign these roles to particular units. |
| - | Firstly in Eden on any soldier you use the assign gear component | + | |
| + | ==== Configuring unit role assignment | ||
| + | |||
| + | To use the assign gear component | ||
| {{: | {{: | ||
| ==== Switching faction configs ==== | ==== Switching faction configs ==== | ||
| - | To add more or tweak the factions available in a mission | + | |
| + | **Tip! We provide a variety of finished presets through our mod pack, all of which can be found retrieved as .hpp files [[https:// | ||
| + | |||
| + | To add to or tweak the factions available in a mission, open the file description.ext in the mission folder. There is a section called 'class CfgLoadouts' | ||
| {{: | {{: | ||
| - | Here you can create extra factions. You can also override the default ones. By default | + | Here you can create extra factions, or override the default ones. For the units in the template, |
| ==== Creating/ | ==== Creating/ | ||
| - | Firstly if you want to tweak assigngear the best thing to do is use a text editor | + | |
| + | Text editors | ||
| + | |||
| + | If you wish to create your own, copy an existing config | ||
| === Config 101 === | === Config 101 === | ||
| - | Every role is its own class e.g. 'class baseMan' | ||
| - | There are also array properties which take the format of: <code cpp> | + | Every role (rifleman/ |
| - | === Class Inheritance === | + | <code cpp> |
| - | 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 value. so '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: | + | class baseMan |
| - | <code cpp> | + | </ |
| - | 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. | + | |
| + | Every class has properties with the general pattern of: | ||
| - | The last thing you can do with inheritance is specific to array attributes you can use the ' | ||
| <code cpp> | <code cpp> | ||
| - | class g : { | + | PROPERTY = VALUE; |
| - | linkedItems[] = {"ItemWatch"," | + | </ |
| + | |||
| + | Each of these properties is responsible for different things. For example the ' | ||
| + | |||
| + | There are also array properties. Arrays are lists which take the format of: | ||
| + | |||
| + | <code cpp> | ||
| + | PROPERTY[] = {" | ||
| + | </ | ||
| + | |||
| + | For example: | ||
| + | |||
| + | <code cpp> | ||
| + | linkedItems[] = {"ItemMap"," | ||
| + | </ | ||
| + | |||
| + | Here we have an array property called linkedItems that consists of 3 elements | ||
| + | |||
| + | **Class Inheritance** | ||
| + | |||
| + | 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 { | ||
| + | displayName = " | ||
| }; | }; | ||
| - | class ftl : g { | ||
| - | linkedItems[] += {" | ||
| - | } | ||
| </ | </ | ||
| - | The linkedItems for ftl are now: "ItemWatch"," | + | |
| + | 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: | ||
| + | |||
| + | <code cpp> | ||
| + | class r : baseMan | ||
| + | { | ||
| + | displayName = "Rifleman"; | ||
| + | headgear[] = {" | ||
| + | vest[] = {" | ||
| + | primaryWeapon[] = {" | ||
| + | attachment[] = {" | ||
| + | magazines[] = | ||
| + | { | ||
| + | LIST_11(" | ||
| + | LIST_2("30Rnd_556x45_Stanag_Tracer_Red"), | ||
| + | LIST_2("HandGrenade"), | ||
| + | LIST_2("SmokeShell") | ||
| + | }; | ||
| + | items[] = | ||
| + | { | ||
| + | LIST_3(" | ||
| + | " | ||
| + | }; | ||
| + | }; | ||
| + | class g : r | ||
| + | { | ||
| + | displayName = " | ||
| + | primaryWeapon[] = {" | ||
| + | magazines[] += | ||
| + | { | ||
| + | LIST_8(" | ||
| + | LIST_4(" | ||
| + | }; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | As displayed above, the primary weapon assigned to the Grenadier class overrides the one inherited from the Rifleman. However, in the case of magazines, the ' | ||
| + | |||
| + | === Getting classnames === | ||
| + | |||
| + | The easiest way to get the classname of items/ | ||
| + | |||
| + | <code cpp> | ||
| + | comment | ||
| + | |||
| + | comment " | ||
| + | removeAllWeapons this; | ||
| + | removeAllItems this; | ||
| + | removeAllAssignedItems this; | ||
| + | removeUniform this; | ||
| + | removeVest this; | ||
| + | removeBackpack this; | ||
| + | removeHeadgear this; | ||
| + | removeGoggles this; | ||
| + | |||
| + | comment "Add containers"; | ||
| + | this forceAddUniform " | ||
| + | this addItemToUniform " | ||
| + | for " | ||
| + | this addItemToUniform " | ||
| + | for " | ||
| + | this addItemToUniform " | ||
| + | this addItemToUniform " | ||
| + | this addVest " | ||
| + | this addItemToVest " | ||
| + | this addHeadgear " | ||
| + | |||
| + | comment "Add weapons"; | ||
| + | this addWeapon " | ||
| + | |||
| + | comment "Add items"; | ||
| + | this linkItem " | ||
| + | this linkItem " | ||
| + | this linkItem " | ||
| + | </ | ||
| + | |||
| + | It's recommended to paste the Virtual Arsenal export into an empty text file besides the config; From there, you can find the classnames of the items you wish to use and paste them into the appropriate arrays in the faction config. | ||
| + | |||