Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

rpc problem

I have a blueprint that is replicated, a player controller and two pawn(To keep player data) my game is a turn base puzzle RPG.

My problem is that in my main blueprint I can't manage to call event on the server (it only calls from server to server) but from the server I can call multicast events. I have done my research and found stuff that says the client needs to own the object in order to call a RPC. I can call server event on player controller but when I want to call the grid function from the server nothing happens unless I am on the server.

My grid events and replication options:

alt text

My player controller events and replication options:

alt text

The output when called on client and when called on server:

alt text

Product Version: Not Selected
grid.png (85.3 kB)
pc.png (128.8 kB)
server.png (16.4 kB)
grid.png (83.0 kB)
more ▼

asked Mar 26 '15 at 06:29 PM in Blueprint Scripting

avatar image

1 1 2 3

avatar image JulianS Nov 18 '15 at 10:49 AM

The problem is, that you can only call RPCs from your PlayerController as you already found out by your self. Calling it form GameState or a possed Pawn should work aswell. https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Blueprints/index.html#ownership

I personally do not like this limitation because it restrains the possibility of modular programming.

Does anyone know if those limitations exist in C++ scripting as well?

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

1 answer: sort voted first

Here's the problem.

Replicated objects are managed by the server, not by the client, Grid is not a replicated variable, so it is locally referenced. The server has access to it's own Grid, but when the client makes the call for the server, it will look at the replicated object and see that Grid is none (because it only exists on the local client).

Billy Bramer made an amazing tutorial for networking in blueprints, it greatly explains how UE4 handles RPC.

Hope it helps :)

more ▼

answered Mar 26 '15 at 08:50 PM

avatar image

2.1k 104 70 160

avatar image 123rockon Mar 26 '15 at 09:39 PM

I'm sorry but the grid is indeed replicated I must have used the player controller replication image when making the final image.

avatar image Justin.Dooley Mar 26 '15 at 10:11 PM

Player controller is not replicated by default, so replicating variables inside of an object that is not itself replicated won't work either.

avatar image 123rockon Mar 27 '15 at 04:56 AM

What variable should I replicate in my player controller? I tried spawning the grid from the server but it changes nothing .

avatar image Justin.Dooley Mar 27 '15 at 03:34 PM

I greatly suggest keeping variable replication out of Player Controller (which >>is not<< replicated by default) and keep all your replicated variables inside of Player State (which >>is<< replicated by default).

You can leave your RPC calls inside of player controller, those will still work just fine, just keep replicated data out of it and into something like PlayerState which was made specifically to hold those variables for replication.

avatar image 123rockon Mar 27 '15 at 04:28 PM

But it does not help me call the grid.

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

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question