Step-by-Step "Tutorial" for client-to-server Replication needed
since nobody seems to answer my previous question, I go one step back and ask for a more simple solution to a problem. I got more understanding in my previous approaches, but I still cant really figure out the right way to accomblish it.
So what would help me now would be a really small step by step tutorial for a variable replication from client to server.
All that I need would be a simple setup like e.g. the following:
Bool Variable (test) = false
Begin Play -> Delay -> Set to true (so far I can do it of course :D)
And then exactly what I should click to make the state of the variable change on the server too. What event/function to create, name them (example), how to call.
I know, this is a very special request for the answer hub, but the asked issue is pretty simple I guess, so it would help me a ton, if somebody could provide me with a step by step and some pictures maybe.
Thanks so much!
asked Oct 26 '14 at 08:18 PM in Blueprint Scripting
Okay I got the theoretical part all figured out. I know how to connect all the dots to make the magic happen.
My RPC gets not called, because I am not the owner apparantly.
I have selected to start with Default Pawn to "None" so at Begin Play I am basically "nothing."
The Blueprint above is on a actor called spawner, which is placed inside the level.
How would I accomblish to "own" the spawner blueprint, while being nobody so to say?
P.s. Since I do not know how this question gets updated in the answer hub, i will start a seperate question soon.
answered Oct 29 '14 at 09:12 PM
Whats the context of this question? What thing sets the bool and why should the server use the client value?
Normaly you would make a replicated function. Thats a custom event. You can set the replicate to "Run on Server".
This is called by a client and runs on the server. So you could make an input for this event (bool) and pass the bool. Use a "authority" node to make sure the client only calls it. Then on the server side of the event, use the variable you passed to set the variable serverside.
A custom event always has a red node and a blue node. If you create the event, you get the red node. Here you set the replicate option and add inputs. Now you can search for the event like every other node and use this second node (" blue") to call the event. So the begin play goes into a delay node then into a athority node, then on " is authority" into a set node that sets the replicated bool directly and on the client exec you take the custom event and mark the bool input with true. At the other end of the event you take the bool and again set the bool.
That should be all. Cant give you pictures because im on phone.
answered Oct 27 '14 at 11:55 AM
how would you replicate a float from a client to the server and any other clients? when I use a custom event set to "run on server" the float just stays at its default value no matter what, I have tried putting the float in as an input in the custom event but that comes through as zero every time or if I plug it strait into what it is meant to be doing inside the custom event then it uses the default value but doesn't listen to what the client is doing.
answered May 15 '15 at 08:39 PM
The Cheese Dragon
Follow this question
Once you sign in you will be able to subscribe for any updates here