#Help with Async Multiplayer

1 messages ยท Page 1 of 1 (latest)

shadow tinsel
#

Good day, I haven't looked at it yet, but making this a thread to avoid the spam.

golden echo
#

all good, thank you

#

and good day/morning (it's morning for me) ๐Ÿ™‚

shadow tinsel
#

One thing I see in your BP spaghetti is that you grab the Character from the GameInstance. If this is in the GameMode, as you say, this will always be the Server's value.

golden echo
#

yes, i do grab from the game instance. as that's where I grab the characters from. But yes, my code is pretty spagetti haha

#

and alright, hmm

#

Any suggestions where to put this code? Sorry, I'm still learning as I go

#

or shall i remove that bit?

shadow tinsel
#

Well, you are a beginner and you are trying to solve a complex thing that is even more problemstic in BPs due to not having the same amount of functions available to you.

#

To fix that specific part I would need to explain for a while and I don't really have the time for that.

#

The main point is that you first need to send the Server the Data from the Client before it can decide on the Team

golden echo
#

no problem, thanks though!

shadow tinsel
#

You can do that in the BeginPlay of your PlayerController, limited to IsLocalPlayerController, via an RPC.

#

You grab the Data from the GameInstance, then pass it into the RPC

#

On the RPCs side you can then call your "Figure out my team" stuff

#

If that's in the GameMode, then get the GameMode, cast it to yours, call the function, pass in "self" for the PC and maybe add a pin for the data of the GI that you send with the RPC

#

That should already improve the setup and maybe even resolve any issues you have

#

If you decide on the Class what team they go in, that this is def your problem

golden echo
#

yep, thanks ๐Ÿ™‚

golden echo
#

I'm assuming the RPC goes into the Player Controller?

#

or starts there?

#

is what i have or am assuming you meant

golden echo
#

never mind! i figured it out finally. only issue now, i'm unsure if it's only the engine edtior or not, but if i try to join twice as the same 1 man team after hosting it won't let me then join as another team, once it declines the 2nd player. but i am able to join as a different team just fine if i re-host it and dont join it as the same 1 man team and join as another team of differing size

golden echo
#

reopening the game fixes the issue if ive packaged it. but if i have the game open and join the same team once it's full and it kicks me, then while still open try to rejoin it wont let me. BUT re-opening the game and joining a different team fixes this. not sure why it does this.