• 🏆 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] MultiboardQuestion~

Status
Not open for further replies.
Level 6
Joined
Oct 14, 2010
Messages
58
h1ho)

Thinking how to make 12 multiboards for each player arose one idea: to make one multiboard, and variables to make soo (Will change in my multiboard is only title):


JASS:
function settitleForPlayer takes nothing returns nothing
    local integer i = 0
    loop
        exitwhen i > 11
        if GetLocalPlayer() == Player(udg_PlayerInAction) then
            if udg_Game_Seconds >= 10 then
                call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[i]) + (I2S(udg_LeaderboardDeaths[i]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + ( ":" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
            else
                call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[i]) + (I2S(udg_LeaderboardDeaths[i]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + (":0" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
            endif
        endif
        set i = i + 1
    endloop
endfunction
function InitTrig_qd takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerAddAction(t, function settitleForPlayer)
    set t = null
endfunction

its possible?

thanks
sorry for my bad English
 
Level 6
Joined
Oct 14, 2010
Messages
58
You have no event which triggers settitleForPlayer. Do you want it to happen ten seconds into the game? The best way is with a timer.

function settitleForPlayer will work for one player or for all players?

event, condition etc of InitTrig_qd function are not important in this question(I'll do this later).

update:
JASS:
function SetTitleMb takes player itgPlayer, integer j returns nothing
    if GetLocalPlayer() == Player(itgPlayer) then
        if udg_Game_Seconds >= 10 then
            call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[j]) + (I2S(udg_LeaderboardDeaths[j]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + ( ":" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
        else
            call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[j]) + (I2S(udg_LeaderboardDeaths[j]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + (":0" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
        endif
    endif // function SetTitleMb will work for one player or for all players?
endfunction

thanks for answer)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Ofcourse it is possible, you just have to make sure the multiboarditem retrevial and release is done for all players and you must update the text to a value based on localplayer.

Your current method will overwrite the text for everyone else as you do it for each player (due to the else clause).
 
Level 6
Joined
Oct 14, 2010
Messages
58
Your current method will overwrite the text for everyone else as you do it for each player (due to the else clause).

else clause doesn't exist in condition "GetLocalPlayer() == Player(itgPlayer)"

if you mean it else:
JASS:
      if udg_Game_Seconds >= 10 then // other if 
            call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[j]) + (I2S(udg_LeaderboardDeaths[j]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + ( ":" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
      else // it?
            call MultiboardSetTitleText(udg_mb, "bbMaynheMapMbTitle " + (I2S(udg_LeaderboardKills[j]) + (I2S(udg_LeaderboardDeaths[j]) + " |c00C0C0C0" ) ) ) + ( I2S(udg_Game_Minutes) + (":0" + ( I2S(udg_Game_Seconds) + "|r" ) ) )
      endif
I think hardly it somehow will not affect it, right?
thx for answer Dr.

To do as I has written in my last message? if it no soo, please, send example (+rep for example)
 
Level 6
Joined
Oct 14, 2010
Messages
58
I did it

Jass code of test trigger for those who are interested:
JASS:
function TitleForPlayer takes integer q returns nothing // General
    local string s = "TextDisplay" + I2S(udg_aaMbTemp)
    if GetLocalPlayer()==Player(q) then
        call MultiboardSetTitleText(udg_Newmb,s)
    endif
    set s = null
endfunction
function SetStartLov takes nothing returns nothing
    local integer q
    set q = S2I(SubString(GetEventPlayerChatString(), 3, 4))
    set udg_aaMbTemp = udg_aaMbTemp + 1
    if q >= 0 and q < 11 then //bj_style ;D
        call TitleForPlayer(q)
    endif
endfunction
function InitTrig_Test takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerChatEvent(t, Player(0), "-gg", false)
    call TriggerRegisterPlayerChatEvent(t, Player(1), "-gg", false)
    call TriggerRegisterPlayerChatEvent(t, Player(2), "-gg", false)
    call TriggerRegisterPlayerChatEvent(t, Player(3), "-gg", false)
    call TriggerAddAction(t, function SetStartLov)
    set t = null
endfunction

Didn't think that it so easily, I is surprised that y'all don't write true answer=)

and(I will use it in other triggers): Than global variable is better to replace? (for example I mean a udg_aaMbTemp variable)
 
Status
Not open for further replies.
Top