+1 vote

Hi, so I've seen this question asked around before but it didn't really seem to get an answer that was satisfactory to me and my specific situation.

So for the last couple of weeks I've been experimenting with custom InputMaps and binding new controllers. I kind of ran into a really, REALLY weird roadblock where one of my controllers has the A Button as an axis (it's bizarre) and that sent me down this whole rabbit hole of trying to fix that because, while it may seem weird to worry about such a strange edge case, I can see scenarios where maybe someone wants their accept button to be like a trigger or something- L and R are usually analog axes on modern controllers as well.

Essentially what I did was create a whole bunch of new- and appropriately named for my game -inputs for my game and manually checked for input. Essentially what I figured out is that while Godot will not accept ui_accept as an axis input, Input.is_action_pressed() of course doesn't care at all. And furthermore, it fixed another problem I was having where if you had like ui_right or ui_left or whatever assigned to axes it would just FLY to the other side of the menu and be nigh unusable. So now I just have a simple function in like a GameMaster class that holds globals and some important stuff anyway that can tell if a menu screen is active and control the input. Cool.

Only problem is that despite deleting literally all the inputs for the ui defaults, I had a weird bug where ui_left and ui_right were still mysteriously showing up during run time. I probably spent an hour trying to figure out why left and right input would just skip a GUI item only to figure out that it was because the default input was somehow firing before my custom code. So I just used InputMap.erase_action() to get rid of it. Code works like a charm now.

The only remaining issue is that I'm getting this warning for every single ui default input now for literally every input frame. And on one hand I don't really care about that because the game works fine (better, imho) and even exports even though I saw on some answers that removing these "breaks" certain nodes. From my perspective all it does is make the ui not work how I want it to and become borderline dysfunctional with certain input settings. However, I'm getting like 800 errors during a 30 second playtest now and I'm both worried that I might get an overflow error of some kind or the error log will not work for me once I actually have some kind of game breaking issue.

So I guess I'm looking for one or more of the following answers:

  • Can you manually control how ui_left, ... etc work for switching between ui elements? Specifically what I mean is, like when you press left it will move to the next item to the left and then not move any more until the input is released and pressed again (which is what I coded custom anyway).
  • Can you suppress this error specifically or any errors/warnings which are not critical to game function and only spam the error log?
  • Anything I can do beyond a custom recompile to stop these errors from even being triggered? I'm pretty confident with Godot at this point, but I haven't touched C++ in like three or four years now.
  • Are there instructions anywhere for how to submit an issue to the devs/github? Because I frankly haven't ever really touched that end of it or even know if I'm allowed to honestly. (I also don't even know if it's worth it since I'm currently still using 2.1.4)

Thanks for any help you can give, I know this is a long one but the other answers I found were not satisfactory to me and I feel like if these issues cannot be fixed then this may be a design flaw that needs to be addressed, there's no reason to log an error for a noncritical problem that can be manually improved upon.

~AniMerrill

asked Jul 5, 2018 in Engine by AniMerrill (25 points)

Here's the only other relevant article I could find. I'm also confused by what this guy was trying to accomplish, but I suppose for clarity: I know that the ui defaults are used in engine, but the way they work doesn't feel good to me at all when scrolling between buttons etc.

If you dont use them, why did you delete all those ui defaults? I know that question sounds weird, but you can define your own and only use that, without breaking engine nodes.
If you want them to be deletable, or perform the way you want, perhaps you could request that on Github, but I don't understand why it was absolutely necessary to remove them (same question as Groud in your link).
To submit an issue: https://github.com/godotengine/godot/issues

The reason it is necessary because as long as they exist, they trigger default ui behavior and override the code I've written because their behavior is hardcoded into the engine.

The problem I was having is like... let's just say for the sake of argument I replaced uileft and uiright with inputs Left and Right. The problem I was having is that I had special behavior for Left and Right but if Left and Right got mapped to the same buttons as uileft and uiright, then before my code would execute during the loop the default ui functionality would fire causing my code to bug out. And just simply pressing the trash can icon on the input map does nothing, which is why I had to delete them entirely.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.