Problem when loading games in multiplayer

Thanks for reading and sorry for my bad english :stuck_out_tongue:

Well, in my game, each player has a lot of saved variables like race and name. But in a multiplayer session, the “load variables from saved games” function loads for every player with the local save of who is playing.

This function is associated with the Begin Play event.

How can I fix this? Thanks!

You have to make sure those variables are set on the server. To get the variables from that player you need to do some extra work.

Create a function in your player controller which gets those variables and returns them (ideally in a struct).

In your game mode on “Event post login” (when a new player connected) you get a reference to that players player controller.

Get the variables from the function you created and apply them to the possessed character of that player controller.

You might be able to do this via the player controller only by using “Run on Server” custom events but I’d have to test that first.

Cheers

Hey buddy, there was a lot of time since you answered this, sorry for not replying. So, I tried what you suggested and I think we’ve made some progress. I created a blank project to test it out and look the results:

In this project, the player can choose between two colors for his head: Green and Red.

I’ve managed to put the blue color where no information is provided to load. So, if the player head is blue, that means that his material wasn’t loaded from the save.

This is the Player Controller:

This is the Game Mode:

And this is what happens:

The server sees everyone with the same head color as him and the client sees everyone with a blue head, which means that event of overriding colors didn’t worked / didn’t was executed at least in his game.

Please help me and thanks for reading!

Really your article is very helpful for me I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.

I am baffled, amazed and disgusted all at the same time.

“Marketing” and spam on the internet has gotten real strange.

https://www.khanclip.tk

free movie download apps
vidmate apk download
vidmate download apk
9apps 2019
movies download app
movies downloader app
9apps fast download

You can fix it yourself by research on online.
Really this is a good question.
If you want to know about then check this out.

I did a similar thing in my multiplayer game where each player had a preferred color that was saved on their local computer.

  1. Basically, each local PlayerController reads its color preference from a local save file, and then tells the server what that color is.
  2. The server gets the color the player wants, and then sets a RepNotify variable.
  3. Inside the RepNotify function (not shown in image) you find your Pawn material and change it to the new color.

Notes:

  • The reason I did this with the PlayerController BeingPlay is that the GameMode class only exists on the server, so sadly, the handy OnPostLogin function is not available to remote players who join the game. However, if you don’t want to use BeingPlay you could create a custom Multicast event called MyPostLogin in the PlayerController, and have the server call that every time a Player logs in.
  • One thing to be aware of is that Players joining a game is like this: PlayerController Spawns → a little bit of time passes - > Pawn Spawns → a little bit of time passes → PlayerController Possess Pawn. This means you have to be careful because during the BeginPlay for the Pawn and PlayerController, the PlayerController and Pawn are not connected yet (i.e. the Pawn possession has not occurred yet). A quick hack is to use a delay node to wait a little bit for this to happen.
  • The OnPossess event is super handy, and seems like it would avoid the need for that delay node, but is sadly only called on the server. Again, you could always create a custom Multicast “MyOnPawnPossess” and do it that way to avoid the delay node.

How to make money! Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

http://www.clusterhall.com

How to make money! Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

http://www.clusterhall.com

Welcome to our site. Thank you for Visiting our site.
I hope you love this site and you can find each and every thing about Poetry which you want , If you have any issue you can contact us.Thanks for giving your valuable time
https://www.urdulovelyshayari.com/

Exclusive access to the best Online IAS coaching material. We are known to be the best website for Best Online Coaching for UPSC examination. Get the best online IAS coaching options, mock tests, interview guidance and support services here. The best learning materials that promise success in the UPSC IAS examinations and best Coaching experience.

This is a good question. Research it on google and I hope you will find it. for more query visit: Vippoetry

I provide the details related Apple iPhone 11 Pro. I tell the details related to Camera Specification, RAM and ROM details, Performance details and also Main details.

Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful… Download FRP Tools, Samsung FRP Tool, MTK USB Driver,SPD USB Driver

Thanks for sharing nice information…
AI Training in Hyderabad

Very nice post. I absolutely love this site. Thanks! עיסוי אירוטי בחיפה

עיסוי אירוטי בחיפה

Hi
we can solve all the problems regarding Business solutions and IT Soutions
Enabling Systems Provides All the solutions Including App development and Web development Services

Hi
we can solve all the problems regarding Business solutions and IT Soutions
Enabling Systems Provides All the solutions Including App development and Web development Services