• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Combat Multiboard System v1.02 [vJASS]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This system creates a multiboard that can (uptil now) support 2 teams.

The difference between this system and others on this site is the fact that
this system creates a very compact multiboard that leaves no empty slots.

It gives:
*Kills
*Deaths
*Hero Level
*Kills/Deaths Display in the title
*Team Kills/Deaths
*Player Gold display to ALL players (I

The code:
JASS:
library Multiboard initializer Init
//____________________________________________________________________
//                                                                    |
//                 Combat Multiboard System v1.02                     |
//                       by Magtheridon96                             |
//                                                                    |
//                        Copyright 2011                              |
//                                                                    |
//                        Coded in vJASS                              |
//                        [GUI Friendly]                              |
//                                                                    |
//                     www.hiveworkshop.com                           |
//____________________________________________________________________|
//                                                                    |
//    There are many multiboard systems on the hive like this one,    |
//  but this particular system stands out before all of them due to:  |
//                                                                    |
//      - The fact that this is written in vJass                      |
//      - It doesn't leave empty slots in the multiboard              |
//      - It's GUI Friendly                                           |
//      - It's not too complicated                                    |
//      - No Crap ^^                                                  |
//                                                                    |
//____________________________________________________________________|
//                                                                    |
//                            Changelog                               |
//                                                                    |
//    *** v1.00 ***                                                   |
//    Uploaded - First Release                                        |
//                                                                    |
//    *** v1.00b ***                                                  |
//    Removed one local variable                                      |
//                                                                    |
//    *** v1.01 ***                                                   |
//    Rewrote some parts of the system.                               |
//    It's now much more efficient and slightly shorter.              |
//                                                                    |
//    *** v1.02 ***                                                   |
//    Fixed a major bug                                               |
//    Added a Gold feature                                            |
//    Gave an ingame screenshot                                       |
//    Make GUI Implementation 10x easier :)                           |
//    Major Improvements :D                                           |
//                                                                    |
//____________________________________________________________________|
//                                                                    |
//                 Why should you use my system?                      |
//                                                                    |
//    My system has several pros and maybe a few cons, but it's       |
//  an overall "sufficient :p" system.                                |
//                                                                    |
//    PROS:                                                           |
//    - I'm not providing you with crap                               |
//      like HP bars and stuff that would affect                      |
//      visuals :)                                                    |
//    - No empty slots                                                |
//    - Compact Multiboards                                           |
//    - Efficiency ... i think                                        |
//    - MPI :D                                                        |
//                                                                    |
//    CONS:                                                           |
//    - I used 6 BJs :(                                               |
//    - Some people might want more features in                       |
//      a Multiboard, but it's all just crap to                       |
//      me, so I just gave you a Multiboard with                      |
//      the essentials :) (You might not like this :P)                |
//    - The update function is Overkill >.<                           |
//____________________________________________________________________|
//                                                                    |
//                        Implementation:                             |
//                                                                    |
//    *** Create a new trigger                                        |
//    *** Convert it to custom text                                   |
//    *** Paste all the contents of this trigger into it              |
//    *** Go to the "runtextmacro" line at the end of the code        |
//    *** Insert your variable names there :)                         |
//    *** Enjoy ^^                                                    |
//____________________________________________________________________|
    globals
    
        // CONFIGURABLES
        
        // The multiboard colors:
        private constant    string                  LeftColor   = "|cff080808"
        private constant    string                  KillsColor  = "|cffff0000"
        private constant    string                  DeathsColor = "|cff0036ff"
        private constant    string                  LevelsColor = "|cffa7a7a7"
        private constant    string                  GoldColor   = "|cffffcc00"
        // The Multiboard texts:
        private constant    string                  GAMETITLE   = "|cffffcc00Multiboard System v1.02 by Magtheridon96|r" // Also Optional, but you'll have to edit the code
        private constant    string                  MISCTITLE   = "" // This text will appear in column 0 row 0. (Column 1 Row 1 if you're a GUIer ;p) It is highly optional
        // The team names:
        private constant    string                  Name1       = "|cffffcc00Team 1|r"
        private constant    string                  Name2       = "|cffffcc00Team 2|r"
        // Integer Constants:
        private constant    integer                 MaxPlayers  = 12 // Will not function properly if this isn't an even number
        
        // NOTE: This may not function properly if the maximum number of players on 
        // the first team is not the same as the number of players on the second team.
        // If your game is for 4 players for example, if it's a 1v3 game, this won't function properly :)
        
        
        // END OF CONFIGURABLES
        
        
        // The multiboard
        private             multiboard array        MB
        // A multipurpose temporary integer
        private             integer                 Tempint
        // An integer used for the loop in the update function
        private             integer                 int
        // The multiboard title(s)
        private             string                  MBtitle
        // The number of columns
        private constant    integer                 Cols        = 5 // Not Configurable
        // The number or rows (Do not touch)
        private             integer                 Rows
        // Two constants used for readability
        private constant    playerslotstate         left        = PLAYER_SLOT_STATE_LEFT
        private constant    playerslotstate         playing     = PLAYER_SLOT_STATE_PLAYING
        // Used for "local" reduction
        private             playerslotstate array   pss
    endglobals
    
    // I need the following function because for some strange reason, 
    // GetPlayers() isn't working :/
    
    private function GetNumberPlayers takes nothing returns integer
        local integer i = 0
        local integer n = 0
        loop
            exitwhen i > MaxPlayers-1
            if GetPlayerSlotState(Player(i))==playing then
                set n = n + 1
            endif
            set i = i + 1
        endloop
        return n
    endfunction
    
    // DO NOT EDIT WITHIN THIS TEXTMACRO
    
    //! textmacro SYSTEMCODE takes k, d, l, c, g, tk, td
        // Used for code size reduction
        // It is used to evaluate each player's stats and update 
        // his values
        private function Pf takes player p returns nothing
            local playerslotstate ps = GetPlayerSlotState(p)
            local string pn = GetPlayerName(p)
            local integer i = GetPlayerId(p)
            local multiboarditem mbi1
            local multiboarditem mbi2
            local multiboarditem mbi3
            local multiboarditem mbi4
            local multiboarditem mbi5
            
            set Tempint = Tempint + 1
            
            set mbi1 = MultiboardGetItem(MB[int], Tempint, 0)
            set mbi2 = MultiboardGetItem(MB[int], Tempint, 1)
            set mbi3 = MultiboardGetItem(MB[int], Tempint, 2)
            set mbi4 = MultiboardGetItem(MB[int], Tempint, 3)
            set mbi5 = MultiboardGetItem(MB[int], Tempint, 4)
            
            if ps == left then
                call MultiboardSetItemValue(mbi1, LeftColor + pn + "|r")
                call MultiboardSetItemValue(mbi2, LevelsColor + I2S(udg_$l$[i+1]+1) + "|r")
                call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_$k$[i+1]) + "|r")
                call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_$d$[i+1]) + "|r")
                call MultiboardSetItemValue(mbi5, GoldColor + I2S(udg_$g$[i+1]) + "|r")
            else
                call MultiboardSetItemValue(mbi1, udg_$c$[i+1] + pn + "|r")
                call MultiboardSetItemValue(mbi2, LevelsColor + I2S(udg_$l$[i+1]+1) + "|r")
                call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_$k$[i+1]) + "|r")
                call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_$d$[i+1]) + "|r")
                call MultiboardSetItemValue(mbi5, GoldColor + I2S(udg_$g$[i+1]) + "|r")
            endif
            
            call MultiboardReleaseItem(mbi1)
            call MultiboardReleaseItem(mbi2)
            call MultiboardReleaseItem(mbi3)
            call MultiboardReleaseItem(mbi4)
            call MultiboardReleaseItem(mbi5)
            
            set ps = null
            set mbi1 = null
            set mbi2 = null
            set mbi3 = null
            set mbi4 = null
            set mbi5 = null
        endfunction
        
        // CREATE MULTIBOARD FUNCTION
        //
        // This function is called at 0.01 seconds of gametime.
        // You don't need to call it :)
        
        private function CreateMB takes nothing returns nothing
            local integer i = 1
            local integer index = 0
            local multiboarditem tmbi
            local string s1
            local string s2
            
            loop
                exitwhen i > MaxPlayers
                set pss[i] = GetPlayerSlotState(Player(i-1))
                set i = i + 1
            endloop
            
            set int = 0
            loop
                exitwhen int > MaxPlayers
                set int = int + 1
                set MB[int] = CreateMultiboard()
                call MultiboardClear(MB[int])
                set s1 = I2S(udg_$k$[int])
                set s2 = I2S(udg_$d$[int])
                call MultiboardSetTitleText(MB[int], "|cffaaaaaa" + s1 + "/" + s2 + "|r - " + GAMETITLE)
                call MultiboardSetColumnCount(MB[int], Cols)
                call MultiboardSetRowCount(MB[int], GetNumberPlayers()+4)
                set tmbi = MultiboardGetItem(MB[int], 0, 0)
                call MultiboardSetItemValue(tmbi, MISCTITLE)
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 0, 1)
                call MultiboardSetItemValue(tmbi, LevelsColor + "L|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 0, 2)
                call MultiboardSetItemValue(tmbi, KillsColor + "K|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 0, 3)
                call MultiboardSetItemValue(tmbi, DeathsColor + "D|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 0, 4)
                call MultiboardSetItemValue(tmbi, GoldColor + "G|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 1, 0)
                call MultiboardSetItemValue(tmbi, Name1)
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 1, 2)
                call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], 1, 3)
                call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
                call MultiboardReleaseItem(tmbi)
                set Tempint = 1
                loop
                    exitwhen index > MaxPlayers/2 - 1
                    if pss[index+1] == playing or pss[index+1] == left then
                        call Pf(Player(index))
                    endif
                    set index = index + 1
                endloop
                set Tempint = Tempint + 2
                set tmbi = MultiboardGetItem(MB[int], Tempint, 0)
                call MultiboardSetItemValue(tmbi, Name2)
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
                call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
                call MultiboardReleaseItem(tmbi)
                set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
                call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
                call MultiboardReleaseItem(tmbi)
                loop
                    exitwhen index > MaxPlayers - 1
                    if pss[index+1] == playing or pss[index+1] == left then
                        call Pf(Player(index))
                    endif
                    set index = index + 1
                endloop
                // I'm ashamed :(
                call MultiboardSetItemStyleBJ(MB[int], 0, 0, true, false)
                call MultiboardSetItemWidthBJ(MB[int], 1, 0, 12.25)
                call MultiboardSetItemWidthBJ(MB[int], 2, 0, 3.00)
                call MultiboardSetItemWidthBJ(MB[int], 3, 0, 3.00)
                call MultiboardSetItemWidthBJ(MB[int], 4, 0, 3.00)
                call MultiboardSetItemWidthBJ(MB[int], 5, 0, 3.00)
                if GetLocalPlayer() == Player(int-1) then
                    call MultiboardDisplay(MB[int], true)
                endif
                set index = 0
            endloop
            set tmbi = null
        endfunction
        
        // This function is used to update the multiboard COMPLETELY
        // If you want to update something specific, use the alternate functions below
        function UpMB takes nothing returns nothing
            local integer i = 1
            local integer index = 0
            local multiboarditem tmbi
            local string s1
            local string s2
            
            loop
                exitwhen i > MaxPlayers
                set pss[i] = GetPlayerSlotState(Player(i-1))
                set i = i + 1
            endloop
            
            set int = 0
            loop
                exitwhen int > MaxPlayers
                set int = int + 1
                set s1 = I2S(udg_$k$[int])
                set s2 = I2S(udg_$d$[int])
                call MultiboardSetTitleText(MB[int], "|cffaaaaaa" + s1 + "/" + s2 + "|r - " + GAMETITLE)
                set udg_$tk$[1] = udg_$k$[1] + udg_$k$[2] + udg_$k$[3] + udg_$k$[4] + udg_$k$[5]
                set tmbi = MultiboardGetItem(MB[int], 1, 2)
                call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_$tk$[1]) + "|r")
                call MultiboardReleaseItem(tmbi)
                set udg_$td$[1] = udg_$d$[1] + udg_$d$[2] + udg_$d$[3] + udg_$d$[4] + udg_$d$[5]
                set tmbi = MultiboardGetItem(MB[int], 1, 3)
                call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_$td$[1]) + "|r")
                call MultiboardReleaseItem(tmbi)
                set Tempint = 1
                loop
                    exitwhen index > MaxPlayers/2 - 1
                    if pss[index+1] == playing or pss[index+1] == left then
                        call Pf(Player(index))
                    endif
                    set index = index + 1
                endloop
                set Tempint = Tempint + 2
                set udg_$tk$[2] = udg_$k$[6] + udg_$k$[7] + udg_$k$[8] + udg_$k$[9] + udg_$k$[10]
                set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
                call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_$tk$[2]) + "|r")
                call MultiboardReleaseItem(tmbi)
                set udg_$td$[2] = udg_$d$[6] + udg_$d$[7] + udg_$d$[8] + udg_$d$[9] + udg_$d$[10]
                set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
                call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_$td$[2]) + "|r")
                call MultiboardReleaseItem(tmbi)
                loop
                    exitwhen index > MaxPlayers - 1
                    if pss[index+1] == playing or pss[index+1] == left then
                        call Pf(Player(index))
                    endif
                    set index = index + 1
                endloop
                set index = 0
            endloop
            set tmbi = null
        endfunction
    //! endtextmacro
    
    //  !!!  A T T E N T I O N   A L L   G U I E R S  !!!
    // THIS IS YOUR CONFIGURATION LINE:
    // You're supposed to put the variable names in GUI
    
    //                              KILLS          DEATHS          LEVELS          COLORS         GOLD       TEAM KILLS   TEAM DEATHS
    //! runtextmacro SYSTEMCODE("PlayerKills", "PlayerDeaths", "PlayerLevels", "PlayerColors", "PlayerGold", "TeamKills", "TeamDeaths")
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, 0.01, false)
        call TriggerAddAction(t, function CreateMB)
    endfunction
endlibrary
[/HIDDEN]

I accept constructive critisism, so feel free to comment, flame, steal, claim yours, kill me, ...
I don't care.

Most importantly and paradoxical with the above statement:

GIVE CREDITS IF USED


PS: This system is GUI friendly (sort of), so i included it in the GUI section too.

[highlight]UPDATE:[/code]
*Fixed some major bugs x)
*Added a screenshot
*Redid some parts of the system
*Made it 10x more GUI Friendly than it was in v1.01 ^^
*A more powerful Multiboard :D

[highlight]UPDATE:[/code]
*Gave a better screenshot.

If you can't see the thumbnail of this screenshot in the spells section, then clear your cache :)

Keywords:
Multiboard, AoS, Hero, Arena, Kills, Magtheridon96, vJASS, JASS, System, combat, system, board, score, leaderboard, status, stats, player, DotA
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 12 Nov 2011 Bribe: Your initializer is fine as a library initializer, however creating a trigger for the timer is quite unnecessary, you just need a normal timer here. You configuration...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.


12 Nov 2011
Bribe: Your initializer is fine as a library initializer, however creating a trigger for the timer is quite unnecessary, you just need a normal timer here.

You configuration should be at the top of the script (running a textmacro above its declaration is fine).
 
Level 4
Joined
Feb 28, 2011
Messages
37
Hi,
looks already good but there are some things, that you can improve:

You should write all constants in upper case letters. It's just good programming style.

I would split the configuration part from the part that shouldn't be changed. Make it more clear.

You should null every local handle like players. I also think multiboarditems should be nulled.

In function Pf you don't need local player pl = p. Just use p instead of pl.

All constant like p1b shouldn't be constants. Check them yourself, so the part when you do this:
JASS:
            if p1b == true then
                if p1 == playing or p1 == left then
                    call Pf(p1p)
                endif
            endif
should be faster. One time a player isn't playing or left, change it to false.

You can use the 0-index of the MB-array so you can set set int = int + 1 to the end of the loop and you can change Player(int-1) to Player(int)
 
Level 11
Joined
Sep 30, 2009
Messages
697
JASS:
        local playerslotstate p1 = GetPlayerSlotState(p1p)
        local playerslotstate p2 = GetPlayerSlotState(p2p)
        local playerslotstate p3 = GetPlayerSlotState(p3p)
        local playerslotstate p4 = GetPlayerSlotState(p4p)
        local playerslotstate p5 = GetPlayerSlotState(p5p)
        local playerslotstate p6 = GetPlayerSlotState(p6p)
        local playerslotstate p7 = GetPlayerSlotState(p7p)
        local playerslotstate p8 = GetPlayerSlotState(p8p)
        local playerslotstate p9 = GetPlayerSlotState(p9p)
        local playerslotstate p10 = GetPlayerSlotState(p10p)
        local playerslotstate p11 = GetPlayerSlotState(p11p)
        local playerslotstate p12 = GetPlayerSlotState(p12p)
and
JASS:
            if p1b == true then
                if p1 == playing or p1 == left then
                    call Pf(p1p)
                endif
            endif
            
            if p2b == true then
                if p2 == playing or p2 == left then
                    call Pf(p2p)
                endif
            endif
            
            if p3b == true then
                if p3 == playing or p3 == left then
                    call Pf(p3p)
                endif
            endif 
            
            if p4b == true then
                if p4 == playing or p4 == left then
                    call Pf(p4p)
                endif
            endif
            
            if p5b == true then
                if p5 == playing or p5 == left then
                    call Pf(p5p)
                endif
            endif
            
            if p6b == true then
                if p6 == playing or p6 == left then
                    call Pf(p6p)
                endif
            endif

You must be kiddin me use an global array here instead and loop through each player instead of creating so much variables.


  • You are only using only the library and globals features of vJass. This should be done with jass only so it doesn't require JNGP.
  • You are creating a new global for each player and a boolean for the, what kind of makes no sense just use Player(x) instead. Same goes for the booleans use a boolean array here.
So I think this could be done way more efficient and powerful. You really need to improve this a bit more.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
It looks like this could be useful for you
http://www.hiveworkshop.com/forums/jass-functions-413/system-playermanager-142554/

edit
Also, your update function is just overkill... when I update a multiboard, I update the 1 specific value that needs to be updated and I run the updates through the actual triggers.

I honestly thing that the best multiboard system you can write is just an OO multiboard like the one at TH. Having a getup like this just isn't a good idea =).
 
Last edited:
While trying to fix this system, I've been having some problems.

The multiboard won't display in-game D:
What could be the problem??

Here's the code:

JASS:
library MB initializer InitMB
    //___________________________________________________________________
    //                                                                   |
    //                    Multiboard System v1.00                        |
    //                       by Magtheridon96                            |
    //                                                                   |
    //                        Coded in vJASS                             |
    //                        [GUI Friendly]                             |
    //                                                                   |
    //                     [url]www.hiveworkshop.com[/url]                          |
    //___________________________________________________________________|
    //                                                                   |
    //    There are many multiboard systems on the hive like this one,   |
    //  but this particular system stands out before all of them due to: |
    //                                                                   |
    //      - The fact that this is written in vJass                     |
    //      - It doesn't leave empty slots in the multiboard             |
    //      - Currently it can only work for 2 teams because             |
    //        allowing it to function for more than 2 teams              |
    //        (configurable), would ruin efficiency. If you              |
    //        want an efficient version that works for any               |
    //        other number of teams, just ask ;)                         |
    //      - It's efficient (I think..)                                 |
    //      - It's short (CODE is roughly 350 lines)                     |
    //      - It's GUI friendly :D ... Sort of                           |
    //      - It's easily configurable                                   |
    //      - It's not the kind of Multiboard system you'd               |
    //        want to completely change to fit your map :D               |
    //        ... That i can only hope :P                                |
    //      - It's leakless :D                                           |
    //                                                                   |
    //___________________________________________________________________|
    //                                                                |
    //                            Changelog                           |
    //                                                                |
    //    *** v1.00 ***                                               |
    //    Uploaded - First Release                                    |
    //                                                                |
    //    *** v1.00b ***                                              |
    //    Removed one local                                           |
    //                                                                |
    //    *** v1.01 ***                                               |
    //    Merged some code blocks into one loop                       |
    //    and fixed a few issues with efficiency.                     |
    //________________________________________________________________|
    //                                                                |
    //                 Why should you use my system?                  |
    //                                                                |
    //    My system has several pros and maybe a few cons, but it's   |
    //  an overall "sufficient :p" system.                            |
    //                                                                |
    //    PROS:                                                       |
    //    - I'm not providing you with crap                           |
    //      like HP bars and stuff.                                   |
    //    - I'm giving you a multiboard system                        |
    //      that can handle all 12 players and                        |
    //      any combination of the 12 among 2                         |
    //      teams. The reason why I'm not giving                      |
    //      you a system that has configurable                        |
    //      teams is because it would lead me to                      |
    //      use "3rd dimmensional" loops. I think                     |
    //      giving a seperate system for each number                  |
    //      of players per team would be MUCH more                    |
    //      efficient. If you need me to make a                       |
    //      version of this system for 3 or 4 teams,                  |
    //      I wouldn't say no ;)                                      |
    //    - No empty slots                                            |
    //    - Compact Multiboards                                       |
    //    - Efficiency ... i think                                    |
    //                                                                |
    //    CONS:                                                       |
    //    - I used 4 BJs :(                                           |
    //    - Some people might want more features in                   |
    //      a Multiboard, but it's all just crap to                   |
    //      me, so I just gave you a Multiboard with                  |
    //      the essentials :) (You might not like this :P)            |
    //________________________________________________________________|
    //
    globals
        //_____________________________
        //                             |
        //   Creating the multiboard   |
        //_____________________________|
        
        private multiboard array MB
        
        //_______________________________________________
        //                                               |
        //  Temporary integer for use in assigning rows  |
        //                                               |
        //_______________________________________________|
        
        private integer Tempint
        
        //____________________________________________
        //                                            |
        //  Integer used to simplify the code in loop |
        //____________________________________________|
        
        private integer int
        
        //_____________________________________________
        //                                             |
        // The title of the Multiboards vary by player |
        //_____________________________________________|
        
        private string MBtitle
        
        //_________________________________________________
        //                                                 |
        // The below three determine the multiboard colors |
        //                                                 |
        // -LeftColor:                                     |
        //                                                 |
        //      Used if a player has left the game.        |
        //                                                 |
        // -KillsColor:                                    |
        //                                                 |
        //      Used for each player's kills.              |
        //                                                 |
        // -DeathsColor:                                   |
        //                                                 |
        //      Used for each player's deaths.             |
        //                                                 |
        // -LevelColor:                                    |
        //                                                 |
        //      Used for each players heros level.         |
        //                                                 |
        // -StatsColor:                                    |
        //                                                 |
        //      This is used for displaying the number     |
        //      of kills and deaths in the title of the    |
        //      multiboard for each player.                |
        //_________________________________________________|
        
        private constant string LeftColor = "|cffa7a7a7"
        
        private constant string KillsColor = "|cffff0000"
        
        private constant string DeathsColor = "|cff0036ff"
        
        private constant string LevelColor = "|cffa7a7a7"
        
        private constant string StatsColor = "|cffaaaaaa"
        
        //____________________________
        //                            |
        // Number of Columns and Rows |
        //____________________________|
        
        private constant integer Cols = 4
        
        private constant integer Rows = GetPlayers() + 4
        
        //______________________________________
        //                                      |
        //  These 2 strings specify Team Names  |
        //_____________________________________ |
        
        private constant string Name1 = "|cffffcc00Team 1|r"
        
        private constant string Name2 = "|cffffcc00Team 2|r"
        
        //________________________________
        //                                |
        // Game Title for the multiboard  |
        //________________________________|
        
        private constant string GameName = "|cffffcc00Multiboard System v1.00|r - |cff87cefa by Magtheridon96|r"
        
        //_________________________________________________________
        //                                                         |
        //I used these 2 Player Slot States to increase readability|
        //_________________________________________________________|
        
        private constant playerslotstate left = PLAYER_SLOT_STATE_LEFT
        
        private constant playerslotstate playing = PLAYER_SLOT_STATE_PLAYING
        
        //=============================================
        //  These are the player slot states.
        //  They were used as globals because creating 
        //  a local everytime would be stupid ;)
        //=============================================
        
        private playerslotstate array pss
        
        //==========================
        //End of Global Declarations
        //==========================
    endglobals
    
    //______________________________________________________________________
    //                                                                      |
    //                         Player XX Function                           |
    //______________________________________________________________________|
    //                                                                      |
    //    This function made it possible for me to remove 1200 lines of     |
    //                                                                      |
    //                       GUI converted code :D                          |
    //______________________________________________________________________|
    
    private function Pf takes player p, playerslotstate ps returns nothing
        //Declaring locals
        local string pn = GetPlayerName(p)
        local integer i = GetPlayerId(p) + 1
        //4 temporary multiboard items that allow us to avoid the BJ function
        local multiboarditem mbi1
        local multiboarditem mbi2
        local multiboarditem mbi3
        local multiboarditem mbi4
        //End of locals
        
        set mbi1 = MultiboardGetItem(MB[int], Tempint, 0)
        set mbi2 = MultiboardGetItem(MB[int], Tempint, 1)
        set mbi3 = MultiboardGetItem(MB[int], Tempint, 2)
        set mbi4 = MultiboardGetItem(MB[int], Tempint, 3)
        
        if ps == left then
            //===================================
            //If the player has left, we display
            //his kills and deaths and we color 
            //his name grey.
            //===================================
            //===============================================================================
            //             !!!A T T E N T I O N   A L L   G U I E R S!!!
            //===============================================================================
            //
            //  YOUR MAPS OBVIOUSLY DIFFER WHEN IT COMES TO VARIABLE NAMES, SO PLEASE:
            //
            //  - Change the name: "udg_PlayerLevels[i+1]" to "udg_<your_hero_level_variable_here>[int+1]"
            //
            //  - Similarly for "udg_PlayerKills[i+1]" and "udg_PlayerDeaths[i+1]"
            //
            //  I WILL POINT OUT THE LINE NAMES WHERE YOU MUST CHANGE TO YOUR CORRESPONDING 
            //  VARIABLE NAME IN THE "GUI Configurables" SECTION OF THE DOCUMENTATION.
            //===============================================================================
            
            call MultiboardSetItemValue(mbi1, LeftColor + pn + "|r")
            call MultiboardSetItemValue(mbi2, LevelColor + I2S(udg_PlayerLevels[i] + 1) + "|r")
            call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_PlayerKills[i]) + "|r")
            call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_PlayerDeaths[i]) + "|r")
        else
            set Tempint = Tempint + 1
            //======================================
            //If the player is playing, we display 
            //his status normally on the multiboard 
            //======================================
            call MultiboardSetItemValue(mbi1, udg_PlayerColors[i] + pn + "|r")
            call MultiboardSetItemValue(mbi2, LevelColor + I2S(udg_PlayerLevels[i] + 1) + "|r")
            call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_PlayerKills[i]) + "|r")
            call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_PlayerDeaths[i]) + "|r")
        endif
        
        call MultiboardReleaseItem(mbi1) // The leak multiboard items cause is minimal, but 
        call MultiboardReleaseItem(mbi2) // this function will be firing a lot during the game, 
        call MultiboardReleaseItem(mbi3) // so destroying the leak would be best to avoid lag.
        call MultiboardReleaseItem(mbi4) // If you want, remove all the lines that Release these.
    endfunction
    
    //======================================================================
    //
    //                           Create Multiboard
    //
    //    I split up the update function and the create function so I
    //  can make it easier for you guys to understand the code since 
    //  merging them decreased readability.
    //
    //======================================================================
    
    function CreateMB takes nothing returns nothing
        local multiboarditem tmbi
        local integer i = 0
        
        loop
            exitwhen i > GetPlayers() - 1
            set pss[i] = GetPlayerSlotState(Player(i))
            set i = i + 1
        endloop
        
        loop
            exitwhen int > GetPlayers()
            set int = int + 1
            
            set MB[int] = CreateMultiboard()
            
            call MultiboardClear(MB[int])
            call MultiboardSetColumnCount(MB[int], Cols)
            call MultiboardSetRowCount(MB[int], Rows)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 1)
            call MultiboardSetItemValue(tmbi, LevelColor + "L|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "K|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "D|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 1, 0)
            call MultiboardSetItemValue(tmbi, Name1)
            call MultiboardReleaseItem(tmbi)
            
            //================================================
            
            set MBtitle = StatsColor + "0/0|r - " + GameName
            call MultiboardSetTitleText(MB[int], MBtitle)
            
            //========================================
            // We initialize Team 1 on the multiboard.
            //========================================
            
            set tmbi = MultiboardGetItem(MB[int], 1, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], 1, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = 2
            
            //======================================================================
            //
            //                             Players 1-6
            //
            //======================================================================
            
            loop
                exitwhen i > 5
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //======================================================================
            //                           Team Transition
            //======================================================================
            
            set Tempint = Tempint + 1
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 0)
            call MultiboardSetItemValue(tmbi, Name2)
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = Tempint + 1
        
            //======================================================================
            //
            //                           Players 7-12
            //
            //======================================================================
            
            set i = 6
            
            loop
                exitwhen i > 11
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //==========================================================
            //Sorry for using BJs :/
            //I dont know how to work with their natives :P
            //Setting the style of the multiboard along with 
            //Column Widths.
            call MultiboardSetItemsStyle(MB[int], true, false)
            call MultiboardSetItemWidthBJ(MB[int], 1, 0, 12.25)
            call MultiboardSetItemWidthBJ(MB[int], 2, 0, 3.00)
            call MultiboardSetItemWidthBJ(MB[int], 3, 0, 3.00)
            call MultiboardSetItemWidthBJ(MB[int], 4, 0, 3.00)
                
            if GetLocalPlayer() == Player(int-1) then
                call MultiboardDisplay(MB[int], true)
            endif
        endloop
    endfunction
    
    //======================================================================
    //
    //                           Update Multiboard
    //
    //    I split up the update function and the create function so I
    //  can make it easier for you guys to understand the code since 
    //  merging them decreased readability.
    //
    //======================================================================
    
    function UpMB takes nothing returns nothing
        local multiboarditem tmbi
        local integer i = 0
        
        loop
            exitwhen i > GetPlayers() - 1
            set pss[i] = GetPlayerSlotState(Player(i))
            set i = i + 1
        endloop
        
        set int = 0
        set i = 0
        
        loop
            //======================================================================
            //                      Fixing Up Multiboard
            //======================================================================
            exitwhen int > GetPlayers()
            
            set int = int + 1
            
            set MBtitle = StatsColor + I2S(udg_PlayerKills[int]) + "/" + I2S(udg_PlayerDeaths[int]) + "|r - " + GameName
            call MultiboardSetTitleText(MB[int], MBtitle)
            
            //========================================
            // We initialize Team 1 on the multiboard.
            //========================================
            
            set udg_TeamKills[1] = udg_PlayerKills[1] + udg_PlayerKills[2] + udg_PlayerKills[3] + udg_PlayerKills[4] + udg_PlayerKills[5] + udg_PlayerKills[6]
            set tmbi = MultiboardGetItem(MB[int], 1, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_TeamKills[1]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set udg_TeamDeaths[1] = udg_PlayerDeaths[1] + udg_PlayerDeaths[2] + udg_PlayerDeaths[3] + udg_PlayerDeaths[4] + udg_PlayerDeaths[5] + udg_PlayerDeaths[6]
            set tmbi = MultiboardGetItem(MB[int], 1, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_TeamDeaths[1]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = 2
            
            //======================================================================
            //
            //                             Players 1-6
            //
            //======================================================================
            
            loop
                exitwhen i > 5
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //======================================================================
            //                           Team Transition
            //======================================================================
            
            set Tempint = Tempint + 1
            
            set udg_TeamKills[2] = udg_PlayerKills[7] + udg_PlayerKills[8] + udg_PlayerKills[9] + udg_PlayerKills[10] + udg_PlayerKills[11] + udg_PlayerKills[12]
            set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_TeamKills[2]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set udg_TeamDeaths[2] = udg_PlayerDeaths[7] + udg_PlayerDeaths[8] + udg_PlayerDeaths[9] + udg_PlayerDeaths[10] + udg_PlayerDeaths[11] + udg_PlayerDeaths[12]
            set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_TeamDeaths[2]) + "|r")
            call MultiboardReleaseItem(tmbi)
            set Tempint = Tempint + 1
        
            //======================================================================
            //
            //                           Players 7-12
            //
            //======================================================================
            
            set i = 6
            
            loop
                exitwhen i > 11
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
        endloop
    endfunction
    
    function InitMB takes nothing returns nothing
        local trigger t
        
        set t = CreateTrigger()
        call TriggerRegisterTimerEventSingle(t, 0.01)
        call TriggerAddAction(t, function CreateMB)
        
        set t = null
    endfunction
endlibrary
 
Last edited:
[Highlight]WAR[/code]craft

NUFF siad
;)

I'll fix that and see if the system works
Thanks for the help :D

We had a math competition, and my class took 2nd place because of me among 39 other classes :D :D :D :D :D :D :D :D :D :D :D :D (10 Difficult math problems, and i solved 4 of them a lone :D) ;P



--------------------------------------------------------------------------------
EDIT:

vJASS vexes me so...

Here's the code:
I have a new problem: The players don't appear in the multiboard :(
I'm trying to fix it, but to speed up work, i need your help.

JASS:
library MB initializer InitMB
    //___________________________________________________________________
    //                                                                   |
    //                    Multiboard System v1.00                        |
    //                       by Magtheridon96                            |
    //                                                                   |
    //                        Coded in vJASS                             |
    //                        [GUI Friendly]                             |
    //                                                                   |
    //                     [url]www.hiveworkshop.com[/url]                          |
    //___________________________________________________________________|
    //                                                                   |
    //    There are many multiboard systems on the hive like this one,   |
    //  but this particular system stands out before all of them due to: |
    //                                                                   |
    //      - The fact that this is written in vJass                     |
    //      - It doesn't leave empty slots in the multiboard             |
    //      - Currently it can only work for 2 teams because             |
    //        allowing it to function for more than 2 teams              |
    //        (configurable), would ruin efficiency. If you              |
    //        want an efficient version that works for any               |
    //        other number of teams, just ask ;)                         |
    //      - It's efficient (I think..)                                 |
    //      - It's short (CODE is roughly 350 lines)                     |
    //      - It's GUI friendly :D ... Sort of                           |
    //      - It's easily configurable                                   |
    //      - It's not the kind of Multiboard system you'd               |
    //        want to completely change to fit your map :D               |
    //        ... That i can only hope :P                                |
    //      - It's leakless :D                                           |
    //                                                                   |
    //___________________________________________________________________|
    //                                                                |
    //                            Changelog                           |
    //                                                                |
    //    *** v1.00 ***                                               |
    //    Uploaded - First Release                                    |
    //                                                                |
    //    *** v1.00b ***                                              |
    //    Removed one local                                           |
    //                                                                |
    //    *** v1.01 ***                                               |
    //    Merged some code blocks into one loop                       |
    //    and fixed a few issues with efficiency.                     |
    //________________________________________________________________|
    //                                                                |
    //                 Why should you use my system?                  |
    //                                                                |
    //    My system has several pros and maybe a few cons, but it's   |
    //  an overall "sufficient :p" system.                            |
    //                                                                |
    //    PROS:                                                       |
    //    - I'm not providing you with crap                           |
    //      like HP bars and stuff.                                   |
    //    - I'm giving you a multiboard system                        |
    //      that can handle all 12 players and                        |
    //      any combination of the 12 among 2                         |
    //      teams. The reason why I'm not giving                      |
    //      you a system that has configurable                        |
    //      teams is because it would lead me to                      |
    //      use "3rd dimmensional" loops. I think                     |
    //      giving a seperate system for each number                  |
    //      of players per team would be MUCH more                    |
    //      efficient. If you need me to make a                       |
    //      version of this system for 3 or 4 teams,                  |
    //      I wouldn't say no ;)                                      |
    //    - No empty slots                                            |
    //    - Compact Multiboards                                       |
    //    - Efficiency ... i think                                    |
    //                                                                |
    //    CONS:                                                       |
    //    - I used 4 BJs :(                                           |
    //    - Some people might want more features in                   |
    //      a Multiboard, but it's all just crap to                   |
    //      me, so I just gave you a Multiboard with                  |
    //      the essentials :) (You might not like this :P)            |
    //________________________________________________________________|
    //
    globals
        //_____________________________
        //                             |
        //   Creating the multiboard   |
        //_____________________________|
        
        private multiboard array MB
        
        //_______________________________________________
        //                                               |
        //  Temporary integer for use in assigning rows  |
        //                                               |
        //_______________________________________________|
        
        private integer Tempint
        
        //____________________________________________
        //                                            |
        //  Integer used to simplify the code in loop |
        //____________________________________________|
        
        private integer int
        
        //_____________________________________________
        //                                             |
        // The title of the Multiboards vary by player |
        //_____________________________________________|
        
        private string MBtitle
        
        //_________________________________________________
        //                                                 |
        // The below three determine the multiboard colors |
        //                                                 |
        // -LeftColor:                                     |
        //                                                 |
        //      Used if a player has left the game.        |
        //                                                 |
        // -KillsColor:                                    |
        //                                                 |
        //      Used for each player's kills.              |
        //                                                 |
        // -DeathsColor:                                   |
        //                                                 |
        //      Used for each player's deaths.             |
        //                                                 |
        // -LevelColor:                                    |
        //                                                 |
        //      Used for each players heros level.         |
        //                                                 |
        // -StatsColor:                                    |
        //                                                 |
        //      This is used for displaying the number     |
        //      of kills and deaths in the title of the    |
        //      multiboard for each player.                |
        //_________________________________________________|
        
        private constant string LeftColor = "|cffa7a7a7"
        
        private constant string KillsColor = "|cffff0000"
        
        private constant string DeathsColor = "|cff0036ff"
        
        private constant string LevelColor = "|cffa7a7a7"
        
        private constant string StatsColor = "|cffaaaaaa"
        
        //____________________________
        //                            |
        // Number of Columns and Rows |
        //____________________________|
        
        private constant integer Cols = 4
        
        private constant integer Rows = GetPlayers() + 4
        
        //______________________________________
        //                                      |
        //  These 2 strings specify Team Names  |
        //_____________________________________ |
        
        private constant string Name1 = "|cffffcc00Team 1|r"
        
        private constant string Name2 = "|cffffcc00Team 2|r"
        
        //________________________________
        //                                |
        // Game Title for the multiboard  |
        //________________________________|
        
        private constant string GameName = "|cffffcc00Multiboard System v1.00|r - |cff87cefa by Magtheridon96|r"
        
        //_________________________________________________________
        //                                                         |
        //I used these 2 Player Slot States to increase readability|
        //_________________________________________________________|
        
        private constant playerslotstate left = PLAYER_SLOT_STATE_LEFT
        
        private constant playerslotstate playing = PLAYER_SLOT_STATE_PLAYING
        
        //=============================================
        //  These are the player slot states.
        //  They were used as globals because creating 
        //  a local everytime would be stupid ;)
        //=============================================
        
        private playerslotstate array pss
        
        //==========================
        //End of Global Declarations
        //==========================
    endglobals
    
    //______________________________________________________________________
    //                                                                      |
    //                         Player XX Function                           |
    //______________________________________________________________________|
    //                                                                      |
    //    This function made it possible for me to remove 1200 lines of     |
    //                                                                      |
    //                       GUI converted code :D                          |
    //______________________________________________________________________|
    
    private function Pf takes player p, playerslotstate ps returns nothing
        //Declaring locals
        local string pn = GetPlayerName(p)
        local integer i = GetPlayerId(p) + 1
        //4 temporary multiboard items that allow us to avoid the BJ function
        local multiboarditem mbi1
        local multiboarditem mbi2
        local multiboarditem mbi3
        local multiboarditem mbi4
        //End of locals
        
        set mbi1 = MultiboardGetItem(MB[int], Tempint, 0)
        set mbi2 = MultiboardGetItem(MB[int], Tempint, 1)
        set mbi3 = MultiboardGetItem(MB[int], Tempint, 2)
        set mbi4 = MultiboardGetItem(MB[int], Tempint, 3)
        
        if ps == left then
            //===================================
            //If the player has left, we display
            //his kills and deaths and we color 
            //his name grey.
            //===================================
            //===============================================================================
            //             !!!A T T E N T I O N   A L L   G U I E R S!!!
            //===============================================================================
            //
            //  YOUR MAPS OBVIOUSLY DIFFER WHEN IT COMES TO VARIABLE NAMES, SO PLEASE:
            //
            //  - Change the name: "udg_PlayerLevels[i+1]" to "udg_<your_hero_level_variable_here>[int+1]"
            //
            //  - Similarly for "udg_PlayerKills[i+1]" and "udg_PlayerDeaths[i+1]"
            //
            //  GO TO "GUI CONFIGURABLES" FOR MORE INFORMATION
            //===============================================================================
            
            call MultiboardSetItemValue(mbi1, LeftColor + pn + "|r")
            call MultiboardSetItemValue(mbi2, LevelColor + I2S(udg_PlayerLevels[i] + 1) + "|r")
            call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_PlayerKills[i]) + "|r")
            call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_PlayerDeaths[i]) + "|r")
        else
            set Tempint = Tempint + 1
            //======================================
            // If the player is playing, we display 
            // his status normally on the multiboard 
            //======================================
            call MultiboardSetItemValue(mbi1, udg_PlayerColors[i] + pn + "|r")
            call MultiboardSetItemValue(mbi2, LevelColor + I2S(udg_PlayerLevels[i] + 1) + "|r")
            call MultiboardSetItemValue(mbi3, KillsColor + I2S(udg_PlayerKills[i]) + "|r")
            call MultiboardSetItemValue(mbi4, DeathsColor + I2S(udg_PlayerDeaths[i]) + "|r")
        endif
        
        call MultiboardReleaseItem(mbi1) // The leak multiboard items cause is minimal, but 
        call MultiboardReleaseItem(mbi2) // this function will be firing a lot during the game, 
        call MultiboardReleaseItem(mbi3) // so destroying the leak would be best to avoid lag.
        call MultiboardReleaseItem(mbi4) // If you want, remove all the lines that Release these.
    endfunction
    
    //======================================================================
    //
    //                           Create Multiboard
    //
    //    I split up the update function and the create function so I
    //  can make it easier for you guys to understand the code since 
    //  merging them decreased readability.
    //
    //======================================================================
    
    function CreateMB takes nothing returns nothing
        local multiboarditem tmbi
        local integer i = 0
        
        set int = 0
        
        loop
            exitwhen i > GetPlayers() - 1
            set pss[i] = GetPlayerSlotState(Player(i))
            set i = i + 1
        endloop
        
        loop
            exitwhen int > GetPlayers()
            set int = int + 1
            
            set MB[int] = CreateMultiboard()
            
            call MultiboardClear(MB[int])
            call MultiboardSetColumnCount(MB[int], Cols)
            call MultiboardSetRowCount(MB[int], Rows)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 1)
            call MultiboardSetItemValue(tmbi, LevelColor + "L|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "K|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 0, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "D|r")
            call MultiboardReleaseItem(tmbi)
                
            //================================================
                
            set tmbi = MultiboardGetItem(MB[int], 1, 0)
            call MultiboardSetItemValue(tmbi, Name1)
            call MultiboardReleaseItem(tmbi)
            
            //================================================
            
            set MBtitle = StatsColor + "0/0|r - " + GameName
            call MultiboardSetTitleText(MB[int], MBtitle)
            
            //========================================
            // We initialize Team 1 on the multiboard.
            //========================================
            
            set tmbi = MultiboardGetItem(MB[int], 1, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], 1, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = 2
            
            //======================================================================
            //
            //                             Players 1-6
            //
            //======================================================================
            
            loop
                exitwhen i > 5 // Does each team have less players than you intended?
                //Set the above line to: exitwhen i > (Number of players in team 1) - 1
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //======================================================================
            //                           Team Transition
            //======================================================================
            
            set Tempint = Tempint + 1
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 0)
            call MultiboardSetItemValue(tmbi, Name2)
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + "0|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = Tempint + 1
        
            //======================================================================
            //
            //                           Players 7-12
            //
            //======================================================================
            
            set i = 6 // This number represents the least player
            // number of the players in team 2. Subtract 1 and you 
            // get the value that i must be set to.
            
            loop
                exitwhen i > 11 // Does each team have less players than you intended?
                //Set the above line to: exitwhen i > (Number of players in team 2) - 5
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //==========================================================
            //Sorry for using BJs :/
            //I dont know how to work with their natives :P
            //Setting the style of the multiboard along with 
            //Column Widths.
            call MultiboardSetItemsStyle(MB[int], true, false)
            call MultiboardSetItemWidthBJ(MB[int], 1, 0, 12.25)
            call MultiboardSetItemWidthBJ(MB[int], 2, 0, 3.00)
            call MultiboardSetItemWidthBJ(MB[int], 3, 0, 3.00)
            call MultiboardSetItemWidthBJ(MB[int], 4, 0, 3.00)
                
            if GetLocalPlayer() == Player(int-1) then
                call MultiboardDisplay(MB[int], true)
            endif
        endloop
    endfunction
    
    //======================================================================
    //
    //                           Update Multiboard
    //
    //    I split up the update function and the create function so I
    //  can make it easier for you guys to understand the code since 
    //  merging them decreased readability.
    //
    //======================================================================
    
    function UpMB takes nothing returns nothing
        local multiboarditem tmbi
        local integer i = 0
        
        set int = 0
        
        loop
            exitwhen i > GetPlayers() - 1
            set pss[i] = GetPlayerSlotState(Player(i))
            set i = i + 1
        endloop
        
        set i = 0
        
        loop
            //======================================================================
            //                      Fixing Up Multiboard
            //======================================================================
            exitwhen int > GetPlayers()
            
            set int = int + 1
            
            set MBtitle = StatsColor + I2S(udg_PlayerKills[int]) + "/" + I2S(udg_PlayerDeaths[int]) + "|r - " + GameName
            call MultiboardSetTitleText(MB[int], MBtitle)
            
            //========================================
            // We initialize Team 1 on the multiboard.
            //========================================
            
            set udg_TeamKills[1] = udg_PlayerKills[1] + udg_PlayerKills[2] + udg_PlayerKills[3] + udg_PlayerKills[4] + udg_PlayerKills[5] + udg_PlayerKills[6]
            set tmbi = MultiboardGetItem(MB[int], 1, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_TeamKills[1]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set udg_TeamDeaths[1] = udg_PlayerDeaths[1] + udg_PlayerDeaths[2] + udg_PlayerDeaths[3] + udg_PlayerDeaths[4] + udg_PlayerDeaths[5] + udg_PlayerDeaths[6]
            set tmbi = MultiboardGetItem(MB[int], 1, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_TeamDeaths[1]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set Tempint = 2
            
            //======================================================================
            //
            //                             Players 1-6
            //
            //======================================================================
            
            loop
                exitwhen i > 5
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
            
            //======================================================================
            //                           Team Transition
            //======================================================================
            
            set Tempint = Tempint + 1
            
            set udg_TeamKills[2] = udg_PlayerKills[7] + udg_PlayerKills[8] + udg_PlayerKills[9] + udg_PlayerKills[10] + udg_PlayerKills[11] + udg_PlayerKills[12]
            set tmbi = MultiboardGetItem(MB[int], Tempint, 2)
            call MultiboardSetItemValue(tmbi, KillsColor + I2S(udg_TeamKills[2]) + "|r")
            call MultiboardReleaseItem(tmbi)
            
            set udg_TeamDeaths[2] = udg_PlayerDeaths[7] + udg_PlayerDeaths[8] + udg_PlayerDeaths[9] + udg_PlayerDeaths[10] + udg_PlayerDeaths[11] + udg_PlayerDeaths[12]
            set tmbi = MultiboardGetItem(MB[int], Tempint, 3)
            call MultiboardSetItemValue(tmbi, DeathsColor + I2S(udg_TeamDeaths[2]) + "|r")
            call MultiboardReleaseItem(tmbi)
            set Tempint = Tempint + 1
        
            //======================================================================
            //
            //                           Players 7-12
            //
            //======================================================================
            
            set i = 6
            
            loop
                exitwhen i > 11
                if pss[i] == playing or pss[i] == left then
                    call Pf(Player(i), pss[i])
                endif
                set i = i + 1
            endloop
        endloop
    endfunction
    
    function InitMB takes nothing returns nothing
        local trigger t
        
        set t = CreateTrigger()
        call TriggerRegisterTimerEventSingle(t, 0.01)
        call TriggerAddAction(t, function CreateMB)
        
        set t = null
    endfunction
endlibrary

Please help! :( Btw, i hope i'm not giving you guys the impression that i'm stupid, it's just that i'm actually really angry now.
I guess JASS is the best way to go
:ogre_datass:


EDIT: Well, this thread is dead.
I guess i'm going to have to wait for a moderator to actually "notice" this system so i can be helped :ain: (I like to overuse this smiley :ogre_hurrhurr: Its so funny)



---------------------------------

EDIT:

UPDATED
 
Last edited:
Level 10
Joined
Apr 25, 2009
Messages
296
Works fine.


As others stated, I'd like to see some other improvements, such as:
(These are mere suggestions, don't implement all of them)

Selected unit's health & mana.
Current Gold
Current Lumber
Current Food/Cap
A score system
Number of units selected
Number of units total
Structures Total
Current number of actions (eg Unit Training, etc.)
Number of gold mines
Optimal Gold (Gold from current # of gold mines total)
Total unit health (Meaning all of the unit's health.)
Total health (" ")
Gold harvest rate
Lumber harvest rate
etc...


Simple, good for hero arenas.
 
Level 3
Joined
Nov 14, 2010
Messages
27
yea but like every jass i dont know how to import on my map :)

rating 4/5 becouse u can improve it better ...
but i still dont understand why is jass so fu****g complicate .

But good work u done it well
 
Last edited:
Level 22
Joined
Nov 14, 2008
Messages
3,256
This is not vJASS friendly as you use GUI variables in the textmacro itself and update function. Now you should make GUI function wrappers instead (will probably inline if JNGP is used) of the thing you are doing now with using GUI variables.

And yeah really the system should be able to have vJASS section which updates itself according to a death or a kill (just make those GUI functions INSIDE the code).

Also you could to make it vJASS friendly just have a few global variables that you named udg_name that are commented out in the first place so it will be easy to configure for both GUI and vJASSers.

Sorry I messed up but I had a new idea while writing this, either way great system!

EDIT:

Like this

JASS:
        /*
        private             integer array           udg_PlayerDeaths
        private             integer array           udg_PlayerGold  
        private             integer array           udg_PlayerKills   
        private             integer array           udg_PlayerLevels 
        private             integer array           udg_TeamDeaths   
        private             integer array           udg_TeamKills   
        private             string array            udg_PlayerColors */ 
    endglobals

EDIT2:

What is this? // If you want to update something specific, use the alternate functions below
 
Last edited:
What is this? // If you want to update something specific, use the alternate functions below

xD xD I was going to split the update function, but I decided not to :p
I guess I forgot to remove that comment =P

I'm updating this system since my knowledge of vJASS has .. "increased" .. since the time
I uploaded it =P

*working*
 
Top