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"

Making Items only usable by one Player

Hello, I'm currently trying to implement a small "Bao Mancala" Board Game. For that I have created a "Trough" Blueprint which holds the number of stones the trough is holding as well as a reference to its neighboring trough (like a linked list).

See the following screenshot of the game in it's starting state.

alt text

Whenever I click on of the "outer" troughs, meaning one in the top-most or bottom-most row it becomes "activated". Upon clicking again the stones are taken out of the trough and distributed clockwise dropping one stone in a following trough. So in the beginning the two stones are taken out of one trough and one of the two stones is placed inside the one neighboring the "source" trough and the other inside the following neighbor.

Now...I want to make this a Multiplayer game, where the two players sit across each other. Each player should only be allowed to start their round by selecting one trough of the bottom-most row (looking at the board from their respective). So when numbering the rows globally from 1-4 starting from top to bottom one player should only be able to select a trough from row 1, while the other should only be able to select a trough from row 4.

I thought about using the PlayerState, but how would I tell the trough that it is only clickable by Player 1 or Player 2 respectively?

Also, I tried setting up two Player Pawns (which only consist of a camera and a spring arm) on opposite table sides, but that leads to the players spawning anywhere but the two Pawns. See the two images below for clarification.

Camera placement for two players: alt text

Spawn positions for the two players: alt text

When setting the "Number of Players" to one the player spawns within one of the Cameras as seen in image 1.

How would I go about it? I tried finding a solution but I can only find anwers regarding replicated actors that should listen to clicks/interactions from all players. Making actors exclusively usable by one player does not seem to be used that much.

Product Version: UE 4.21
Tags:
board.png (1.1 MB)
cameras.png (776.5 kB)
spawn2.png (1.4 MB)
more ▼

asked Mar 07 '19 at 11:39 AM in Blueprint Scripting

avatar image

PT_Max
23 5 10 11

(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