-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
Description
I'm using:
- Godot 3.4.4
- godot-console 3.5.1
Given:
public override void _Ready()
{
// ...
wrapper.AddCommand("start_host", this, nameof(BeginServer))
.SetDescription("beings a dedicated host on %port% with %maxPlayers%. \"")
.AddArgument("port", Variant.Type.Int)
.AddArgument("maxPlayers", Variant.Type.Int)
.Register();
}
public Error BeginServer(int port = 25000, int maxPlayers = 2)
{
// ...
}the command is successfully registered. If i run the command with arguments provided:
start_host 25000 2
then the command successfully runs. However, if i run the command without some or any arguments provided:
start_host
then I get a runtime error:
E 0:00:04.577 callv: Error calling method from 'callv': 'Spatial(Game.cs)::BeginClient': Method not found..
<C++ Error> Method failed. Returning: Variant()
<C++ Source> core/object.cpp:829 @ callv()
<Stack Trace> Callback.gd:58 @ call()
Command.gd:72 @ execute()
ConsoleLine.gd:112 @ execute()