Showing text to only one player (+ Explanation)

Tutorials and guides for Plazma Burst and community features.

Showing text to only one player (+ Explanation)

Postby Nyove » 5 July 2020, 18:21

Note: Aware that max teabag has already made a video, but I feel like some guides are better written.

Have a timer that executes a trigger.

Trigger A
Trigger action 1: Set value of variable 'A' to slot of current player
Param A: ~currentPlayer
Param B: N/A

Every player has a slot number. The first player has a slot number of 0 (in base maps 1st player are god), the second player has a slot number of 1, 3rd player = slot 2, 4th player = slot 3 etc..

After running this trigger action, every player will store a **different** value in ~currentPlayer

For Player 1 : ~currentPlayer will equal 0
For Player 2 : ~currentPlayer will equal 1
For Player 3 : ~currentPlayer will equal 2
and so on...

Assume there's a USE button which will execute a trigger to show text. Our goal is to limit the trigger to only show text to the person who only press the button.

Trigger B
Trigger action 1: Set variable 'A' to player initiator slot
Param A: ~playerInitiated
Param B: N/A

For example, if player 4 presses the button, the variable will contain 3.

In every player's screen, they all saw player 4 pressing the button, therefore every player also store 3 in ~playerInitiated.


Trigger action 2: Continue trigger execution if only variable 'A' is equal to variable 'B'
Param A: ~playerInitiated
Param B: ~currentPlayer

The first trigger action will set the variable ~playerInitiated to whoever presses the button.
Then, the 'IF' trigger action will compare whether ~playerInitiated is equal to ~currentPlayer.
Remember, every client has 3 in ~playerInitiated but has a different value in ~currentPlayer.
Therefore, the text trigger action will only run with player 4 (he is the only player with 3 in ~currentPlayer).


Trigger action 3: Show Text 'A'
Param A: Only you can see this :P
Param B: N/A

Good luck.
Proud to be part of something meaningful.
Need any assistance? Join the PB2 discord server at https://discord.com/invite/Bhe9rNz or raise a support ticket at https://www.plazmaburst2.com/support

Contact me on discord for quickest reply possible.

User avatar
Nyove
Moderator
 
Posts: 255
Joined: 7 July 2016, 10:26
Location: Cicada 3301

Re: Showing text to only one player (+ Explanation)

Postby Girl_Power » 5 July 2020, 20:43

It takes this much work just to show text to one player? No wonder very few people actually know how to work with complex triggers and variables.
Forever young, ever strong, ever brave.
User avatar
Girl_Power
Noir Lime [600]
 
Posts: 666
Joined: 12 February 2017, 00:45
Location: Earth | Close To The Sun

Re: Showing text to only one player (+ Explanation)

Postby Nyove » 6 July 2020, 03:53

To be fair, you only need 1 timer, 2 trigger with a total of 4 trigger action to perform the task.

However, I always believe in understanding the concept behind it so you truly understand how it works and you can use the existing knowledge and experiment with other trigger actions / concepts.

Therefore I tried my best to explain how and why exactly the trigger works so people can modify the existing set up according to their own needs.

There's two types of people in this world.
One that seeks on understanding and is not afraid to experiment.
The another just want to see results.

The smart become smarter, and the less intelligent becoming more so.
Last edited by Nyove on 26 July 2020, 08:39, edited 1 time in total.
Proud to be part of something meaningful.
Need any assistance? Join the PB2 discord server at https://discord.com/invite/Bhe9rNz or raise a support ticket at https://www.plazmaburst2.com/support

Contact me on discord for quickest reply possible.

User avatar
Nyove
Moderator
 
Posts: 255
Joined: 7 July 2016, 10:26
Location: Cicada 3301

Re: Showing text to only one player (+ Explanation)

Postby nightmar » 9 July 2020, 16:26

When someone fully understands how this mechanism works it will be easy for them to go beyond private texts. So I would say that this topic is a lot more useful than just private texts.
How many bugs does this game have anyway? jeez
User avatar
nightmar
Usurpation Destroyer [350]
 
Posts: 393
Joined: 2 September 2017, 19:36
Location: Inside your closet or under your bed


Return to Tutorials

Who is online

Users browsing this forum: No registered users