S
Senkin
Guest
I have a multiboard in Destiny RPG made by Im_On_56k and when a player leaves we want thier units (Hero and all) to be removed and thier name to be tooken off the leaderboard or at least named to leaver.
Here is the ENTIRE Multiboard code, and the variables to go with it.
Create Multiboard
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Set Player_Count = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
-------- Set Up Title bar and row 1 --------
Multiboard - Create a multiboard with 4 columns and (1 + Player_Count) rows, titled |cffFF0000Destiny R...
Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to |cffffcc00Player Na...
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to |cffff0000Kills|r:
-------- Now set the Sizes for the first row, AND our player rows. --------
For each (Integer A) from 1 to (1 + Player_Count), do (Actions)
Loop - Actions
Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 4, row (Integer A) to Show text and Hide icons
Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 1.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 10.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 5.50% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 2.00% of the total screen width
-------- Quickly change the top row to hide that icon.... --------
Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
-------- DEFINE PLAYERS ON THE BOARD --------
-------- List defines the spots on the board, the rows. Starts at second row. --------
Set List = 2
Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Actions)
Loop - Actions
-------- Mutiboard_Spots keeps track of which row a player has been put on. It is an integer array. --------
Set Multiboard_Spots[(Player number of (Picked player))] = List
-------- Setup the Icons --------
Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNArthas.blp
-------- Setup the Text for eatch coloum/row --------
Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
-------- Set Life of players in start --------
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Owner of (Picked unit)) Equal to Player 1 (Red)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 2 (Blue)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 3 (Teal)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 4 (Purple)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 6 (Orange)) and (((Picked unit) is A Hero) Equal to True)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to ((String((Integer((Percentage life of (Picked unit)))))) + %)
Else - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Set the text for (Last created multiboard) item in column 4, row List to 0
Set List = (List + 1)
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Show (Last created multiboard)
Tally Score
Events
Unit - A unit Dies
Conditions
((Owner of (Killing unit)) controller) Equal to User
Actions
Set Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Kill_Count[(Player number of (Owner of (Killing unit)))]))
Player Attacked
Events
Unit - A unit Is attacked
Conditions
((Owner of (Attacked unit)) controller) Equal to User
Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Attacked unit)))] to ((String((Integer((Percentage life of (Attacked unit)))))) + %)
Define Colors
Events
Map initialization
Conditions
Actions
Set Player_Colors[1] = |c00ff0000
Set Player_Colors[2] = |c000000ff
Set Player_Colors[3] = |c0000ffff
Set Player_Colors[4] = |c00800080
Set Player_Colors[5] = |c00ffff00
Set Player_Colors[6] = |c00ff8000
Player hp update
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Owner of (Picked unit)) Equal to Player 1 (Red)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 2 (Blue)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 3 (Teal)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 4 (Purple)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 6 (Orange)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to ((String((Integer((Percentage life of (Picked unit)))))) + %)
Else - Actions
VARIABLES
List - Integer - 0 (Default)
Multiboard_Spots - Integer - Array (1) - 0 (default)
Player_Count - Integer - 0 (default)
Player_Colors - string - array (1) - None
Here is the trigger I have tried to use for the player leaves.
Player leaves
Events
Player - Player 1 (Red) leaves the game
Player - Player 2 (Blue) leaves the game
Player - Player 3 (Teal) leaves the game
Player - Player 4 (Purple) leaves the game
Player - Player 5 (Yellow) leaves the game
Player - Player 6 (Orange) leaves the game
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) slot status) Equal to Has left the game
Then - Actions
Unit - Remove (Picked unit) from the game
Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver.
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver
Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver
Else - Actions
Multiboard - Show (Last created multiboard)
If anyone can find out what i did wrong to the trigger so when ppl leave thier units and name on leaderboard is removed / renamed, I will be very very happy.
Im getting a migraine from trying to get it to work :banghead: :banghead:
Here is the ENTIRE Multiboard code, and the variables to go with it.
Create Multiboard
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Set Player_Count = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
-------- Set Up Title bar and row 1 --------
Multiboard - Create a multiboard with 4 columns and (1 + Player_Count) rows, titled |cffFF0000Destiny R...
Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to |cffffcc00Player Na...
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to |cffff0000Kills|r:
-------- Now set the Sizes for the first row, AND our player rows. --------
For each (Integer A) from 1 to (1 + Player_Count), do (Actions)
Loop - Actions
Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
Multiboard - Set the display style for (Last created multiboard) item in column 4, row (Integer A) to Show text and Hide icons
Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 1.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 10.00% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 5.50% of the total screen width
Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 2.00% of the total screen width
-------- Quickly change the top row to hide that icon.... --------
Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
-------- DEFINE PLAYERS ON THE BOARD --------
-------- List defines the spots on the board, the rows. Starts at second row. --------
Set List = 2
Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Actions)
Loop - Actions
-------- Mutiboard_Spots keeps track of which row a player has been put on. It is an integer array. --------
Set Multiboard_Spots[(Player number of (Picked player))] = List
-------- Setup the Icons --------
Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNArthas.blp
-------- Setup the Text for eatch coloum/row --------
Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
-------- Set Life of players in start --------
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Owner of (Picked unit)) Equal to Player 1 (Red)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 2 (Blue)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 3 (Teal)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 4 (Purple)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and (((Picked unit) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 6 (Orange)) and (((Picked unit) is A Hero) Equal to True)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to ((String((Integer((Percentage life of (Picked unit)))))) + %)
Else - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Set the text for (Last created multiboard) item in column 4, row List to 0
Set List = (List + 1)
Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to |cffff0000Health|r
Multiboard - Show (Last created multiboard)
Tally Score
Events
Unit - A unit Dies
Conditions
((Owner of (Killing unit)) controller) Equal to User
Actions
Set Kill_Count[(Player number of (Owner of (Killing unit)))] = (Kill_Count[(Player number of (Owner of (Killing unit)))] + 1)
Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Kill_Count[(Player number of (Owner of (Killing unit)))]))
Player Attacked
Events
Unit - A unit Is attacked
Conditions
((Owner of (Attacked unit)) controller) Equal to User
Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Attacked unit)))] to ((String((Integer((Percentage life of (Attacked unit)))))) + %)
Define Colors
Events
Map initialization
Conditions
Actions
Set Player_Colors[1] = |c00ff0000
Set Player_Colors[2] = |c000000ff
Set Player_Colors[3] = |c0000ffff
Set Player_Colors[4] = |c00800080
Set Player_Colors[5] = |c00ffff00
Set Player_Colors[6] = |c00ff8000
Player hp update
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Owner of (Picked unit)) Equal to Player 1 (Red)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 2 (Blue)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 3 (Teal)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 4 (Purple)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 5 (Yellow)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
((Owner of (Picked unit)) Equal to Player 6 (Orange)) and (((Unit-type of (Picked unit)) is A Hero) Equal to True)
Then - Actions
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to ((String((Integer((Percentage life of (Picked unit)))))) + %)
Else - Actions
VARIABLES
List - Integer - 0 (Default)
Multiboard_Spots - Integer - Array (1) - 0 (default)
Player_Count - Integer - 0 (default)
Player_Colors - string - array (1) - None
Here is the trigger I have tried to use for the player leaves.
Player leaves
Events
Player - Player 1 (Red) leaves the game
Player - Player 2 (Blue) leaves the game
Player - Player 3 (Teal) leaves the game
Player - Player 4 (Purple) leaves the game
Player - Player 5 (Yellow) leaves the game
Player - Player 6 (Orange) leaves the game
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) slot status) Equal to Has left the game
Then - Actions
Unit - Remove (Picked unit) from the game
Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver.
Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver
Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Picked unit)))] to Leaver
Else - Actions
Multiboard - Show (Last created multiboard)
If anyone can find out what i did wrong to the trigger so when ppl leave thier units and name on leaderboard is removed / renamed, I will be very very happy.
Im getting a migraine from trying to get it to work :banghead: :banghead:


