Traincraft Packs

Making a stock pack

Your own trains in Traincraft: Reforged Locomotion, built and hosted here.

You write a pack the way Traincraft add-ons have always been written (Java model files, a stock list, textures) and upload it as a zip. This site turns it into a pack, renders pictures of every train, and gives it to the servers that use it. You don't need to compile anything or install a mod development setup.

Start from the example

A small, complete pack: a diesel shunter in two liveries and a flat wagon. Download it, look at how it fits together, then replace the trains with your own.

Download the example pack source (zip, about 55 KB)

Follow the Traincraft content guidelines

Model your trains the way the Traincraft team recommends: Content Creation Guidelines. The parts that matter most here:

Your pack, your rules: the guidelines are experienced advice. Packs that follow them and are checked by the site's admins can be featured, which lists them first here and in the game.

Exporting your model

Before you export

Export

The exported file

For this site you can upload the export as it comes out. The site reads the bodyModel[...] = new ModelRendererTurbo(...) lines, addBox / addShapeBox, setRotationPoint, translateAll and flipAll as text and never compiles your files, so the Flan's Mod package and imports the exporters write don't matter. Compare with ModelExampleShunter.java in the example.

Only if you also build your add-on as a 1.7.10 mod: change the file's package line to your own package, import fexcraft.tmt.slim.ModelConverter and fexcraft.tmt.slim.ModelRendererTurbo instead of the Flan's Mod classes, and make the class extends ModelConverter, as the guidelines describe (SMP Toolbox also leaves part names empty for you to fill in).

If it looks wrong

What's in a pack

src/main/java/com/example/traincraftaddon/
  common/library/ExampleEnumTrains.java        the stock list
  common/library/ExampleItemIDs.java           spawner items and their icons
  common/library/ExampleEnumSounds.java        horn and engine sounds (optional)
  client/render/ExampleRenderEnum.java         which model and texture each train uses
  client/render/models/Model*.java             your exported models
  common/entity/rollingStock/ExampleEntity*.java   name, seat and coupling distance
src/main/resources/assets/exampletrains/
  textures/trains/ExampleShunter_Green.png     one texture per livery: <prefix><livery>.png
  textures/items/trains/example_shunter.png    16x16 inventory icon

Rename freely: the site finds the files by the endings EnumTrains, RenderEnum, ItemIDs and EnumSounds, and the textures in whichever assets/<name>/ folder has a textures/trains/ folder.

Adding a train, step by step

  1. Model it and export it with one of the exports above into client/render/models/. Use the texture size you modelled with; the export writes it at the top (textureX, textureY).
  2. Paint a texture per livery and save each as textures/trains/<prefix><livery>.png, for example ExampleShunter_Green.png and ExampleShunter_Red.png.
  3. Add it to the stock list (EnumTrains). A locomotive:
    LOCO_SHUNTER("locoExampleShunter", "Example Shunter", ExampleEntityLocoShunter.class,
        ExampleItemIDs.minecartExampleShunter.item, "diesel",
        450, 50, 1.2,          // power (MHP), top speed (km/h), mass
        10, 0, 40,             // fuel use, water use, heating time
        0.7, 0.9, 4000,        // acceleration, brake, tank capacity
        new String[]{"Green", "Red"}, 18, -1.5, "Example pack"),   // liveries, GUI scale, bogie position, tooltip
    Anything else (wagons, coaches, tenders):
    FREIGHT_FLAT_WAGON("freightExampleFlatWagon", "Example Flat Wagon", ExampleEntityFlatWagon.class,
        ExampleItemIDs.minecartExampleFlatWagon.item, "freight",
        0.8, new String[]{"Brown"}, 18, 18, "Example pack"),   // mass, liveries, GUI scale, cargo slots, tooltip
    Types: diesel, electric, steam, hydrogen for locomotives; freight, passenger, tender, tank, flat and so on for the rest.
  4. Say how it's drawn (RenderEnum):
    locoExampleShunter(ExampleEntityLocoShunter.class, new ModelExampleShunter(), "ExampleShunter_", true,
        new float[]{0F, 0.2F, 0F},       // offset in blocks: 0.2 puts wheels ending at y 10 on the rail
        new float[]{0F, 180F, 180F},     // turns an exported model the right way up
        null, "", 0, null, "", null, 0, false),
    Steam and diesel engines can add smoke: a type ("smoke"), a count and positions in place of "", 0, null.
  5. Give it a spawner item (ItemIDs): minecartExampleShunter("ItemRollingStock", "example_shunter", 3) and a 16x16 icon textures/items/trains/example_shunter.png.
  6. Write its class (common/entity/rollingStock/). The site reads three things from it: the name (getInventoryName), the distance to coupled stock (getOptimalDistance) and, for anything you can ride, the seat: TraincraftUtil.updateRider(this, -1.1, 0.2) (distance along the train in blocks, height).
  7. Sounds (optional, EnumSounds): Traincraft's own sounds by name, such as "chme3_horn", or your own in assets/<name>/sounds/ with a sounds.json.

Putting it on the site

  1. Sign up or log in, then create a pack. The namespace is your pack's permanent id (lower case, e.g. mytrains). Choose Open or Protected.
  2. Zip your pack folder and, on the pack's page, choose Upload a version: what you upload is source, enter a version (e.g. 1.0.0) and set Stock to include to all.
  3. The site builds it and renders a picture of every train. Check the build log on the version page: skipped trains say why (no RenderEnum line, model not found, no texture), and no icon lists trains without an inventory icon.
  4. Fixed something? Upload again with a new version number. Servers on "Latest" get it at their next start.

Uploading means you accept the upload rules: share only what you made or may share.

Good to know