godot-gdscript-toolkit icon indicating copy to clipboard operation
godot-gdscript-toolkit copied to clipboard

Keyword 'remotesync' in combination with variables break gdformat

Open programmingBazi opened this issue 2 years ago • 5 comments
trafficstars

Problem Description I am currently using Godot==3.5 and gdtoolkit==3.5.0. I have in my code variables that are marked with networking keywords. For example: remotesync var foo: int or remote var bar: int The usage of networking keywords with variables currently break gdformat. Here is an example error message

remotesync var personal_rpc_id: int
           ^

Unexpected token Token(TYPE, 'var') at line 14, column 12.
Expected one of:
        * _NL
        * FUNC

Sadly i was not able to find documentation about GDScript and how to use networking keywords with variables. As my code works as expected, i guess the keyword is allowed to be used.

Expected behaviour Formatter allows the use of networking variables together with variables.

Thanks in advance and thanks for these useful tools!

programmingBazi avatar Mar 28 '23 16:03 programmingBazi

I think there was something similar reported before - can you check if your game stops working if you remove remote/remotesync keywords from variables?

Scony avatar Mar 28 '23 21:03 Scony

If i remove the keyword i can't change the variable with the rset mechanism anymore. e.g.: rset("foo", 20)

programmingBazi avatar Apr 02 '23 14:04 programmingBazi

If i remove the keyword i can't change the variable with the rset mechanism anymore. e.g.: rset("foo", 20)

Ok, thanks for info - it looks like indeed gdtoolkit lacks support of remote/remotesync variables. So far it supports only puppet. Do you know if it's possible to define variables with keyword other than remote/remotesync/puppet?

Scony avatar Apr 02 '23 15:04 Scony

I would expect all 6 of the network keywords are allowed for Godot 3.6/3.5 - Source:

  • remote
  • remotesync
  • puppet
  • puppetsync
  • master
  • mastersync

For Godot 4.0 this changes to 4 network keywords - Source:

  • remote
  • remotesync
  • puppet
  • master

How can I support you with the Issue?

programmingBazi avatar Apr 02 '23 20:04 programmingBazi

I'm good, I'll try to implement that in the upcoming weeks.

Scony avatar Apr 05 '23 18:04 Scony