- Joined
- Sep 7, 2008
- Messages
- 139
BearMan
Presents:
Booting Player System
Using Dialogs
Presents:
Booting Player System
Using Dialogs
Introduction:This is a short tutorial on how to create a pretty cool booting(kick) system using dialogs. I think it looks a little better, it's more advanced but it gives Player 1 (Red) the great opportunity to kick players with a good overview on which player to kick. Before going to this tutorial I suggest that you look into the Basics of a Dialog tutorial created by regingspeedhorn and Orc_Tamer.
The Variables:We will be creating two variables for this tutorial.
Create a variable and name it: BootDialog and set the type as Dialog, then create a second one and name it BootDialogButton and set the type to Dialog Button. Array the Dialog Button variable with a size of 4 (or the number of players in your game).
Triggers:
Creating the dialog:What this does is that if there is a player it creates a dialog button with the name of the player. And another button that says "Exit".
- Create Dialog
- Events
- Player - Player 1 (Red) types a chat message containing -boot as An exact match
- Conditions
- Actions
- Dialog - Clear BootDialog
- Dialog - Change the title of BootDialog to Boot Player(s)
- If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Dialog - Create a dialog button for BootDialog labelled (Kick + (Name of Player 2 (Blue)))) else do (Do nothing)
- Set BootDialogButton[1] = (Last created dialog Button)
- If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Dialog - Create a dialog button for BootDialog labelled (Kick + (Name of Player 3 (Teal)))) else do (Do nothing)
- Set BootDialogButton[2] = (Last created dialog Button)
- If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Dialog - Create a dialog button for BootDialog labelled (Kick + (Name of Player 4 (Purple)))) else do (Do nothing)
- Set BootDialogButton[3] = (Last created dialog Button)
- Dialog - Create a dialog button for BootDialog labelled Exit
- Set BootDialogButton[4] = (Last created dialog Button)
- Dialog - Show BootDialog for Player 1 (Red)
Booting the chosen player(s):What this does is if a button is clicked the specific action will happen. Either kicking the selected player or exiting from the dialog.
- Boot Players
- Events
- Dialog - A dialog button is clicked for BootDialog
- Conditions
- Actions
- If ((Clicked dialog button) Equal to BootDialogButton[1]) then do (Game - Defeat Player 2 (Blue) with the message: Kicked!) else do (Do nothing)
- If ((Clicked dialog button) Equal to BootDialogButton[2]) then do (Game - Defeat Player 3 (Teal) with the message: Kicked!) else do (Do nothing)
- If ((Clicked dialog button) Equal to BootDialogButton[3]) then do (Game - Defeat Player 4 (Purple) with the message: Kicked!) else do (Do nothing)
- If ((Clicked dialog button) Equal to BootDialogButton[4]) then do (Dialog - Hide BootDialog for Player 1 (Red)) else do (Do nothing)
Summary:And that's about it. If you have any questions you can send me a personal message and I'll try to answer your question. Thank you for viewing this tutorial!
This is what the Dialog look like in game: (with one computer playing)
Attachments
Last edited: