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"

Creating a multiplayer group system

I'm looking into developing a group system for my game but am a little lost. Also as a side note, I'm running a 4.19 source built version of the game with the advanced sessions plugin for using dedicated servers & steam integration.

Here's how I want it to work: Player A walks up to player B and interacts with them, There will then be a confirmation popup on player A's screen asking if they want to invite player B, Then that will trigger a pop up on player B's screen prompting if they would like to join Player A's group.

I'm a little lost on how to communicate between the two players; Currently, when a player presses F there is a line trace which allows the player to interact with various objects in the game.

What I don't know how to do is check if the hit object is a player, & if it is be able to send messages between the interacting player and the player that was interacted.

Also how would I store each players information in array for the actual group itself? Would you get the players unique ID & store that in an array for instance. Or perhaps have a struct for each player's information and then the guild would be an array of player structs.

Any tips or pointers on how to go about doing this would be greatly appreciated.

Product Version: UE 4.19
Tags:
more ▼

asked May 20 '18 at 01:33 AM in Blueprint Scripting

avatar image

Sneaky.Rex
15 2 7

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

2 answers: sort voted first
more ▼

answered Aug 08 '18 at 09:21 AM

avatar image

NƎXƎN
1 3 5

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

I'm a little lost on how to communicate between the two players; Currently, when a player presses F there is a line trace which allows the player to interact with various objects in the game.

My advice would be to use an interface that allows "various objects" to determine how the player can interact with them. Your other player characters would implement that interface, and their "Interact" method (or whatever you decide to name the method in your interface) would contain the code for putting the players into a group together (or presenting the UI to do so).

Also how would I store each players information in array for the actual group itself? Would you get the players unique ID & store that in an array for instance. Or perhaps have a struct for each player's information and then the guild would be an array of player structs.

How you should store the guild is going to largely depend on what you plan to do with it. As far as identifying the players, I tend to avoid the unique ID - I prefer to use credential based identification of other players. This might be based on some misconceptions on my part (I'm still a novice at developing multiplayer games in UE4), but I suspect the unique ID doesn't persist between sessions. Your player's username is something you can expect to remain constant (if you provide them with the ability to change usernames, just make sure you update it everywhere their old username appeared).

Hope that gives you some ideas!

more ▼

answered Jan 08 '19 at 06:29 PM

avatar image

Bryant_PSC
31 1 2 9

(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