x

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"

Networking RPC and owners

I'm setting up a multiplayer board game and i'm having some networking issues i'm trying to fully understand. I have a game board blueprint static mesh AActor object in the level that I want to use to trigger custom events to create the players.(the game has no default pawn setup: defaultpawnclass = null) Right now I just have a custom event that prints to the screen but when I PIE with a client only the server triggers the event. I understand that you need an actor that is owned by the client in order to run the RPC.

How do I trigger RPC (run on server) if I don't have a default pawn? Is there a way to assign the game board to be owned by the client and the server so it triggers the RPC in that blueprint?

I got it working correctly if i assign a default pawn and put the custom event in the custom pawn class but i want to avoid having a default pawn getting created on game startup.

One solution is to make a derived blueprint off the CustomPlayerController since that will have a connected owner, is that a valid solution to add making game pawns in the player controller (it would call game mode functions)?

Originally i wanted the player creation logic in the game mode but since the game mode is only on the server the RPC didn't trigger through the clients

Product Version: Not Selected
Tags:
more ▼

asked Aug 11 '14 at 04:28 AM in Blueprint Scripting

avatar image

falola
208 24 21 30

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

1 answer: sort voted first

There are many different AActors that can be owned by the client, not just a APawn. In your case, if the client is truly connected and past login, then he has an APlayerController that you can put a "server reliable" RPC on.

Any actor that is spawned where the APlayerController is part of the owner chain (pawn, hud, etc), can have an RPC on it.

The client can call this function to have work done on the server. Alternatively, based on what you are trying to do, also after login, the server can call a "client reliable" RPC on the same object owned by the client, but on the server, to do work on the client.

more ▼

answered Aug 12 '14 at 09:41 PM

avatar image

Crzyhomer STAFF
1.3k 35 26 103

(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