Finally managed to get the keybind system working

10 days ago by MousePotatoDoesStuff to c/godot

Hopefully this is the last time I have to implement the backend for this - I'm going to reuse the code for this from now on. (The display, however, could definitely use some work.)

You don't have to go through the same ordeal. Get the source code from my Codeberg repo - it's MIT licensed and GenAI-free.

You can also follow the plugin development on my:
Mastodon
Bluesky

ICastFist 4 points 10 days ago

So Godot STILL doesn't let you treat the InputMap.Actions as an editable array? Why? I remember suffering like hell to allow players to have main buttons, secondary buttons + gamepad rebindable keybinds, all because I couldn't simply do something like InputMap.set_action("action_jump", 1) = "whatever"

path: 0 26232029, hotness: undefined, score: 4, children: 1
MousePotatoDoesStuff 3 points 10 days ago

I don't know about Godot (I could be missing this feature if they added it) but I sure as hell can let you do that. I'm already storing the events as an array in the config file, after all.

In fact, I'm going to implement this option right now (at least the under-the-hood part, will make an UI for it later).

path: 0 26232029 26232365, hotness: undefined, score: 3, children: 0
onomogo 2 points 4 days ago

Thanks for sharing the source. Two small things I noticed reading settings_handler.gd. CONFIG_FILE points at res://config/config.ini, and res:// is read-only in exported builds, so saving rebinds would probably fail outside the editor. user:// would be safer. Also, storing mute as a negative volume means a volume of 0 reads back as muted, which might be what you want, but worth knowing. The regex skip and include lists for leaving out the ui_ actions are a neat touch.

path: 0 26334742, hotness: undefined, score: 2, children: 1
MousePotatoDoesStuff 1 point 2 days ago

Thank you for the feedback! Will test and adjust the config file path. Yeah, volume 0 should be read as muted, and also restore to previous non-zero volume when unmuting (will test tomorrow also).

path: 0 26334742 26370784, hotness: undefined, score: 1, children: 0
godot
godot

@programming.dev

login for more options
7978
1192
558

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

  • Posts need to be in english
  • Posts with explicit content must be tagged with nsfw
  • We do not condone harassment inside the community as well as trolling or equivalent behaviour
  • Do not post illegal materials or post things encouraging actions such as pirating games

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

  • The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
  • The banner is from Godot Design

go to feed...