Star Trek: Infinite

Star Trek: Infinite

Not enough ratings
Infinite Modding - New Ship Creation
By Muzual
This guide is to help guide mod makers in creating new ships with little compatibility issues
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide is intended to explain how you can add new ships to Star Trek Infinite without causing compatibility issues with other mod work!

Tools
Although not necessary, I highly suggest Notepad++ or some other text editor with a bit more to it than the built in Windows Notepad.

Why focus on compatibility?
It is important to focus on making your mod as compatible as possible as other people are making mods all of the time, and users might want to use more than one! By creating your mod in a careless approach you are actually reducing user choice, and are more likely to have complaints in your inbox when your mod doesn't work with whatever the other popular mods are!

This is a big area for ships, as the definition for vanilla ships takes place in only one file. Mods that overwrite this immediately come with compatibility concerns, but following this guide you shouldn't have any problems with anybody else!
Things You'll Need
This guide does not cover anything to do with 3d Modelling and assumes you already have an available ship model to use in the correct format for Star Trek Infinite.

You can also reuse the existing models in game if you prefer, and this guide will do this to show how you can create a brand new ship class using an existing model.


Creating the Mod
In order to create the mod and get started, run the Paradox Launcher and create one!

When the launcher opens, navigate to the All Installed Mods page, and at the top of the page you should see a button for Upload Mod.

Select the Upload Mod button to open a wizard, then you should get the option to Create a Mod.

The name of the mod is the name users will see on the Steam Workshop or Paradox Mods, the version is the game version it is made for, and the directory is the folder path you want to put the mod in.

Enter whatever you like for the name, for the version (as of writing) you can enter 1.0.2, and for the directory I usually use something like MzlMyModName. The appropriate folder will be created in C:/Users/YourUser/Documents/Paradox Interactive/Infinite/mod/.

You should also notice you have a .mod file with the same name in that path!
Mod Structure - Important!
Once you're inside your newly created mod folder, you should notice there is only a file called descriptor.mod - ignore it for now, it just holds metadata about the mod.

Every mod has to make sure the files it wants to add are in the right places, so if you're adding ship_sizes, you need to make sure they are in the common/ship_sizes/ directory inside your mod, mirroring the path of the game.

Most of these are just something you have to learn - but you can very easily navigate to your game installation and look at the folder structure there. The vast majority of mods that edit game things will use things in the /common/ folder

We're going to be using a few in the following section...


Ship Sizes
The first area we will start with is called ship sizes. This is the "type" of ship. It can be helpful to think of it in Stellaris terms, where the sizes are: Corvette, Destroyer, Cruiser, Battleship and Titan. In Infinite, however, these ships have been broken down further and specific sizes exist for each faction. This means Miranda, Excelsior, Dderidex, Galor and Vorcha are all separately defined (as well as all the others!) so it is best that we do the same.

Remember what was said above? We need to mirror the structure of the game!
The naming of everything going forward is very important, particularly folders, as the game will only include your mod work in matching folders.

ship_sizes exist in /common/, therefore...

Step One - Create a Folder called "common"
Inside your empty mod, create a folder called "common"
Once you've created "common", open the folder.

Step Two - Create a folder inside called "ship_sizes"
Next, you need a folder called "ship_sizes" with the exact correct name, or this won't work!
Once you've created it, open that folder.

Step Three - Create a text file inside with whatever name you choose
I've chosen "mzl_newshipsample_ship_sizes.txt" - but it really doesn't matter here, we are not overwriting vanilla content so alphabetical naming is not something to worry about (more on that later...)

Take a note of these steps, as creating the folder structure to match the game is critical for every mod you create, and each individual area of each mod!


Step Four - Open the new file! Preferably in Notepad++
So now we can create a ship size! It is recommended you copy a vanilla ship size for this and make changes, that way you can ensure your definition includes everything you need.

Remember that the mod structure mirrors the game, so you can find game ship definitions to copy in /YourSteamLibrary/steamapps/common/Infinite/common/ship_sizes/*

The main thing you want to make sure is that you've given your ship_size a name that is distinct from the others. Each definition is defined as
name = { // body }

In my example, I've copied the miranda definition, and given it a name lantree.
lantree = { formation_priority = @miranda_formation_priority max_speed = @miranda_speed acceleration = 0.35 ... ... }

Most values are straightforward and mean what they say - but if you need further clarity feel free to ask. I won't list them all because there are quite a few, but if you have copied a ship design you won't need to change any for this example!
Section Templates
The second area we will start with is called section templates. If you have played Stellaris, this is the 'blueprints' mechanic in the ship designer where you can decide if you want to build your Corvette as an Interceptor, a Picket Ship, or something else entirely...
This mechanic was removed in Infinite, but the game is still built around it, so we need to create one! All ships in Infinite only have [one] section template available. You can create more, but there is no way to select them in the designer as of 1.0.2.

Do you remember? We need to mirror the structure of the game!
I won't mention it again, I promise!

section_templates also exist in /common/, therefore...

Navigate back to your /common/ folder inside of your mod.

Step One - Create a folder inside called "section_templates"
Once you've created it, open that folder.

Step Two - Create a text file inside with whatever name you choose
I've chosen "mzl_newshipsample_section_templates.txt" - but again. It doesn't matter, we are not overwriting vanilla content.

Step Three - Open the new file
So now we can create a section template. As with before, it is recommended you copy a vanilla section template for this and make changes, that way you can ensure your definition includes everything you need. I've copied the MIRANDA_MID template, but you can copy one of your choice.

As with ship sizes, the main thing you want to make sure is that you've given your section_template a name that is distinct from the others.

In my example, I've copied the MIRANDA_MID definition, and given it a name LANTREE_MID.
ship_section_template = { key = "LANTREE_MID" ship_size = lantree fits_on_slot = mid ...... }

What's even in this file?
The section_template contains the definition of what slots are available for the ship. As you are looking at the template you have copied, you can see definitions such as
component_slot = { name = "SMALL_GUN_01" template = "invisible_small_turret" locatorname = "small_gun_01" }
What these do is define the component slots available for the ship - the example given above says that the slot SMALL_GUN_01 is available for our new ship and the location on the model (locatorname) for it is "small_gun_01". The template is an invisible weapon that all weapons in Infinite use, and is highly recommended that you make sure you use the appropriate invisible turret for the size no matter what weapon you intend on adding.

Towards the end of the file there is also a count of how many utility slots and auxiliary slots are available for you to choose. These are just a simple number..
Component Templates
The third area is called component templates. This is the definition of components themselves. Weapons are here, shields are here, but what we are interested in is the impulse engines, warp core and role (computers) of our new ship.

When we defined the ship_size, there is a section inside the ship_size definition where there are four to five listed required components - These refer to components that the ship must have in order to be built - the power core, warp engines, impulse engines, sensors and "role" respectively.

Unfortunately in base Infinite, many of these components have ship restrictions, to prevent Mirandas gaining the extra power benefits of a Galaxy class warp core. While this makes sense, it makes it a little tricky to add new ships!

One option would be to overwrite the base game files to allow our new Lantree class to make use of the existing components, but if we do this we will never be compatible with any mod that needs to do the same thing

Fear not! There is a solution...
It is highly recommended that we instead create new components in these slots, specifically for our Lantree class to use, with specific keys that mean it will never conflict with any other mod! So, without further adieu..

component_templates exist in /common/, therefore...

Navigate back to your /common/ folder inside of your mod.

Step One - Create a folder inside called "component_templates"
Once you've created it, open that folder.

Step Two - Create a text file inside with whatever name you choose
I've chosen "mzl_newshipsample_component_templates.txt" - but yet again. It doesn't matter, we are not overwriting vanilla content.

Step Three - Open the new file
So now we can create our new components.. we need to create a lot of these if you want it to feel like a base game ship, so this section will probably take the longest time to do.

In a nutshell, what we want to do in our example is copy all of the thrusters, reactors and roles components that are available the Miranda class, change the name of the components to something unique and then make these components restricted to our Lantree class.

You do not need to do Sensors or FTL Warp Cores, as these are not class-restricted

utility_component_template = { key = "CORVETTE_IMPULSE_ENGINE_LANTREE" component_set = "thruster_components" size_restriction = { lantree } upgrades_to = "CORVETTE_ADVANCED_IMPULSE_ENGINE_LANTREE" }

The example above has been condensed heavily to show only the critical parts you must change. The Key is a new unique key specific to our mod, the component_set is a base game set that the Lantree ship_size requires, the size_restriction is, you guessed it, our new ship; and finally: the upgrades_to refers to the next thruster component I've defined - which is another unique component for the Lantree defined in the same way.

In total you will likely make around 12 components here, five engines, five reactors and 2 to 3 roles is common.
The GFX Folder
And with everything above done, our work in /common/ is complete! All that is left is the visual side of our new ship - the information we've created so far is enough to get the game to generate a ship for you.



After navigating back to the root of your mod, you can create a new folder to sit alongside /common/ called /gfx/. Inside this folder, you should have a folder path as follows:
/gfx/models/ships/

In the base game, this folder contains the asset and mesh files necessary to show models of ships, stations and other 3d objects. If you are using a Federation example, you should further navigate to the folder /ufop_1/. The base game stores all of the assets in a single file per faction but you don't need to do this.

Inside your mod's folder, create a .asset file for your ship. Mine is called "lantree_ship_entities.asset"

Again I would suggest copying a base game definition for this, particularly if you are wanting to use an existing model. In this example, we are using the Miranda class.

entity = { name = "lantree_slots_entity" pdxmesh = "miranda_slots_mesh" } entity = { name = "lantree_entity" pdxmesh = "ufop_01_miranda_ship_mesh" .... .... }
The first of the two definitions you must write yourself, but feel free to copy the exact one shown above. It is no more complex than the two lines, and refers to a slots_entity which contains location informaton on the model separate from the visual mesh.

The latter is copied from "miranda_entity" and renaming it to "lantree_entity" - and that is all we need to do. No definition change is required for a basic mod.

The "lantree_slots_entity" should be familiar - this should be the key used in your ship_sizes definition (under the appropriately named "entity" field) - if it isn't, go back and fix that now. Point it at your slots entity and your work is done!
Localisation
Localisation files contain the user-friendly text for your mod!

The Stellaris wiki is a brilliant resource for Localisation modding and is roughly the same in Infinite. [stellaris.paradoxwikis.com]

Create a folder alongside /common/ and /gfx/ called /localisation/ and inside of it create a .yml file with the name structure as: myname_l_english.yml (where l_english is replaced with your language)
This is critically important

The file must be encoded in UTF-8-BOM

An example of the content is given below - note that the file must start with l_english: and each line following must have a space or a tab in front of it!
l_english: COMBAT_COMPUTER_HRB_ESCORT_DEFAULT_LANTREE: "$COMBAT_COMPUTER_HRB_DEFAULT$ (Escort)" lantree: "Lantree" LANTREE_MID: "Lantree" .....

Caveats
The only drawback with this method and the structure of the game as it stands is that ship names are defined on a per-class basis. If you would like to add unique namelists to your ships, you have to make your mod incompatible with others - all this means is that your ships will all spawn with the class name.

For example, following my steps, the first Lantree class I build will be the USS Lantree, and the second will be the USS Lantree I, Lantree II, Lantree III and so on.

This is not something you can fix without making your mod incompatible with others, as the base game lacks a generic namelist to pull from.

However, I have provided a solution for this in my Extended Namelists mod!

If any of your users are using this mod, they will pull ship names from the same pool as other Starfleet ships and this issue will not occur. Feel free to point your users at this mod.
Closing Notes
Thanks for reading!

Hopefully you have a nice new ship to play with, and you can customise the stats to your heart's content.

This is the first guide I've ever created for mods so hopefully it was OK to follow, but please let me know if you think improvements could be made for greater clarity.

Don't forget you can scour the game files to find working examples, and Stellaris resources are a brilliant place to look for comparable work!

Leave a comment!