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"

Spawning of Actors in Multiplayer

Hi there, so im creating a multiplayer RTS and i need the players to be able to spawn in a set of user defined ships. The information is currently entered by the user in a widget and passes the ship information via a structure to the game instance where, when called, the event should create the ships and apply the information to them. The event on the game instance is replicated to server and the ship class is set to replicate.

Currently however, when the host calls the event, the ships spawn on both players screens and work just fine but this isnt true for the client. If the host calls the event first, when the client calls the event nothing happens at all. When the client calls the event first, the clients ships spawn only on the clients screen and the host spawns on both.

Ive tried pretty much all combinations of replication on both the event and the actor but i cant seem to get it to work. Attached : Screen of the latter part of the custom ship building UI and event call and a screen of the game instance BP portion that should handle the spawning of ships.

Im unsure as to what to do here, any assistance is very much welcome.

Further info available if needed.

Thanks in advance.

Strove

alt text

alt text

Product Version: UE 4.14
Tags:
more ▼

asked Apr 09 '17 at 02:27 PM in Blueprint Scripting

avatar image

Strove
1 1 2 3

avatar image Strove Apr 09 '17 at 07:27 PM

Ok so on further investigation i've found that my issue is that the client is unable to transfer information from the widget to the game instance. Still working on this, as ever, assistance welcome.

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

3 answers: sort voted first

Try with new live training made by unreal engine 4 staff https://www.youtube.com/watch?v=hlDWovBcu7E&t=967s

more ▼

answered Apr 09 '17 at 02:31 PM

avatar image

MK Studio
616 16 5 29

avatar image Strove Apr 09 '17 at 06:14 PM

No help, ive used the switch authority, set up parallel events and tried all combinations of replication.

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

Im close to giving up at this point. All i need is a damned tickbox generated as a bool in a widget on the client to be visible to the server. Ive tried saving to player controller and using a gamemode based list of connected players to access it, nothing. Ive tried saving to the in world character and using a get all of class, nothing. Ive tried to setup a player state and saving the bool in the player state but now a bunch of other stuff has broken.

Im at a loss and i cant find any one capable of assisting me. So far the closest ive gotten is a vague, non-answer from MK Studio...

Ive been using switches on authority, replicated events and variables and the closest i can get is a local client-only result where the server is unaware of the change done locally and thus cannot act upon the change. Ive been working on this for about 5 weeks, been following tutorials, asking for advice and i get nothing.

more ▼

answered Apr 19 '17 at 03:28 PM

avatar image

Strove
1 1 2 3

avatar image vanlacke Apr 19 '17 at 03:51 PM

Don't really understand what you need, but I'd be happy to help you out on discord or something since problems like these are really tough to debug in answerhub comments

avatar image Strove Apr 19 '17 at 04:12 PM

That would be a great help. Ive always found that direct assistance helps much more than videos or example projects as its more tailored to the specifics. Do you have a server to join?

avatar image vanlacke Apr 19 '17 at 11:47 PM

Sorry, was at work. You can join here and hopefully we're on at the same time

https://discord.gg/2wypGjK

avatar image Strove Apr 20 '17 at 06:43 PM

I assume your US based then? Ive joined the server, @ me when youre on, lets hope we run into eachother sometime.

avatar image Strove Apr 21 '17 at 11:38 PM

Server gone, Whats up?

avatar image marianomdq Dec 03 '17 at 06:46 PM

Could you solved this?

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

Solved it: Here's what you need to do: Make a special event that only runs on the server side for each thing you need to be replicated. Then, when it's time for the player to do it, call the event that runs on the server. From there, it will replicate to the other players (replication works from the server to the clients, not the other way around). If you want, I can show you how I have my blueprints. FOR EXAMPLE: you need your character to spawn a box when you click. Your character calculates the transform of the box, then call the event that happens on the server side (costum event within your character blueprint with the "replicates" option in the details window set to "run on server")alt text

unrealhelp.png (696.0 kB)
more ▼

answered Dec 26 '17 at 02:38 AM

avatar image

Bstylestuff
1 1

(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