I was working on a simple multiplayer setup, and I just want to have it so when the server is created, it will send a signal to the LobbyMenu script which will add a new little box with the username in it.
func create_server():
var peer = NetworkedMultiplayerENet.new()
peer.create_server(SERVER_PORT, MAX_PLAYERS)
get_tree().network_peer = peer
print("Server created.")
emit_signal("server_created",LOCAL_USERNAME)
I ran the game and the print("Server created.")
ran, but apparently not the single because...
LobbyMenu.gd
func _ready():
Network.connect("server_created", self, "_server_created")
Network.connect("player_joined", self, "_player_joined")
Network.connect("update_client_player_list", self, "_update_client_player_list")
func _server_created(local_username):
print("Server Created, Updating LobbyMenu")
add_player_to_list(local_username)
players[1]=local_username
The "Network" is an autoloaded singleton of the Networking script with the create_server()
function. That print message in _server_created
never shows up.
I guess I'm asking if I'm making some dumb syntax mistake, or if anyone has any ideas as to why its just...not going.