Multiplayer Commands How?

Tutorials and guides for Plazma Burst and community features.

Multiplayer Commands How?

Postby Yex » 5 July 2020, 02:21

Ok so I was struggling trying to make a multiplayer command and I just give up on that I can't do it and it's too complicated and I'm trying to learn variables guess I suck at map making. ;-;
I somehow managed to make singleplayer commands but to no avail, I couldn't make a multiplayer command no matter what.
User avatar
Yex
Civil Security Lite [100]
 
Posts: 103
Joined: 13 May 2020, 22:07
Location: Hell

Re: Multiplayer Commands How?

Postby Nyove » 5 July 2020, 16:44

TLDR: The key to make command system work in multiplayer is by utilising the trigger action:
Set value of variable 'A' to slot index of player who says text

For the others who are interested in how to set up a command system.
Step-by-step
Step 1. Run a timer (with delay=0) that executes a trigger, let's call it trigger 'A'.

Trigger A
Trigger action 1: Set value of variable 'A' to slot of current player
Param A: ~currentPlayer
Param B: N/A
(Slot number of current player will be stored in variable 'A'. This will be used later.)

Trigger action 2: Set trigger 'A' as player chat message receiver.
Param A: #ChatReceiverTrigger (just another trigger)
Param B: N/A
(Setting up a dedicated trigger to handle commands. Whenever someone types in chat, #ChatReceiverTrigger will be able to receive it.)

Chat receiver trigger
- Infinity calls, Enabled.

Trigger action 1: Set string-value of variable 'A' to text being said.
Param A: ~command
Param B: N/A
(This will capture whatever text has been typed in the chat and store it in variable 'A')

Trigger action 2: Continue trigger execution only if variable 'A' equals value 'B'
Param A: ~command
Param B: -help (whatever command you want to create)
(Checking if the text being said = to the command you set.)

#Below two trigger actions are neccesary for MP, they can be excluded in SP. The effect of the command will only apply to the person who says text.
Trigger action 3: Set value of variable 'A' to slot index of player who says text
Param A: ~playerWhoSaidTheText
Param B: N/A
(Sets the slot of the player who typed the command into variable 'A')

Trigger action 4: Continue trigger execution only if variable 'A' equals variable 'B'
Param A: ~currentPlayer
Param B: ~playerWhoSaidTheText
(This will check if the person who said the command is the current player himself.)

... Perform your trigger actions based on your command from here. (like printing out text for -help command, killing player 1 for -killGod, etc...)
Good luck.

Note: If you want your command system to perform different task based on their slot number
(like teleport player 1 if slot number is 0, teleport player 2 if slot number is 1, etc...), it gets more complicated.
TLDR for ^ is to execute a chain of triggers after the 1st 4 trigger actions, with each trigger having 'Continue if..' trigger action. (Every trigger checks for every slot number)
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: Multiplayer Commands How?

Postby _SkilledNinjaHyperX_ » 26 July 2020, 18:28

nyone but how you can make commands apply for one player?(like a map developer)
Bro

_SkilledNinjaHyperX_
Cyber Grub [25]
 
Posts: 39
Joined: 9 July 2019, 07:04
Location: Russia

Re: Multiplayer Commands How?

Postby nightmar » 27 July 2020, 02:26

I see people all over the place trying to make commands when they do not even know how to set a variable to a certain value. People, seriously, if you want to make something complicated that invloves variables then make sure you have some decent knowledge on them.
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

Re: Multiplayer Commands How?

Postby Tes- » 30 July 2020, 08:12

_SkilledNinjaHyperX_
First follow what Nyove showed in his text then come and see my text to understand a few missing steps you just need to add to make a VIP commands
In Chat receiver trigger
Trigger action 5: Set value of variable 'A' to login name of player with slot-value of variable 'B'
A = ~loginnameofPlayer
B = ~currentPlayer
Trigger action 6: Continue trigger actions execution only if value of variable 'A' equals value 'B'
A = ~loginnameofPlayer
B = Your login name here
Move the trigger action that checks what command you said and move it in trigger action 7 or check Nyove's text for command text said
Then you add any actions for the command such as show help texts or give god mode or whatever it is
If you're still stuck then instead copy and paste these in trigger chat receiver via text and then click apply and it should work
GetChatInput( "~command", "0" );
GetTalkerID( "~playerwhosaidthetext", "0" );
continue if VarA == VarB ( "~currentplayer", "~playerwhosaidthetext" );
op187( "~loginnameofPlayer", "~currentplayer" );
continue if VarA == ValueB ( "~loginnameofPlayer", "Tes-" );
continue if VarA == ValueB ( "~command", "-help" );

Tes-
 
Posts: 2
Joined: 27 July 2020, 02:41

Re: Multiplayer Commands How?

Postby Yex » 25 August 2020, 08:17

Is this still here?
Anyways I've already learned and studied Vars quite a lot as I am pretty intermediate with them I think so.
So I'm not sure when I will need help with Vars next time but probably not any time soon.
Now I really want to die. Just to get out of this embarrassment.
Don't talk to me.
User avatar
Yex
Civil Security Lite [100]
 
Posts: 103
Joined: 13 May 2020, 22:07
Location: Hell

Re: Multiplayer Commands How?

Postby mici1234 » 8 December 2020, 19:23

I cannot find Trigger Action : Continue trigger execution only if variable 'A' equals variable 'B', Nyove how do u find it?

mici1234
Recruit
 
Posts: 19
Joined: 12 June 2017, 20:18
Location: Turkey


Return to Tutorials

Who is online

Users browsing this forum: No registered users



cron