- Joined
- Jun 7, 2008
- Messages
- 440
I have a couple questions. It seems that I have no idea why this is returning "0" :
Now, I also checked the function of this:
Im afraid I have NO idea what transpired here. I wanted to make it so that it would go to column 2 and row (udg_row) but I have no idea how to convert it in this function above. Any help on this would be much appreciated.
JASS:
function Trig_Spawn_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer i = GetUnitPointValue(u)
local real x
local real y
set udg_Income[GetPlayerId(p)] = ( udg_Income[GetPlayerId(p)] + i)
call MultiboardSetItemValueBJ( bj_lastCreatedMultiboard , 2, udg_row [GetPlayerId(p)], I2S(udg_Income[GetPlayerId(p)]) )
set udg_NextLine = GetPlayerId(p)
set x = (GetRandomReal(GetRectMinX(udg_EndRegion[udg_NextLine]), GetRectMaxX(udg_EndRegion[udg_NextLine])))
set y = (GetRandomReal(GetRectMinY(udg_EndRegion[udg_NextLine]), GetRectMaxY(udg_EndRegion[udg_NextLine])))
call SetUnitPosition (u, x,y)
set u = null
set p = null
endfunction
Now, I also checked the function of this:
JASS:
call MultiboardSetItemValueBJ( bj_lastCreatedMultiboard , 2, udg_row [GetPlayerId(p)], I2S(udg_Income[GetPlayerId(p)]) )
JASS:
function MultiboardSetItemValueBJ takes multiboard mb, integer col, integer row, string val returns nothing
local integer curRow = 0
local integer curCol = 0
local integer numRows = MultiboardGetRowCount(mb)
local integer numCols = MultiboardGetColumnCount(mb)
local multiboarditem mbitem = null
// Loop over rows, using 1-based index
loop
set curRow = curRow + 1
exitwhen curRow > numRows
// Apply setting to the requested row, or all rows (if row is 0)
if (row == 0 or row == curRow) then
// Loop over columns, using 1-based index
set curCol = 0
loop
set curCol = curCol + 1
exitwhen curCol > numCols
// Apply setting to the requested column, or all columns (if col is 0)
if (col == 0 or col == curCol) then
set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
call MultiboardSetItemValue(mbitem, val)
call MultiboardReleaseItem(mbitem)
endif
endloop
endif
endloop
endfunction
Im afraid I have NO idea what transpired here. I wanted to make it so that it would go to column 2 and row (udg_row) but I have no idea how to convert it in this function above. Any help on this would be much appreciated.