–1 vote

I'm trying to make an in-game console that will make up most of my gameplay, where the user can use the console(debugger) to enter simple commands, i.e., collect_item and the item will be collected. What I want is a custom autocomplete feature that will be able to generate the command for the user, so that they can get use to writing lines of code if they don't know the first time round what exactly to type.

This would work by for example writing the first letter or word i.e, coll... and then the actual completion of the command appears, therefore collect_item. I was wondering how I could go about this.

Any feedback would be much appreciated.


Godot version 3.4
in Engine by (72 points)

What part are you wondering about exactly?

If it were me, I'd start by breaking down the tasks. An easy part would be the basic UI setup. Just some control nodes and options to allow typing and show output somehow.

Another part would be algorithms/manipulation to get the elements to autocomplete to. What is the set of commands the user can do that they should see?

By this time, updating the UI to reflect those completions will probably be pretty clear. How can you show the autocomplete options in an intuitive way and allow the user to choose it?

I bet there are examples of basic auto completion on the internet in lots of languages, especially a shell language like Bash. After that, translating to GDScript shouldn't be too bad

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.