-
Notifications
You must be signed in to change notification settings - Fork 0
Home
XCOM Mod File Generator is a configuration file generator for mods for the popular PC game, XCOM 2. Currently, it generates XComContent.ini and XComGame.int files, primarily for squadmates and clothing/gear mods. This helps modders write and configure these files significantly faster.
Imagine your favorite video game character, say Super Mario, or even your favorite fictional character. Also imagine you love to play the game XCOM, so much so that you would like your favorite character to appear in XCOM. So you learn how to mod ("mod" is short for modification or modify, in this case, modify game files) XCOM so you can get your character in. You need configuration files for your mod so the game knows that your character's clothing and body parts should appear in-game and what you can do with those parts in-game. With this generator, you specify what parts you'd like (e.g. If your favorite character is Mario, select the Head part type if you want to only import his head), specify the other details from the rest of your mod, take the files generated, and include them in your project in the proper folders. Done! There is more to it, but this project simplifies writing configuration files by orders of magnitude and saves you a lot of time. I know because I've used it with my own mods (@cjrcodes).
Configuration files can be thought of being made up of strings (in the computer science/programming sense), so this project utilizes that in the process of writing files. XComContent files only contain a file header and body part template configs
+BodyPartTemplateConfig=(PartType="Head", DLCName="ChrisSquadmate",TemplateName="MATE_Head_M", ArchetypeName="UPK.Archetypes.ARC_Head_M", Gender=eGender_Male, bCanUseOnCivilian=false, bVeteran=false, Race=eRace_Caucasian)
All those details get filled in as strings from the form input provided by the user. In some cases, values are directly extracted from the form (think connecting HTML and JavaScript, document.getElementById()), stored into a variable, and put into the template string.
Generally, it starts with how many genders get selected (as all genders selected get a copy of all selected parts and selected armors). Max, 2 genders are selected. That is genders selected times the number of part types selected times the number of armor templates (if armor templates are selected, along with valid part types).
- resetArrays()
-
Reset all arrays that store all form results when generateFiles method is called
- showCheckboxes(docId)
-
Expands/collapses checkbox dropdowns
- selectCheckboxes(parentId, docId)
-
Select/deselect checkboxes, made for quick select checkboxes to check their grouped checkboxes
- selectAllCheckboxes(buttonId, docId)
-
Select/deselect all checkboxes for a given section (e.g. part types, armor templates section)
- defaultPTsCheck()
-
Enable default part types, special group made to select head, torso, arms, legs. Corresponds to the "Standard" quick select part type checkbox.
- setPartTypesSelected()
-
Get selected part types, store in partTypesEnabled array
- setArmorTemplatesSelected()
-
Get selected armor templates, store in armorsEnabled array
- setGendersSelected()
-
Set selected genders from the form, store in gendersEnabled array
- reportFormValues()
-
Reports form values to populate arrays (Part types, armor templates, genders selected arrays: any entry/group with the ability to have more than 1 value selected) to be used in the generateFiles method and final result. Bundles together part types, armor templates, and genders selected functions.
- hasArmorTemplate(part)
-
Determines if a part has an armor template. Generally, only major clothing items have armor templates (i.e. torso, arms, legs)
- getArmorAbbreviation(armorTemplate)
-
Get armor abbreviation of an enabled armor template. (e.g. "kevlarArmor" returns "KV")
- getArmorCharacterTemplate(armorTemplate)
-
Get armor character template of an enabled armor template. (e.g. "kevlarArmor" returns "Soldier")
- getTextAndSpecialProperties()
-
Gets all text properties and special properties on the form and stores them in their respective variable.
- printFormValues()
-
Print all form values in the console. Useful for debugging.
- getGenderTagAndLabel(gender)
-
Gets the gender tag (i.e. Male tag is "_M") and label (i.e. Male label is "Male") on the "eGender" passed Tag stored in index 0, label stored in index 1
- getArchetypeName(arcAppendType, partType, arcNameCustomName, genderTag)
-
Returns an Archetype Name string depending on the selected append type from the user
- generateFiles()
-
Generates files for the end user
Reset all arrays that store all form results when generateFiles method is called
Expands/collapses checkbox dropdowns
Kind: global function
Param | Type | Description |
---|---|---|
docId | string |
Document id of selected dropdown |
Select/deselect checkboxes, made for quick select checkboxes to check their grouped checkboxes
Kind: global function
Param | Type | Description |
---|---|---|
parentId | document.getElementById |
Document id of the quick select checkbox selected |
docId | document.getElementById |
Document id of the checkboxes to be checked |
Select/deselect all checkboxes for a given section (e.g. part types, armor templates section)
Kind: global function
Param | Type | Description |
---|---|---|
buttonId | string |
String passed as 'selectall' or 'deselectall' to determine which action to take |
docId | document.getElementById |
Document element section to select/deselect checkboxes |
Corresponds to the "Standard" quick select part type checkbox.torso, arms, legs.
Get selected part types, store in partTypesEnabled array
Get selected armor templates, store in armorsEnabled array
Set selected genders from the form, store in gendersEnabled array
Reports form values to populate arrays (Part types, armor templates, genders selected arrays: any entry/group with the ability to have more than 1 value selected) to be used in tBundles together part types, armor templates, and genders selected functions.
Determines if a part has an armor template. Generally, only major clothing items have armor templates (i.e. torso, arms, legs)
Kind: global function
Param | Type | Description |
---|---|---|
part | string |
Part to be checked |
(e.g. "kevlarArmor" returns "KV")led armor template.
Kind: global function
Param | Type | Description |
---|---|---|
armorTemplate | string |
Armor selected |
(e.g. "kevlarArmor" returns "Soldier")bled armor template.
Kind: global function
Param | Type | Description |
---|---|---|
armorTemplate | string |
Armor selected |
Gets all text properties and special properties on the form and stores them in their respective variable.
Print all form values in the console. Useful for debugging.
Tag stored in index 0, label stored in index 1d label (i.e. Male label is "Male") on the "eGender" passed
Kind: global function
Param | Type | Description |
---|---|---|
gender | string |
Gender to have tag and label returned on |
Returns an Archetype Name string depending on the selected append type from the user
Kind: global function
Param | Type | Description |
---|---|---|
arcAppendType | string |
Setting to determine how to structure the archetype name (i.e. "after" will put the custom name after the part type) |
partType | string |
Part type to be appended to string |
arcNameCustomName | string |
Custom name to be appended to string |
genderTag | string |
Gender tag to be appended to string (e.g. After for "Tint" will put that string after the part, "ARC_TorsoTint_M") |
Generates files for the end user
Kind: global function