First of, you can right click on the trigger root node in the right window and click on "copy as text" and post the trigger in the forums without having to take an image.
I also recommend switching back to the simple view because its easier to understand for beginners.
Second, the solution to your specific problem is a loop. Whenever you want to repeat a specific task for multiple players on a global level, you should use a "for each player" or "pick each player" loop. I recommend using a "for each player" loop because you will run into problems using "pick each player" only (This is beyond the scope of this question though).
To understand how this works we need to remember some facts:
- Players are just integers (Numbers between 0 and 15 in this case)
- A player based loop will take a player group as parameter (a player group is a container storing players/integers) and loop through all entries of the container one by one
- There a native function returning various defined player groups, such as "Active Players", "All Players" and so forth, but you can also create your own groups and add specific players to them.
For your specific problem, a solution using player groups and loops could look approximately like this:
So, lets say there are 2 players in the game currently playing (Slots 5 and 8). The "Active Players" function will then return a player group in the following form: (5,8)
The loop will now use the specified loop variable (current player in the above example) and set it to the first player of the player group (current player = 5).
Then we check our conditions normally, using 5 as player index.
After that, the loop will set current player to 8 and run the checks again. Once it looped through all entries of the group it will exit.
Please post your exact code causing the problem. It will be easier to explain the concept of multiplayer programming with a specific example.
In most simple cases, you can use the (Triggering Player) function to retrieve the player who caused the event to fire.
Example for a trigger displaying a greeting message for the player who entered "hello" in the chat:
greetingEventsGame-PlayerAnyPlayertypesachatmessagecontaining"hello",matchingExactlyLocalVariablesConditionsActionsDebug-Display(Combine("hello and welcome ",(Nameofplayer(Triggeringplayer))))asdebugoutputusingType01,andDodisplayitinthegamewindow
^ If player 1 types "hello", Triggering Player will return 1 and therefore the game will display "hello and welcome <name of player 1>. If player 3 enters the chat message, Triggering Player will return 3 and so forth.
@Booleeas: Go
First of, you can right click on the trigger root node in the right window and click on "copy as text" and post the trigger in the forums without having to take an image.
I also recommend switching back to the simple view because its easier to understand for beginners.
Second, the solution to your specific problem is a loop. Whenever you want to repeat a specific task for multiple players on a global level, you should use a "for each player" or "pick each player" loop. I recommend using a "for each player" loop because you will run into problems using "pick each player" only (This is beyond the scope of this question though).
To understand how this works we need to remember some facts:
- Players are just integers (Numbers between 0 and 15 in this case)
- A player based loop will take a player group as parameter (a player group is a container storing players/integers) and loop through all entries of the container one by one
- There a native function returning various defined player groups, such as "Active Players", "All Players" and so forth, but you can also create your own groups and add specific players to them.
For your specific problem, a solution using player groups and loops could look approximately like this:
So, lets say there are 2 players in the game currently playing (Slots 5 and 8). The "Active Players" function will then return a player group in the following form: (5,8)
The loop will now use the specified loop variable (current player in the above example) and set it to the first player of the player group (current player = 5).
Then we check our conditions normally, using 5 as player index.
After that, the loop will set current player to 8 and run the checks again. Once it looped through all entries of the group it will exit.
Please post your exact code causing the problem. It will be easier to explain the concept of multiplayer programming with a specific example.
In most simple cases, you can use the (Triggering Player) function to retrieve the player who caused the event to fire.
Example for a trigger displaying a greeting message for the player who entered "hello" in the chat:
^ If player 1 types "hello", Triggering Player will return 1 and therefore the game will display "hello and welcome <name of player 1>. If player 3 enters the chat message, Triggering Player will return 3 and so forth.