Giter Site home page Giter Site logo

austintraver / input-macros-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from techycoder81/input-macros-api

0.0 0.0 0.0 12 KB

The api for interacting with `libinput_macros.nro`, along with the releases of the plugin.

License: MIT License

Rust 100.00%

input-macros-api's Introduction

Input Macros Plugin and API

This plugin and related API implements a mechanism of assigning a complex series of button inputs and stick positions to a specific macro button, such as left or right dpad. When triggered, a defined macro will override all inputs for the specified series of frames.

Online Disclaimer

This plugin will not function in any online matches.

Plugin Usage

Simply place a populated macros.json file at the root of your SD card (the specific name macros.json is important), along with libinput_macros.nro in the skyline plugins directory. If reload is enabled, feel free to reload the json file at runtime with the plus (+) button.

API Usage

Currently, this crate only exposes the macro structure definitions, so that other applications can parse the recorded macros and/or write their own. Over time various exposed functions will be added to control macro playback/recording, for novel uses like TAS and recording/playback. (Training Modpack, is that you?)

Examples

The ewgf.json file in the /examples/ folder is an example of macroing EWGF on DpadLeft and DpadRight.

See here for example files.

JSON spec

The spec for allowed json values is as follows:

Top Level Config

"enabled": true/false

  • this will enable or disable the macro plugin. If no file is present, macros are disabled by default.

"reload": true/false

  • When enabled, this allows you to reload the json file on-demand when the start button is pressed, while still in a match.

"macros": []

  • this is a json list of macro definitions

Macro Definitions

"name": "my macro name"

  • this field lets you name the macro, just for convenience. It is otherwise unused.

"trigger": {}

  • this field is the trigger info for the macro.

"steps": []

  • this is a json list of macro steps

Trigger Definitions

"action": "DpadRight"

  • this is the input action that will trigger the macro. Currently, only the following buttons are allowed:
    • "DpadRight"
    • "DpadLeft"
    • "DpadUp"
    • "DpadDown"
    • "LeftStick"
    • "RightStick"
    • "ButtonA"
    • "ButtonB"
    • "ButtonX"
    • "ButtonY"
    • "ButtonZL"
    • "ButtonZR"
    • "ButtonR"
    • "ButtonL"

"kind": "Holding"

  • this optional field represents what kind of input will trigger this macro. Options are:
    • "Holding" : If the input is currently being held, the macro will trigger (this is the default)
    • "JustPressed" : If the input was just pressed this frame, the macro will trigger
    • "JustReleased" : If the input was just released this frame (negative edge), the macro will trigger

Step Definitions

"hold_frames": 3

  • this optional field (defaults to 1) represents the number of frames a step will be held

"sticks: {}

  • this optional field represents the Sticks positions to override for this frame. If not present, the stick positions will not be modified, and the player's real stick positions will be used.

"buttons": ["Attack", "Special"]

  • this is a json list of Button names to output on this frame. The allowed values are as follows
    • Attack
    • Special
    • Jump
    • Guard
    • Catch
    • Smash
    • JumpMini
    • CStickOn
    • StockShare
    • AttackRaw
    • AppealHi
    • SpecialRaw
    • AppealLw
    • AppealSL
    • AppealSR
    • FlickJump
    • GuardHold
    • SpecialRaw2
    • SpecialAll
    • AttackAll
    • AppealAll

Sticks Definitions

"lstick_x": 0

  • this is the left stick X position to output on this frame (-128 to 127). This value is flipped if "auto_flip_x" is true.

"lstick_y": 0

  • this is the left stick Y position to output on this frame (-128 to 127)

"rstick_x": 0

  • this is the right stick X position to output on this frame (-128 to 127). This value is flipped if "auto_flip_x" is true.

"rstick_y": 0

  • this is the right stick Y position to output on this frame (-128 to 127)

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.