Multiboard Tree Tag

Visedek

New Member
Reaction score
0
Hi i'm making a Tree Tag and I want to create a MultiBoard for it, I want the multi Board to Look like this...

A row with Player Names down the side
A row after that with statusses (Alive, Dead, Kicked, Empty, Left)
A row after that with the Players ammount of gold
A row after that with the Players ammount of Wood

Can someone please create a trigger or two or something which will make this work also must auto-update. +rep for help
Please let me know If your helping me
Thanks
Txcphtm
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I might give it a try despite this is not a "Do this for me!" forum :)

I'm bored anyway

you accept vJass?

I actually never done multiboard in vJass xD

it could be a test for me
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
it will probably take 2-3 hours, but I might go off soon since it's getting late here xd

but it should be ready by tomorrow

Have no idea what Vjass is but Ill work it out

all you have to do is create a new trigger, Edit > Convert to Custom Script and copy the code into it
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
What 2-3 houres your not recreating DotA. It shoul be 1 hour max
 

HydraRancher

Truth begins in lies
Reaction score
197
Done:
Trigger:
  • Multiboard
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set PlayerGroup = (All players matching (((Matching player) controller) Equal to User))
      • Multiboard - Create a multiboard with 5 columns and ((Number of players in PlayerGroup) + 1) rows, titled Test
      • For each (Integer A) from 1 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 10.00% of the total screen width
          • For each (Integer B) from 1 to 5, do (Actions)
            • Loop - Actions
              • Multiboard - Set the display style for (Last created multiboard) item in column (Integer A), row (Integer B) to Show text and Hide icons
              • Multiboard - Set the display style for (Last created multiboard) item in column (Integer B), row (Integer A) to Show text and Hide icons
      • For each (Integer B) from 2 to 5, do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of rows in (Last created multiboard)), do (Actions)
            • Loop - Actions
              • Multiboard - Set the width for (Last created multiboard) item in column (Integer B), row (Integer A) to 10.00% of the total screen width
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Name:
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Status:
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Gold:
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Lumber:
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row (Integer A) to (Name of (Player(((Integer A) - 1))))
      • -------- Note: Variable Status is a string --------
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to Status[((Integer A) - 1)]
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row (Integer A) to (String(((Player(((Integer A) - 1))) Current gold)))
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 4, row (Integer A) to (String(((Player(((Integer A) - 1))) Current lumber)))
      • Multiboard - Hide (Last created multiboard)
      • Multiboard - Show (Last created multiboard)

Trigger:
  • Update
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to Status[((Integer A) - 1)]
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row (Integer A) to (String(((Player(((Integer A) - 1))) Current gold)))
      • For each (Integer A) from 2 to (Number of rows in (Last created multiboard)), do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 4, row (Integer A) to (String(((Player(((Integer A) - 1))) Current lumber)))


Variable "Satus" is a string, therefore you need to manually set it to things like "Dead"
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Cogratz on 1500 posts. They prefer if you could post that in a demo map.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
lol I don't care :p

it's fun I'm actually almost done (with triggers and text colors also)

just 1 thing though, there is NO way to detect if a player is kicked or am I wrong?
 

LordXavier

TH.net Regular
Reaction score
16
if there's a trigger where either Red types in -kick <color> or players vote to kick someone, then you can. Other than that, they'll just show up as Has left the game
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Unless the map has a custom kicking system no
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
can someone explain me why this crashes wc3 as soon as I press the test button?

I got no errors from JassHelper though....

JASS:
library MULTIBOARD initializer init

globals
    private multiboard board = CreateMultiboard()
    private force players = CreateForce()
    private integer PlayerCount = 0
    private string array colors
    private string array status
endglobals

private function filterFunc takes nothing returns boolean
    local player p = GetFilterPlayer()
    
    if GetPlayerController(p) == MAP_CONTROL_USER and GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
        set PlayerCount = PlayerCount + 1
    endif
    
    set p = null
    
    return false
endfunction

private function LEFT takes nothing returns nothing
    local player p = GetTriggerPlayer()
    local integer row = GetPlayerId(p) + 3
    
    call MultiboardSetItemValueBJ(board, 1, row, colors[13] + GetPlayerName(p) + &quot;|r&quot;)
    call MultiboardSetItemValueBJ(board, 2, row, colors[13] + status[2] + &quot;|r&quot;)
    
    call MultiboardSetItemValueBJ(board, 3, row, colors[13] + I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)) + &quot;|r&quot; )
    call MultiboardSetItemValueBJ(board, 4, row, colors[13] + I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER)) + &quot;|r&quot; )
    
    set p = null
endfunction

private function HeroCheck takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    
    if IsUnitType(u, UNIT_TYPE_HERO) == true and GetWidgetLife(u) &lt;= 0. then
        call MultiboardSetItemValueBJ(board, 2, GetPlayerId(p) + 3, status[1])
    else
        call MultiboardSetItemValueBJ(board, 2, GetPlayerId(p) + 3, status[0])
    endif
    
    set u = null
    set p = null
    
    return false
endfunction

private function StateSet takes nothing returns nothing
    local integer i = 0
    
    loop
        call MultiboardSetItemValueBJ(board, 3, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD)))
        call MultiboardSetItemValueBJ(board, 4, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_LUMBER)))
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
endfunction

private function init takes nothing returns nothing
    local integer i = 0
    
    //==================================================================
    
    local trigger t1 = CreateTrigger()
    local trigger t2 = CreateTrigger()
    local trigger t3 = CreateTrigger()
    local trigger t4 = CreateTrigger()
    
    call ForceEnumPlayers(players, Condition(function filterFunc))
    
    call TriggerRegisterTimerEvent(t1, 0.50, true)
    call TriggerAddAction(t1, function StateSet)
    
    call TriggerRegisterAnyUnitEventBJ(t2, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(t2, Condition(function HeroCheck))
    
    call TriggerRegisterEnterRectSimple( t3, GetPlayableMapRect())
    call TriggerAddCondition(t3, Condition(function HeroCheck))
    
    loop
        call TriggerRegisterPlayerEvent(t4, Player(i), EVENT_PLAYER_LEAVE)
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
    
    call TriggerAddAction(t4, function LEFT)
    //==================================================================
    
    set i = 0
    
    call MultiboardSetRowCount(board, PlayerCount + 2)
    call MultiboardSetColumnCount(board, 4)
    call MultiboardSetTitleText(board, &quot;Multiboard&quot;)
    call MultiboardSetItemsStyle(board, true, false)
    
    call MultiboardSetItemValueBJ(board, 1, 1, colors[12] + &quot;Player|r&quot;)
    call MultiboardSetItemValueBJ(board, 1, 2, colors[12] + &quot;Status|r&quot;)
    call MultiboardSetItemValueBJ(board, 1, 3, colors[12] + &quot;Gold|r&quot;)
    call MultiboardSetItemValueBJ(board, 1, 4, colors[12] + &quot;Wood|r&quot;)
    
    loop
        call MultiboardSetItemValueBJ(board, 1, i + 3, colors<i> + GetPlayerName(Player(i)) + &quot;|r&quot;)
        call MultiboardSetItemValueBJ(board, 2, i + 3, status[0])
        call MultiboardSetItemValueBJ(board, 3, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD)))
        call MultiboardSetItemValueBJ(board, 4, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_LUMBER)))
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
    
    set colors[0] = &quot;|cffff0000&quot;
    set colors[1] = &quot;|cff0000ff&quot;
    set colors[2] = &quot;|cff40e0d0&quot;
    set colors[3] = &quot;|cff800080&quot;
    set colors[4] = &quot;|cffffff00&quot;
    set colors[5] = &quot;|cffffa500&quot;
    set colors[6] = &quot;|cff32cd32&quot;
    set colors[7] = &quot;|cffff00ff&quot;
    set colors[8] = &quot;|cffa9a9a9&quot;
    set colors[9] = &quot;|cffadd8e6&quot;
    set colors[10] = &quot;|cff008000&quot;
    set colors[11] = &quot;|cff8b4513&quot;
    set colors[12] = &quot;|cffffd700&quot;
    set colors[13] = &quot;|cffaca899&quot;
    
    set status[0] = &quot;Alive&quot;
    set status[1] = &quot;Dead&quot;
    set status[2] = &quot;Left&quot;
endfunction

endlibrary</i>


I know it's huge, but it's all in 1 ;)
when I said 2-3 hours, I meant 1 hour for the multibaord and the next 1-2 hours on fixing bugs like this

again, this is my first attempt on making a multiboard in Jass

EDIT: just use HydraRancher's one

I'm starting to get a headache of this "Crash!" sounds-.-
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Hmm yes convert it to GUI and i have a look at it
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I've promised you that the multiboard will be ready by today and here it is:

EDIT:
JASS:
library MULTIBOARD initializer init

globals
    private multiboard board
    private force players = CreateForce()
    private integer PlayerCount = 0
    private string array colors
    private string array status
endglobals

private function filterFunc takes nothing returns boolean
    local player p = GetFilterPlayer()
    
    if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
        set PlayerCount = PlayerCount + 1
    endif
    
    set p = null
    
    return false
endfunction

function LEFT takes nothing returns nothing
    local player p = GetTriggerPlayer()
    local integer row = GetPlayerId(p) + 3
    
    call ForceRemovePlayer(players, p)
    
    call MultiboardSetItemValueBJ(board, 1, row, colors[13] + GetPlayerName(p) + &quot;|r&quot;)
    call MultiboardSetItemValueBJ(board, 2, row, colors[13] + status[2] + &quot;|r&quot;)
    
    call MultiboardSetItemValueBJ(board, 3, row, colors[13] + I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)) + &quot;|r&quot; )
    call MultiboardSetItemValueBJ(board, 4, row, colors[13] + I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER)) + &quot;|r&quot; )
    
    set p = null
endfunction

private function HeroCheck2 takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    
    if IsUnitType(u, UNIT_TYPE_HERO) == true then
        call MultiboardSetItemValueBJ(board, 2, GetPlayerId(p) + 3, status[0])
    endif
    
    set u = null
    set p = null
    
    return false
endfunction

private function HeroCheck1 takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    
    if IsUnitType(u, UNIT_TYPE_HERO) == true then
        call MultiboardSetItemValueBJ(board, 2, GetPlayerId(p) + 3, status[1])
    endif
    
    set u = null
    set p = null
    
    return false
endfunction

private function GroupPlayers takes nothing returns nothing
    local player p = GetEnumPlayer()
    
    call MultiboardSetItemValueBJ(board, 3, GetPlayerId(p) + 3, I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)))
    call MultiboardSetItemValueBJ(board, 4, GetPlayerId(p) + 3, I2S(GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER)))
    
    set p = null
endfunction

private function StateSet takes nothing returns nothing
    call ForForce(players, function GroupPlayers)
endfunction

private function start takes nothing returns nothing
    local integer i = 0
    
    //==================================================================
    
    local trigger t1 = CreateTrigger()
    local trigger t2 = CreateTrigger()
    local trigger t3 = CreateTrigger()
    local trigger t4 = CreateTrigger()
    
    call ForceEnumPlayers(players, Condition(function filterFunc))
    
    call TriggerRegisterTimerEvent(t1, 0.50, true)
    call TriggerAddAction(t1, function StateSet)
    
    call TriggerRegisterAnyUnitEventBJ(t2, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(t2, Condition(function HeroCheck1))
    
    call TriggerRegisterEnterRectSimple( t3, GetPlayableMapRect())
    call TriggerAddCondition(t3, Condition(function HeroCheck2))
    
    loop
        call TriggerRegisterPlayerEvent(t4, Player(i), EVENT_PLAYER_LEAVE)
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
    
    call TriggerAddAction(t4, function LEFT)
    //==================================================================
    
    set board = CreateMultiboard()
    set i = 0
    
    call MultiboardSetRowCount(board, PlayerCount + 2)
    call MultiboardSetColumnCount(board, 4)
    call MultiboardSetTitleText(board, &quot;Multiboard&quot;)
    call MultiboardSetItemsStyle(board, true, false)
    
    loop
        call MultiboardSetItemWidthBJ(board, 1, i, 8)
        call MultiboardSetItemWidthBJ(board, 2, i, 6)
        call MultiboardSetItemWidthBJ(board, 3, i, 6)
        call MultiboardSetItemWidthBJ(board, 4, i, 6)
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
    
    call MultiboardSetItemValueBJ(board, 1, 1, colors[12] + &quot;Player|r&quot;)
    call MultiboardSetItemValueBJ(board, 2, 1, colors[12] + &quot;Status|r&quot;)
    call MultiboardSetItemValueBJ(board, 3, 1, colors[12] + &quot;Gold|r&quot;)
    call MultiboardSetItemValueBJ(board, 4, 1, colors[12] + &quot;Wood|r&quot;)
    
    set i = 0
    loop
        call MultiboardSetItemValueBJ(board, 1, i + 3, colors<i> + GetPlayerName(Player(i)) + &quot;|r&quot;)
        call MultiboardSetItemValueBJ(board, 2, i + 3, status[0])
        call MultiboardSetItemValueBJ(board, 3, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD)))
        call MultiboardSetItemValueBJ(board, 4, i + 3, I2S(GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_LUMBER)))
        
        set i = i + 1
        exitwhen i &gt; PlayerCount
    endloop
    
    call MultiboardDisplay(board, true)
    
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    call TriggerRegisterTimerEvent(t, 0.10, false)
    call TriggerAddAction(t, function start)
    
    set colors[0] = &quot;|cffff0000&quot;
    set colors[1] = &quot;|cff0000ff&quot;
    set colors[2] = &quot;|cff40e0d0&quot;
    set colors[3] = &quot;|cff800080&quot;
    set colors[4] = &quot;|cffffff00&quot;
    set colors[5] = &quot;|cffffa500&quot;
    set colors[6] = &quot;|cff32cd32&quot;
    set colors[7] = &quot;|cffff00ff&quot;
    set colors[8] = &quot;|cffa9a9a9&quot;
    set colors[9] = &quot;|cffadd8e6&quot;
    set colors[10] = &quot;|cff008000&quot;
    set colors[11] = &quot;|cff8b4513&quot;
    set colors[12] = &quot;|cffffd700&quot;
    set colors[13] = &quot;|cffaca899&quot;
    
    set status[0] = &quot;Alive&quot;
    set status[1] = &quot;Dead&quot;
    set status[2] = &quot;Left&quot;
endfunction

endlibrary</i>


just copy this code and voila

here are some screenshots:

-after I killed a hero
10718830.jpg


-after I typed "greedisgood 1000"
16453889.jpg


-when a player leaves the game
74165644.jpg


I hope this is what you were looking for :eek:

this is a very basic multiboard
if you want I can add the Kills/Deaths counting too
 

Visedek

New Member
Reaction score
0
How do you insert that, because i copy and pasted it into a custom script trigger and It wont work...
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
It wont work

what do you mean?

you get errors when saving?
game crashes when you test it?
the mutliboard doesn't show?

do you have NewGen? :confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top