Code Monkey home page Code Monkey logo

ttsmodmanager's Introduction

This golang library is intended to be able to convert source-controllable config and luascript into a functioning json file that can be loaded into TTS as a workshop mod.

Main Features

  • Handles Lua bundling!
  • Handles XML bundling!
  • Automatically builds on any incoming PR

Getting the binary

The binary is built by slsa-framework/slsa-github-generator and can be found attached to the latest release, for example: https://github.com/argonui/TTSModManager/releases/tag/v0.2.4/TTSModManager.exe for windows. In the examples i'll refer to the exe, but you can use the TTSModManager-Liunux with the same expected behavior.

Use automation in your repo

See https://github.com/argonui/TTSModManager.action for automated building of the mod on every PR / release.

Example Usage

Generate json from a directory

$moddir = directory to read from

TTSModManager.exe --moddir="C:\Users\USER\Documents\Projects\MyProject"

The finished json file is found in $moddir/output.json by default. if you'd like to specify the output file you can use the modfile argument.

Generate a directory from existing json file

$moddir = directory to write to $modfile = existing tts mod file to read from

TTSModManager.exe --reverse --moddir="C:\Users\USER\Documents\Projects\MyProject" --modfile="C:\Users\USER\Documents\My Games\Tabletop Simulator\Mods\Workshop\existingMod.json"

If you'd like the bundled lua requirements to be written to the src/ folder, pass --writesrc.

Testing a TTS mod conversion

reverse existing modfile into directory

$ttsmodfile = existing tts mod file to read from

$moddir = directory to write to

TTSModManager.exe --reverse --moddir="C:\Users\USER\Documents\Projects\MyProject" --modfile="C:\Users\USER\Documents\My Games\Tabletop Simulator\Mods\Workshop\existingMod.json"

generate a modfile based on directory

$moddir = directory to read from

TTSModManager.exe --moddir="C:\Users\USER\Documents\Projects\MyProject"

Working with downloadable content

TTS allows you to download content into a active game. This content must be a json file in the form of a single object. In order to accomodate storing these downloadable json files, TTSModManager can assemble and reverse these files.

Generating a downloadable file

In this example foo.json the root of a partial mod object you'd like to represent as a downloadable json.

TTSModManager.exe --moddir="C:\Users\USER\Documents\Projects\MyProject"
--objin="C:\Users\USER\Documents\Projects\MyProject\downloadable\content\foo.json"
--objout="C:\Users\USER\Documents\Projects\MyProject\to_be_downloaded.json"

Reversing a downloadable file

This process assumes you already have your file you are used to downloading, and want to decompose it into sub-objects and luascript etc.

Please note that objout is a directory and the trailing slash is needed.

TTSModManager.exe --moddir="C:\Users\USER\Documents\Projects\MyProject"
--reverse
--objin="C:\Users\USER\Documents\Projects\MyProject\ready_to_download.json"
--objout="C:\Users\USER\Documents\Projects\MyProject\downloadable\content\"

Running a local copy

If you are developing a feature and would like to run the tool, use this instead of TTSModManager.exe

go run main.go --moddir="..."

ttsmodmanager's People

Contributors

argonui avatar chr1z93 avatar buhallin avatar entrox-licher avatar

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.