Skip to content

Instantly share code, notes, and snippets.

@MattMcFarland
Last active December 30, 2018 16:17
Show Gist options
  • Save MattMcFarland/1282329f83f88f1b98520c5e2ec491a2 to your computer and use it in GitHub Desktop.
Save MattMcFarland/1282329f83f88f1b98520c5e2ec491a2 to your computer and use it in GitHub Desktop.

Adding a new ware

Please consider every mentioning of {WARE_ID} to be replaced of what ware we want to add, and it must be lowercase to ensure compatibility across systems. Generally, we will be prefixing every ware we add with something unqiue to avoid any collision issues with other mods. This is mentioned as {PREFIX}

UPDATE: you can simplify this process by automating majority of the work using this tool.

Create new assets

To add a ware and the production of the ware to the game, the following files need to be created from scratch:

File Path Description
assets/fx/gui/textures/{PREFIX}_{WARE_ID}_macro.dds A 256x256x 2D image encoded as a dds texture that is presented to the user in the Station Build interface.
assets/structures/production/macros/{PREFIX}_{WARE_ID}_macro.xml Contains some of information about the station production module of this ware. specifically the hull strength, maximum workforce, explosive radius when destroyed, and what ware it creates. It does NOT contain more information about the ware itself, such as production costs.
assets/wares/macros/{PREFIX}_{WARE_ID}_macro.xml Contains very limited information about the ware itself, seems to be boilerplate code. but it has to exist. You can copy and paste all the code from an existing wares macro into this one, changing only its name

Include the new assets

The following files need to be modified to "wire up" your ware to the game. If these are not modified, the game will not even load your new assets.

NOTE: Any mention of path in these files must include extensions/XCG/ prefixed before the rest of the path.

File Path Description
index/macros.xml A manifest of all macros that do not normally exist in the game (new additions). For every ware and every production module you add, you must put them in here or the game will NOT load them.
index/components.xml OPTIONAL: If you are creating your own models for the macros to use, we currently are not doing this.
libraries/icons.xml This tells the game to load your texture for station production module> interface. You will need to point it to the texture file you add in fx/gui/textures/

Update existing files

These files are relatively easy to operate on, simply add your new entry to each of them, following the same pattern you copy from a previous existing one.

File Path Description
libraries/baskets.xml An xml patch file that specifies what categories this ware belongs. It isnt certain how this is used by the game exactly, but we suspect it is used by the AI. Recommend you put your wares in here as well.
libraries/modulegroups.xml Exact game usage of this is unknown. Seems to be mostly boilerplate about the station module that produces the ware, you can mostly copy paste what you see in our existing list, changing just the fields about the name and id, description, etc.
libraries/modules.xml Exact game usage of this is unknown. Seems to be mostly boilerplate about the station module that produces the ware, you can mostly copy paste what you see in our existing list, changing just the fields about the name and id, description, etc.
libraries/wares.xml Contains majority of the metadata about the ware, it also includes the entry for the blueprint that is required to unlock the ware.

See it in action

You can see examples of all of these files found at our XCG mod here: https://github.com/marcopennekamp/xcg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment