Search in
Sort by:

Question Status:

Search help


Replicating save to others

So I have a presumably simple problem. I'm trying to learn how to do online replication and I'm having a hard time of it.

So I made a test to try it out, make a character that is saved locally and then you play that character on a server, the only thing that is unique is the color you select that is saved to a file.

alt text

So the server sees everything correct, except the name, but I'll probably get that sorted out once I figure this out. I should mention this is a drop in and play kind of game.

This is the blueprint, one of the help files suggested using an input for the event but it never works unless i reference the variable manually. alt text

But the problem is the server sees it, but its not replicating to the clients. The event is being multicast and the material instance is created in the construction script. What am I missing here?

Product Version: UE 4.17
ue41.png (1.1 MB)
screenshot-2.png (131.2 kB)
more ▼

asked Sep 10 '17 at 02:16 AM in Blueprint Scripting

avatar image

329 7 8 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


You didn't mention which blueprint this was in. With replication this is very important. For example a game mode only exists on server, so a multicast should work. If it's a character, it's different. As a quick implementation, you can do a switch has authority, if true call multicast. If false, call a run on server custom event, which calls the multicast. Also note that events fired before someone else joins doesn't tell them anything, you need to use replicated variables, so when they join they read the variable that's replicated so they pick up any details that a multicast had previously set.

more ▼

answered Sep 10 '17 at 09:22 AM

avatar image

913 17 21 37

avatar image 16bit Sep 10 '17 at 07:45 PM

Ah sorry, this was in the character BP. I have the character data struct, which contains all the variables about a character as replicated.

I changed the BP a bit and got some weird results. alt text I moved the material instance creation from the construction script into the actual event and it looked promising for a second. It is changing the colors and the ones that join after are the correct color too. It's just.. alt text SERVER Client1 Client 2

Whenever a player joins, it alters the color of the player who joined before them on their screen to that player's color plus their own color. So if the player who joined before was red, and this player joined was blue, on the 2nd player's screen, the 1st player would be purple.

What is the best way to implement this, it feels really close to working.

screenshot-3.png (170.2 kB)
whatagain.png (1.2 MB)
avatar image 16bit Apr 10 '19 at 04:34 AM

Hi Daniel, it took me a year and a half to understand how this works and I wanna thank you for helping me. I got it to work finally.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:


Follow this question


Answers to this question