Change GDscript syntax?
Asked Answered
N

8

0

Is there a way I could use GDscript with curly brackets syntax instead of the python syntax? Sorta like this:
func _ready(){
pass;
}

I already tried doing this but it threw an error. I don't like the python-like syntax very much, but I do like the language itself. I would use C# but It's compatibility with Godot 4 still feels unfinished and it doesn't have all the features as GDscript. If there is a custom build of godot that supports this or if somehow there's an easy workaround this please let me know.

Nahum answered 12/3 at 21:22 Comment(0)
D
0

Nahum Is there a way I could use GDscript with curly brackets syntax instead of the python syntax?

No. You'll get used to it.

In a way, it's nice. It forces you to indent blocks, which is desirable even in a language that uses braces {}.

Danette answered 12/3 at 23:19 Comment(0)
M
0

Nahum I would use C# but It's compatibility with Godot 4 still feels unfinished and it doesn't have all the features as GDscript

What's missing that prevents you from using C#, beyond the obvious web target (in 4.x)? Perhaps you should consider another language that uses curly-braces?

Mildew answered 13/3 at 11:25 Comment(0)
B
0

Give it some time. When I had to learn python for a project at my job, I felt the same. I'm mostly a C++ developer, have been for more than 20 years now, so pythons use of whitespace as a syntactic feature felt very foreign to me. But only a few weeks later I started to love it. It makes code look much neater and way easier to read. Actually, if I could take one feature of python and introduce it to C-like langauges, it would be the indentation system instead of curly brackets for blocks.

You can continue to use ; at the end of your lines, btw. That should not give an error in either python or GDScript.

Binge answered 13/3 at 12:36 Comment(0)
G
0

Python style formatting is great. You'll come to cherish it after you spend some time with it.
And I'm a C++ fundamentalist as well btw 🙂

Geometrician answered 14/3 at 0:27 Comment(0)
C
0

It sounds like you want this, but for GDScript.

https://pypi.org/project/Bython/

Cappadocia answered 14/3 at 13:54 Comment(0)
D
0

Cappadocia how much do you think someone could make developing this plugin and charging $0.50?

Davies answered 14/3 at 18:53 Comment(0)
D
0

At least $3. 😃

There must be half a dozen people who would buy it.

Danette answered 14/3 at 20:57 Comment(0)
G
0

Python with braces looks really uncanny 🫣

Geometrician answered 15/3 at 1:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.