Coder Social home page Coder Social logo

py4spire's Introduction

Py4Spire

Support for Jython mods in Slay the Spire

Examples and Tutorials

Not many of these yet, will work on some more when I get the chance. Look at /pymods for an example mod structure

pymods folder structure

A mod in the pymods folder consits of the following: a .json file of the following structure:

{
    "name": "name of your mod",
    "folder": "the folder of your mod (inside pymods)",
    "components": [
        {
            "type": "component type, e.g. relic or card",
            "file": "the file import path for this component, relative to this mods folder, e.g. example_relic or relics.fire_hand",
            "name": "the name of the class for this component, within that file, e.g. ExampleRelic or FireHand"
        },
        ...
    ]
}

Compiling

I'll get round to uploading a compiled jar to the repo soon, it should be compatibly with any normal java mod launcher, and most mods since it's very unintrusive.

If you want to try and compile it yourself, it has jython as a dependancy

How does it work

When loading the game it looks through the /pymods folder for .json files, reads them, loads the components defined in them, and registers them to the game's internal libraries. It uses Jython to load the python classes in the java.

Jython does a lot of caching of files to speed things up, so the first time you run with Py4Spire it'll take quite a while to load, but after the first time you shouldn't see any difference in load speeds, it's lightning fast!

py4spire's People

Contributors

billy-yoyo avatar

Watchers

 avatar  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.