GithubHelp home page GithubHelp logo

sk-zk / trucklib Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 7.0 13.2 MB

create & modify ETS2 / ATS maps

Home Page: https://sk-zk.github.io/trucklib/master/

License: GNU General Public License v2.0

C# 99.51% JavaScript 0.08% CSS 0.41%
ets2 euro-truck-simulator-2 american-truck-simulator

trucklib's Introduction

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

  • The library does not calculate the bounding boxes of items, so you'll need to recalculate on load (Map > Recompute map).
  • Anything to do with prefabs may or may not break in unexpected ways.
  • The prefab object creator doesn't handle terrain points yet. Unless you need prefab terrain, this is also fixed by recalculating.
  • When adding a camera path, the positions of the control points in the Keyframe objects are not set to any default values and therefore left at (0, 0, 0).
  • Helper locators of curve items, if used by the model, are not placed automatically by the library because their coordinates are not known to it. Moving a locator node or a curve node which is tethered to a locator node will also cause issues. The editor will fix both of these once a curve node is moved or the properties dialog of the curve is closed.
  • External map data (which is how the Winter Wonderland map was included in the game) is not yet supported.

License

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

Credits

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

trucklib's People

Contributors

sk-zk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

trucklib's Issues

Road.Append() InvalidOperationException

Hi

i tried to read a table with given waypoints and append the new point to the road in a loop,
but like you said if an item is attached it throws a exception.

Another try was to create new Roads and add it them the map in a loop, the roads segments are straight and does not link together.

Any suggestion on doing this with undefined number of points? Rather than hardcode and append the points behind each other.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.