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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Character doesn't replicate?

I'm trying to set up a RTS game where players can select and control units that belong to them. I know how I would go about doing this if it was just singleplayer, but I'm trying to make it multiplayer, and it just wont properly replicate units being moved around.

If I move a unit around in a client window, you'll see it move around, but not on any of the other windows, similarly with all the other clients and the listen server. I'm not sure why this is happening, I haven't worked with multiplayer networking before.

Here are some pictures of what makes what happen. All inside the player controller BP. I've messed around with the stuff for quite some time now and jumbled some things around, so it might look a bit strange: alt text

alt text

Product Version: Not Selected
Tags:
more ▼

asked Jan 31 '15 at 06:16 PM in Blueprint Scripting

avatar image

Quark
21 1 3 3

avatar image eXi Jan 31 '15 at 06:21 PM

These characters that you are moving are set to be replicated?

asd

What is the base class of your units?

You also need to send this request to the server from client. You custom event is only launched if the server presses the input key.

And you would need to add an input of type "Player Controller" and pass the server the PlayerController of the client, so that he can work with it (and get its mouse position). Or directly pass the mouse position. Don't know what is better.

avatar image Quark Jan 31 '15 at 08:17 PM

Yes, they are set to be replicated.

Their base class is Character.

I tried setting the custom event to everything, didn't fix anything.

I'm not sure I understand what you mean with this last part, is it possible to explain to this dumb idiot?

avatar image eXi Jan 31 '15 at 08:39 PM

Can you give me some time? I just stopped learning and i want to play some rounds csgo. Later i can show you a basic setup to move ONE character. I guess you can recreate this for your unit setup. Maybe i can make it for more then one, but i don't know yet.

avatar image 1l2Hawk Jan 31 '15 at 10:21 PM

I'd guess the problem might be at the top of the 2nd image at the switch after the Right Mouse Button click event. Only the server is allowed to right-click the way you have it set up there, and I'm guessing all the clicking is handled on the Remote client side, right? You'll probably want the Remote clients to send an event to the server first, then have the server check if this is a legit action and if everything checks out okay, then it can call the Move event back on all the clients.

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

0 answers: sort voted first
Be the first one to answer this question
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