Godot suggestion : add a naming possibility for @rpc

Hello there !

First of all THANK YOU ! I love Godot in all his parts. It is such an amazing tool !
I am so sorry if this message dosn’t belong here, I have no idea where to put it.
I looked in the github repository but didn’t find a forum category.

So I noticed when using rpc, the “@rpc” must be before the “func” declaration. Like this :

@rpc
func myfunc () :

As I am listing my function with no line in between, I’m using it this way :

@rpc func func1 () : 
@rpc func func2 () :
func func3 () :
@rpc ("any peer") func func4 () :

But as shown, is not aligned when sided with non @rpc function and harder to read.

So my demand is the following :
Would it be possible and easy to develop to possibly have it this way :

func myfunc () @rpc : 

Thanks you so much for your attention,
Voyou.

1 Like

I am not sure if your suggestion is right, as it does not look proper I think. But you can request this feature in Godot Proposals. Forum is designed for help, showcase, etc, not suggestion requests.

2 Likes

This also interferes with static typing:

func my_function() -> void @rpc:

Is this how you imagine it? or this?

func my_function() @rpc -> void:

I think this looks terrible and usually such changes arent done because someone likes to code a certain way.
But you can still try your luck with the link @KingGD provided

4 Likes

I thank you so much for your answers.
And sorry that I post at the bad place, I’ll remind it for now.
Indeed, if it matters only for me I agree it wouldn’t be fair.
I see it as optionnal, it could still be placed at the begin.
Indeed, the second option would be what I imagine.
func my_function() @rpc -> void:

2 Likes

Dont forget that you still need to put in the arguments:

func my_function() @rpc("any_peer", ...) -> void:
2 Likes