Skip to content

ethanl21/psvmgd

Repository files navigation

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 := "test_battle"
ShowdownService.create_battle(battle_id)

# 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:

  • Meson
  • C++ Compiler with at least C++17 support (any recent compiler)
  • 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

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!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors