| 01-01-2007, 10:49 AM | #1 |
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. The Problem is, when I now go to change a players Kills // Deaths, with (Sorry combo of GUI / JASS) JASS:
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 :-( |
| 01-01-2007, 11:08 AM | #3 |
Sorry, - The first part was simply for setting up the Multiboard. (i.e. the layout is left as it is for rest of game) - The 2nd part was the bit used when a Player Kills another Player. |
| 01-01-2007, 11:39 AM | #4 |
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. JASS:
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 (Double Post) Sry, need to re-clarify. |
| 01-01-2007, 04:20 PM | #5 |
In JASS, the player numbers start at 0, instead of 1. That being said, I think that when you get the killing player (if it's player 1) it returns 0, but you think it would return 1. The player 0 then has a multiboard slot of 0. If you use 0 as an argument with changing multiboards, it will change all the values in the same row/column. Try change your trigger to this: try this:
local player kp = GetOwningPlayer(GetKillingUnit())
local integer f1 = GetConvertedPlayerId(kp) + 1
set udg_Player_Kills[f1] = udg_Player_Kills[f1] + 1
call MultiboardSetItemValueBJ(udg_Multiboard, 2, udg_Player_Slot[f1], I2S(udg_Player_Kills[f1])) |
| 01-01-2007, 09:33 PM | #6 |
You could be lazy and just make it so that if a player is not playing, you put a "-" or NP in their slot, for example, ___________ player |K|D| player1|3|4| player2|-|-| etc... |
