ethanl21 / psvmgd

psvm, for Godot 4!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Build

psvmgd

psvmgd is a Godot 4 GDExtension addon that uses smogon's Pokémon Showdown Simulator provided by psvm.

Usage

Install the addon from the Godot Asset Library (todo submit and document here). Enable the plugin and reload your project, then interact with the simulator via the ShowdownService autoload scene. For example:

func on_sim_output(message: String):
    print(message)

# Create a new battle
var battle_id := ShowdownService.create_battle()

# Register an output callback function
ShowdownService.register_callback(battle_id, on_sim_output)

# Write input to the simulator
var sim_input = [ "..." ]
for line in sim_input:
    ShowdownService.write_message(battle_id, line)

Build

To build psvmgd, you will need the following:

  • CMake v3.22+
  • C++ Compiler with at least C++17 support (any recent compiler)
    • For Windows builds, use MinGW to cross-compile on a Linux host.
  • Node.js, (build-time dependency, not required at runtime)
git clone https://github.com/ethanl21/psvmgd.git
cd psvmgd
meson setup builddir --buildtype debug # or release
meson compile -C builddir

For Windows

git clone https://github.com/ethanl21/psvmgd.git
cd psvmgd
meson setup --cross-file cross/x86_64-w64-mingw32.txt builddir --buildtype debug # or release
meson compile -C builddir

Package Addon

  1. Compile the project with Meson (see above)
  2. Copy the psvmgd.gdextension file from the output of the previous step toaddons/psvmgd.
  3. Copy the shared library files to the corresponding directories in addons/psvmgd/bin

To use the demo project, copy the addon/psmvgd folder to demo/addons.

Attribution

psvmgd is distributed under the MIT license.

psvmgd uses the following open-source libraries:

About

psvm, for Godot 4!

License:MIT License


Languages

Language:C++ 55.6%Language:Meson 32.1%Language:GDScript 7.8%Language:Python 4.6%