GithubHelp home page GithubHelp logo

jp_api-changes's Introduction

JP_API for Shotgun King

A listener based API for use with Shotgun King: The Final Checkmate by PUNKCAKE Delicieux. This allows easier creation of mods, as well as adding a few nice to haves.

Go to the documentation!

Getting started

As a note, doing this will require knowledge in both lua and SGK's base functions

New Project

  1. Copy the template mod into your mod folder.
  2. Rename the folder to your mod's name.
  3. Start Using JP_API!

Existing Project

  1. Copy the code from api.lua and mod.lua into your mode's lua file, outside of any functions.
  2. If you have custom logic in get_weapons_list or initialize, combine that with the copies in the JP_API CODE.
  3. Add the line mod_setup() into your mode's start function.
  4. Start using JP_API!

Usage

In the folder modules in your mod (create it if it does not exist), create a file for your code. In that file, create a function named start(). In that function, write your code!

Updating

To update the API, simply replace the JP_API CODE section in your mode's code with the newest version at api.lua.

Example

Here is an example that simply logs each time a few event occurs

...
-- logging.lua
function start()
  add_listener("shot", function() 
    _log("PLAYER SHOT")
  end)

  add_listener("after_black", function() 
    _log("BLACK MOVE")
  end)

  add_listener("after_white", function() 
    _log("WHITE MOVE")
  end)
end
...

For some more complete examples, check out the example mods.

Check out the docs for a much more complete explaination!

If you have any questions, feel free to ask in the Discord, or message me directily (JP12#1148)

Have fun!

Special Thanks

  • PUNKCAKE Delicieux for making SGK
  • Glacies#5786 on discord for the fixes to the base game as well as various code for the API

jp_api-changes's People

Contributors

jpeterik12 avatar microbullet avatar dkienenb 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.