• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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)
 
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