• 🏆 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!

[JASS] Multiboard wont show!

Status
Not open for further replies.
Level 11
Joined
Apr 6, 2008
Messages
760
Why the hell wont the multiboard show?!?!

JASS:
struct Multiboard extends array [9]
multiboard Board

    static method onInit takes nothing returns nothing
        local integer Index = 0

        loop
             exitwhen Index >= 9
          
             set Multiboard[Index].Board = CreateMultiboard()

             //Seting Row and Column things

             if GetLocalPlayer() == Player(Index) then
                 call MultiboardDisplay(Multiboard[Index].Board,true)
             endif

             set Index = Index + 1
        endloop

    endmethod

endstruct
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
I don't know why you make this more complicated than it needs to be...

JASS:
scope mb initializer i
    globals
        private multiboard array mb
    endglobals
    
    private function i takes nothing returns nothing
        local integer index=0
        loop
            exitwhen index>8
            set mb[index]=CreateMultiboard()
            //Setting Row and Column things
            if GetLocalPlayer()==Player(index) then
                call MultiboardDisplay(mb[index],true)
            endif
            set index=index+1
        endloop
    endfunction
endscope
 
Level 4
Joined
Nov 23, 2007
Messages
113
AFAIK, Multiboards can only be displayed after the game has started. Create a timer that fires 0.00 seconds after game start, then call MultiboardDisplay().
 
Level 11
Joined
Apr 6, 2008
Messages
760
Thx for that it will show now but, i have some problems other problem.

The multiboard just shows up empty with eyes even thou i set the style to not show icons, and i wont display the value i gave it either ^^

JASS:
library Multiboard

globals
    public timer Time = CreateTimer()
endglobals

struct Multiboard extends array [9]
multiboard Board
    
    static method onInit takes nothing returns nothing
        call TimerStart(Time,0.0,false,function thistype.AfterInit)
    endmethod
    
    static method AfterInit takes nothing returns nothing
        local integer Index = 0
        local integer Int
        local multiboarditem MItem
        local real x = GetStartLocationX(0)
        local real y = GetStartLocationY(0)
        
        loop
            exitwhen Index >= 1
            
            set PlayerHero[0] = CreateUnit(Player(0),'H008',x,y,0)
            
            set Int = GetHeroInt(PlayerHero[Index],true)
            
            set Multiboard[Index].Board = CreateMultiboard()
            
            call MultiboardSetTitleText(Multiboard[Index].Board,"Board")
            
            call MultiboardSetRowCount(Multiboard[Index].Board,2)
            call MultiboardSetColumnCount(Multiboard[Index].Board,3)
            
            call MultiboardSetItemsWidth(Multiboard[Index].Board,0.10)
            //Row 1
            set MItem = MultiboardGetItem(Multiboard[Index].Board,1,1)
            call MultiboardSetItemStyle(MItem,false,true)
            call MultiboardSetItemIcon(MItem,"ReplaceableTextures\\CommandButtons\\BTNRune of Mending.blp")
            call MultiboardReleaseItem(MItem)
            
            set MItem = MultiboardGetItem(Multiboard[Index].Board,1,2)
            call MultiboardSetItemStyle(MItem,true,false)
            call MultiboardSetItemValue(MItem,"Waterbolt")
            call MultiboardReleaseItem(MItem)
            
            set MItem = MultiboardGetItem(Multiboard[Index].Board,1,3)
            call MultiboardSetItemStyle(MItem,true,false)
            
            call MultiboardSetItemValue(MItem,R2S(Int*WaterBolt_Multiply))
            call MultiboardReleaseItem(MItem)
            //End
            
            if GetLocalPlayer() == Player(Index) then
                call MultiboardDisplay(Multiboard[Index].Board,true)
            endif
            
            
            set Index = Index + 1
        endloop
        
        call TimerStart(Time,0.5,true,function thistype.Update)
        
    endmethod
    
    static method Update takes nothing returns nothing
        local integer Index = 0
        local integer Int
        local multiboarditem MItem
        
        loop
            exitwhen Index >= 1
            
            set Int = GetHeroInt(PlayerHero[Index],true)
            
            //Row 1
            set MItem = MultiboardGetItem(Multiboard[Index].Board,1,3)
            call MultiboardSetItemValue(MItem,R2S(Int*WaterBolt_Multiply))
            call MultiboardReleaseItem(MItem)
            //End
            
            set Index = Index + 1
        endloop
        
    endmethod
        
endstruct

endlibrary

nvm i found the problem, i did like first the first row i did count as 1 when that GUI that do that way it should be 0.
 
Status
Not open for further replies.
Top