+1 vote

That means: 1->"a", 2->"b", 3->"c", ... , 26->"z", 27->"aa", etc, just like spreadsheet horizontal cell indexing?

I looked for it in the documentation, but I couldn't find it. If it doesn't exist, I'll just make it myself, but I like to use engine functionality as much as possible.

Roman numerals would work for me too, I just need something other than numbers to distinguish two systems in my game.

in Engine by (70 points)

There is String.ord_at(pos) which returns the character code at a given position in a string, but I cannot find a ord_to_string... maybe it exists, but it could have an exotic name like this one and it puts me off searching :s

I think you could do your own dictionary for a start, but it's true that what you describe could easily be implemented in one line of code in C, like chr = code + 'a'; :'D

1 Answer

0 votes

I need something like this for planet names like "PXF-6722". The only thing I can come up with is using an array of the alphabet and calling a random position of the array.

by (23 points)
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.
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 webmaster@godotengine.org with your username.