"Advanced" Multiboard trouble

Fulla

Evil Overlord
Reaction score
31
Basically im trying to create a Multiboard only as big as necessary.

So if there are
- 5 players, it has 5 rows
- 10 players, it has 10 rows.

At same time having KILLS // DEATHS in each players Row.

So I needed to create a trigger that would register players to a "Player_Slot" for the Multiboard.

i.e.
- Player 1 is playing = Row 1
- Player 2 not playing = Do Nothing
- Player 3 is playing = Row 2
- Player 4 is playing = Row 3
- Player 5 is playing = Row 4
- Player 6 not playing = Do Nothing
etc. etc.

Code:
Actions
    Set tempinteger = 1
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Player((Integer A))) slot status) Equal to Is playing
                Then - Actions
                    Set Player_Slot[(Integer A)] = tempinteger
                    Set tempinteger = (tempinteger + 1)
                Else - Actions

The Problem is, when I now go to change a players Kills // Deaths, with
(Sorry combo of GUI / JASS)

Code:
    local player kp = GetOwningPlayer(GetKillingUnit())
    local integer f1 = GetConvertedPlayerId(kp)

    set udg_Player_Kills[f1] = udg_Player_Kills[f1] + 1
    call MultiboardSetItemValueBJ(udg_Multiboard, 2, udg_Player_Slot[f1], I2S(udg_Player_Kills[f1]))

So what happens? EVERY slot in Column 2 becomes that value? (Kills Column).

I really have no idea :-(
 

Chocobo

White-Flower
Reaction score
409
Code:
    local player kp = GetOwningPlayer(GetKillingUnit())

    local integer f1 = GetConvertedPlayerId(kp)



    set udg_Player_Kills[f1] = udg_Player_Kills[f1] + 1

    call MultiboardSetItemValueBJ(udg_Multiboard, 2, udg_Player_Slot[f1], I2S(udg_Player_Kills[f1]))

I would like to read this :p

What did you intend?


Code:
Actions
    Set tempinteger = 1
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Player((Integer A))) slot status) Equal to Is playing
                Then - Actions
                       If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                     (Player((Integer A)) Equal to (Owner of (Killing unit))
                              Then - Actions
                                      Set tempinteger = (Integer A)
                              Else - Actions
                Else - Actions
Custom Script :     call MultiboardSetItemValueBJ(udg_Multiboard, 2, tempinteger, I2S(udg_Player_Kills[f1]))
 

Chocobo

White-Flower
Reaction score
409
Simply to >>>

A player kills another player (Hero kills Hero)
Set the Player Kills of the Killing player = + 1

Then alter multiboard to show this.

Chocobo said:
What did you intend...

..about setting the value in a wrong row?


- Player 1 is playing = Row 1
- Player 2 not playing = Do Nothing
- Player 3 is playing = Row 2
- Player 4 is playing = Row 3
- Player 5 is playing = Row 4
- Player 6 not playing = Do Nothing

Kills (example : P3 kills someone) :
Code:
Actions
    Set tempinteger = 0
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Player((Integer A))) slot status) Equal to Is playing
                Then - Actions
                    Set tempinteger = (tempinteger + 1)
                       If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                     (Player((Integer A)) Equal to (Owner of (Killing unit))
                              Then - Actions
                                      [B][U]Teh ACTIONS you want[/U][/B]
                                      Custom Script :     call MultiboardSetItemValueBJ(udg_Multiboard, 2, tempinteger, I2S(udg_Player_Kills[f1]))
                                       Skip Remaining Actions
                              Else - Actions
                Else - Actions

(Integer A) loop :
-> P1 : First condition true, second false
-> P2 : First condition false
-> P3 : First condition true, second true, teh ACTIONS you want, custom script, skip remaining actions


Y, I wrote a bit fast, and I forget +1.
 

Fulla

Evil Overlord
Reaction score
31
Ah ok, seem I wasnt to clear in first post.
The first part, allocates players to their rows, once its done its done.

Only the part im concerned with is altering the board, for the players Kills.

Once the board has been setup, it should be some thing like this>
if ONLY Player 1 / 3 / 5 / 7 are playing>>
Player_Slot[1] = 1
Player_Slot[3] = 2
Player_Slot[5] = 3
Player_Slot[7] = 4

Now assuming that worked, I can alter the multiboard when a player gets a kill.

Code:
    local player kp = GetOwningPlayer(GetKillingUnit())
    local integer f1 = GetConvertedPlayerId(kp)

    set udg_Player_Kills[f1] = udg_Player_Kills[f1] + 1
    call MultiboardSetItemValueBJ(udg_Multiboard, 2, udg_Player_Slot[f1], I2S(udg_Player_Kills[f1]))

So its NOT necessary to re-check which players are playing etc. each time, simply by using udg_Player_Slot it should auto allocate the correct row.

BUT instead, whenever I sued udg_Player_Slot every single figure in that colum becomes that value.

So e.g. Player 1 gets a kill, No other players have a kill.
it SHOULD become>> (Ignoring Deaths)

Code:
Players            Kills               Deaths
Player 1            1                     0
Player 2            0                     0
Player 3            0                     0
etc.

but INSTEAD, it screws up and this happens

Code:
Players            Kills                Deaths
Player 1            1                     0
Player 2            1                     0
Player 3            1                     0
etc.

My only assumption can be the first part, (allocating Player_Slots) somehow screws up
 

Chocobo

White-Flower
Reaction score
409
Code:
Players            Kills               Deaths
Player 1            1                     0
Player 2            0                     0
Player 3            0                     0
etc.

You said :

Fulla said:
So if there are
- 5 players, it has 5 rows
- 10 players, it has 10 rows.


But :

Code:
Players            Kills               Deaths           - Row 1
Player 1            1                     0           - Row 2
Player 2            0                     0           - Row 3
Player 3            0                     0           - Row 4
etc.

:p ;)

Code:
Actions
    Set tempinteger = 1
    For each (Integer A) from 1 to 12, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Player((Integer A))) slot status) Equal to Is playing
                Then - Actions
                    [B]Set Player_Slot[(Integer A)] = (tempinteger + 1)[/B]
                    Set tempinteger = (tempinteger + 1)
                Else - Actions

Code:
    set udg_Player_Kills[GetPlayerId(GetOwningPlayer(GetKillingUnit())) + 1] = udg_Player_Kills[GetPlayerId(GetOwningPlayer(GetKillingUnit())) + 1] + 1
    call MultiboardSetItemValueBJ(udg_Multiboard, 2, udg_Player_Slot[GetPlayerId(GetOwningPlayer(GetKillingUnit())) + 1], I2S(udg_Player_Kills[GetPlayerId(GetOwningPlayer(GetKillingUnit())) + 1]))

Should work.
 
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