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.
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:
Spawn positions for the two players:
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.
asked Mar 07 '19 at 11:39 AM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here