sk-zk / TruckLib

create & modify ETS2 / ATS maps
https://sk-zk.github.io/trucklib/master/
GNU General Public License v2.0
19 stars 7 forks source link
american-truck-simulator ets2 euro-truck-simulator-2

TruckLib

TruckLib is a C# library for the map format of Euro Truck Simulator 2 / American Truck Simulator. The primary focus is programmatic map creation, but the library also handles various other tasks needed for this purpose, such as reading prefab descriptor files.

The currently supported map format version is 900 (game version 1.48.5–1.50).

(This project is pretty much a perpetual alpha, so you'll probably run into a few issues sooner or later, and breaking changes will happen on occasion.)

Namespaces

TruckLib.ScsMap:
The main namespace of the library: classes for working with the map format.

TruckLib.Sii:
Parsers for .sii and .mat files.

TruckLib.Models:
Rudimentary support for binary model files (.pm*), prefab descriptors (.ppd), and binary .tobj files.

TruckLib.HashFs:
A reader for HashFS (.scs) files, the asset archive format of the game.

Minimal example

using System.Numerics;
using TruckLib.ScsMap;

var map = new Map("example");
Model.Add(map, new Vector3(10, 0, 10), "dlc_no_471", "brick", "default");
map.Save(@"<ETS2 folder>\mod\user_map\map");

Documentation

Documentation is available at https://sk-zk.github.io/trucklib/master/.

Known issues and limitations

License

TruckLib is licensed under GPL v2 except for CityHash.cs.

Credits

Parts of TruckLib are based on ConverterPIX and SCS Blender Tools.