Well one thing that might be a problem is that, game mode only exists on server so making event to work on owning client wont be called for player controller other then the one that is hosting. You should try saving information in the player controller. And if you want to call gamemode events like updating information on server you will have to use “on server” event to do that. If you want to call specific events from gamemode you will have to use player controller reference for that. I hopw it helps out. I am kind of learning the whole network thingy myself atm.
Hello,
currently I’m trying to implement some most-simple multiplayer - functionality, but I seem to fail at the simplest of simple tasks. I’ve been reading through other user questions and threads for hours without finding an appropriate answer.
I want to transfer the value of a variable (playername) from the personal game instance of a connected playercontroller to its version on the server, but I can’t seem to find a way to make this happen.
The course of events is as following:
GameMode → Event OnPostLogin —> calls ‘ROOC init’ on the passed playerController
PlayerController → ROOC init → sets some non-replicated variables and then calls ‘ROS_InitNameAndId’ passing the playername from its gameInstance.
PlayerController → ROS_InitNameAndId → should initialize the replicated playerName property.
But at this point ROS_InitNameAndId is never invoked. I have read through numerous threads which all say that ‘run on server’ - events can only be invoked by actors that are owned by the invoking client. But shouldn’t ‘Run on owning clilent’ do exactly that? You know it’s run on the owning client and ROS should replicate to the server, if it’s run by the owning client. So what’s wrong here?
I used to invoke the ROS- event from the Begin Play - Event, checking if it’s the client running it and then calling the ROS- event, with the same outcome. It’s not called at all.
On on the other hand ROS - events seem to work when invoked from within a widget, caused by a button press. But I’d rather have an automatic way of communicating towards the server.
Btw. I’m doing this manually assigning of the id so I can differentiate different players started as new editor window on the same machine, so playerState->playerId does not work for me at this point. It’s a workaround and does not really pertain to the question here.