Code Monkey home page Code Monkey logo

gbstoolkit's Introduction

GBS Toolkit

Python tools for messing around with GB Studio projects.

GBS Toolkit is a tool I've built while working on Soul and Silicon, a queer/trans dating simulator I'm writing for the GameBoy Color. It's a very text-heavy game, and while GB Studio has a dialogue review section, it can't always easily handle lots of branching dialogue, and there's no way for it to add new dialogue.

GBS Toolkit allows you to export the entirety of a GB Studio project into a collection of files written in kdl. These files define the properties and scripts for every scene, actor, trigger, asset, and more in the game, and can be reimported into a GB Studio .gbsproj file once you're done editing them. No data should be lost between importing and exporting, so you can edit freely without worrying about having to reimplement things.

The GBS Toolkit project is also set up so that other Python projects can use it as a library for interacting with GB Studio project files.

Requirements

  • Tested with GB Studio v2.0 beta 5. Other versions may not work properly.
  • Python 3.6 or higher.
  • kdl-py 1.0.0 or higher.

Installation and Usage

GBS Toolkit can be used either through the command line or a GUI. There are executable bundles for MacOS, Windows, and Linux available in Releases. Otherwise, GBS Toolkit can be installed from PyPI:

pip install gbstoolkit

In order to run the GBS Toolkit GUI from the command line:

gbstoolkit gui

In order to convert a project from a .gbsproj file to kdl:

gbstoolkit format <gbsproj file> <kdl directory>

In order to convert a project from kdl to a .gbsproj file:

gbstoolkit parse <kdl directory> <gbsproj file>

Running a bundled executable will launch the GUI immediately.

Future Plans

Currently, there is no support for custom plugins or engines. Support is planned for future versions, but I'm still figuring out how to write a plugin system that doesn't allow for arbitrary code execution.

GBS Toolkit will be updated to support GB Studio v3 once it exits alpha and is recommended for games to use.

Licensing and Contribution

Contributions are more than welcome, and GBS Toolkit is publicly available under FAFOL 0.2. You can use, modify, and even redistribute it however you want, as long as you're not being exploitative with it. Thank you for giving GBS Toolkit a look!

gbstoolkit's People

Contributors

lemmaeof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gbstoolkit's Issues

Non-Alphanumeric Scene Names Not Supported

It looks like the tool assumes all scene names will be valid folder/directory names on the host OS.
Specifically, on Windows 10 and Python 3.7 on my Yurivania 1 project, I get the following errors:
NotADirectoryError: [WinError 267]

A number of my Scene Names are not valid Windows directory names.

I haven't used python in a while, but I will try to fix this if I have time later today.

Thanks for making this cool tool! ๐Ÿ˜„

__comment not respected

Currently, the universal __comment argument in events is not preserved either way when converting projects. FIXME before release!

Implementing the GB Studio commands!

There are tons of events in GB Studio that need to be reimplemented for GBS Toolkit in order for it to convert projects correctly. There are about a hundred, and here are the ones we still need implemented in the V2 beta:

  • All control flow events
  • All input events
  • All sound & music events
  • All overlay events
  • All scene events
  • All text events, except for EVENT_TEXT
  • All timer events
  • All variable events

I'll write out a full specific list later, but this is a general guideline for folks who want to contribute. Be sure to follow the format for events, and contact me if you have any questions!

Switch syntax

switch [var] {
    case [number value] { //true0
        <list of events>
    }
    case [number value] __collapse=true { //true1
        <list of events>
    }
    default { //false
        <list of events>
    }
}

Gonna take some weird messing around with Nodes but it should work just fine, we can assume choices and fill in the default values for unused ones (though this might break expectations? TODO: figure out)

Testing

Currently there aren't any unit tests for GBS Toolkit. To implement these I need a project that uses every event and option in GB Studio at least once, as well as something to check order-agnostic JSON contents diffs. This is necessary before release so I don't put out something broken!

Roadmap: GB Studio plugin support (custom events and engines)

Right now, everything in GBS Toolkit is assuming a standard install with no plugins or changes to the engine. If possible, there should be a way to support third-party plugins and engine fields without the plugin/engine devs having to write Python bridge code. Fallback can theoretically work for most custom events, but I don't have anything for something that provides different engine fields. slimit might work for grabbing fields out of custom events automatically, but that feels excessive for what is effectively grabbing a (hopefully!!!) static export. The only real issue with engine fields is that GBS Toolkit converts the names into a more readable format based on purely my own personal preference. I'll need to look at custom engines to see if there's anything I should keep in mind for a more dynamic system.

This may also require specifying a location to load plugins from on the GBSToolkit side.

More readable errors for malformed data

I should figure out a good way to transfer line info through to the parser, if there is one. Right now, if someone malforms data in a kdl file, GBS Toolkit can't really detect it and will just throw a KeyError if it tries to access something wrong or make a bad .gbsproj file if it slurps up the wrong data. Validation is important!!!

Not compatible with MacOS dark mode

This might be a tkinter issue - I just use the default ttk theme and it might be having trouble with how to draw the dark theme right. It's got the dark-mode text (which is white) but the light mode interface (which is also white). TODO: how do I fix this?

Song timestamps format with the wrong name

The timestamp entry in music.kdl song entries is accidentally spelled timesamp instead. This does not cause any crashes or errors, and may be irrelevant anyway due to how timestamp numbers are used in GB Studio, but it should be noted.

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.