Giter Club home page Giter Club logo

pankuconsole's Introduction

Panku Console

Godot 4 Plugin. Provide a runtime console so your can just run any script expression in your game!

z1GFnH.png

✨Features

✅ Resizable conosle with edge snapping.

✅ No need to define complex commands, extremely easy to run code in your game.

✅ Nice-looking blur effect (Not sure if this is a point).

✅ Provide a notification panel that may help.

📦Installation

  1. Clone or download a copy of this repository.
  2. Copy the contents of addons/panku_console into your res://addons/panku_console directory.
  3. Enable PankuConsole in your project plugins.

For more detailed information, please visit Installing plugins

🤔How does it work?

  1. Enable this plugin, it will add an autoload singleton which named Panku in your project.

  2. Run any scene, press ~ key, and the console window will pop up. (The key can be changed in the script)

  3. The console window explanation:

    z1NQGq.png

    1. The title, drag this to move the window around.
    2. Exit button, click to close the window.
    3. Env options, use Panku.register_env() to add more envs.
    4. Input field, press enter to submit, up/down to navigate history input.
    5. Resize button, drag this to resize the window.
  4. Try to type 'abs(cos(PI))', you will see the result 1.

  5. Now, try to type help and you will get some basic hints.

    z1DXHf.png

    How is this implemented? Well, it's EXTREMELY easy, just define a variable or constant like this in the default_env.gd, more details will be explained in the next step.

    const help = "available methods: say_hi(), enable_in_game_logs(bool), cls()"
  6. The core execution procedure is implemented by Expression which is a class that stores an expression you can execute.

    For example, you can add Panku.regiter_env("player", self) in the _ready() function of your player script. Once it's done, suppose there is a variable called hp in your player script, you can type hp (The left option button should be player) in the console, then you will get the actual value of player's hp. What's more, you can type set("hp", 100) to change the value(Note that you can't use hp=100 since this is not a valid expression).

    For more information about what is Expression, please visit Evaluating expressions

  7. Check panku.gd to see what you can do with the global singleton Panku

At last, please pay attention that while this plugin is powerful, it's not ready for players since Expression is unsafe and exposes lots of internal structure.

A safer command system is being actively developed which can be used by the players, see the Roadmap part below.

🗺Roadmap

We're planning to add more features to this plugin in the future, stay tuned!

Roadmap: Panku Console Roadmap

🏗Contrubuting

You are welcome to make contributions, feel free to make issues, proposals and pull requests.

📜License

Licensed under the MIT license, see LICENSE for more information.

pankuconsole's People

Contributors

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