Hello,
I make a multiplayer game on the model of multiplayer bomber.
on gamestat.gb (autoload) I have the code:
func player_cargo_port(name, idx_cargo, idx_port):
var cargo = idx_cargo
var port = idx_port
rpc_id(1, "maj_cargos", cargo)
rpc_id(1, "append_all_players", unique_id, name, cargo, port)
remotesync func maj_cargos(cargo):
cargos[cargo][2] = true
rpc("update_cargos", cargos)
remotesync func update_cargos(dict):
cargos = dict
remotesync func append_all_players(id_expediteur, name, idx_cargo, idx_port):
all_players[id_expediteur] = [name, idx_cargo, idx_port]
rpc("update_all_players", all_players)
remotesync func update_all_players(dict):
all_players = dict
emit_signal("player_list_register")
This works very well for the all_players dictionary, but for the cargo dictionary declared like this on gamestat.gb:
var cargos = {0:[load("res://images/cargo_bleu.png"), "Bleu", false], 1:[load("res://images/cargo_bordeau.png"), "Bordeau", false], 2:[load("res://images/cargo_jaune.png"), "Jaune", false], 3:[load("res://images/cargo_rouge.png"), "Rouge", false], 4:[load("res://images/cargo_vert.png"), "Vert", false], 5:[load("res://images/cargo_violet.png"), "Violet", false]}
I have a big problem, on the server I have well:
print_debug("cargos : ", cargos) from lobby.gb =>
cargos : {0:[[StreamTexture:1131], Bleu, False], 1:[[StreamTexture:1134], Bordeau, True], 2:[[StreamTexture:1137], Jaune, True], 3:[[StreamTexture:1140], Rouge, False], 4:[[StreamTexture:1143], Vert, False], 5:[[StreamTexture:1146], Violet, False]}
but on the client the texture is transformed like this:
cargos : {0:[[EncodedObjectAsID:3156], Bleu, False], 1:[[EncodedObjectAsID:3157], Bordeau, True], 2:[[EncodedObjectAsID:3158], Jaune, True], 3:[[EncodedObjectAsID:3159], Rouge, False], 4:[[EncodedObjectAsID:3160], Vert, False], 5:[[EncodedObjectAsID:3161], Violet, False]}
Thank you for your help, I'm new to Godot.