- Joined
- Aug 9, 2006
- Messages
- 2,384
Hello, I am currently trying to make a system that saves a certain ressource to the Table 3.1 made by vexorian.
This gives me many errors in the areas where the 2D Table Array is used.
I have searched high and low in the web and I have not found a proper manual on Tables 3.1 or an tutorial.
I used the exact syntax described in the documentation of vexorian.
If someone could help me, I would really appreciate that!
JASS:
library MatrixCoreMechanic requires Table
globals
private Table tMatrixInformation
private constant integer iMaximumCore = 100
endglobals
private keyword Initialization
public keyword SetMatrixCoreForUnit
public function MatrixCoreMaxReached takes unit CoreUnit returns boolean
local integer Temp
set Temp = tMatrixInformation["TEST"][GetHandleId(CoreUnit)]
return Temp >= iMaximumCore
endfunction
public function MatrixCoreZeroReached takes unit CoreUnit returns boolean
return tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] <= 0
endfunction
public function InitMatrixCoreForUnit takes unit CoreUnit returns nothing
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = 0
endfunction
public function AddToMatrixCore takes unit CoreUnit, integer AddedSparks returns nothing
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] + AddedSparks
if MatrixCoreMaxReached(CoreUnit) then
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = iMaximumCore
endif
if MatrixCoreZeroReached(CoreUnit) then
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = 0
endif
endfunction
public function SetMatrixCore takes unit CoreUnit, integer Sparks returns nothing
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = Sparks
if MatrixCoreMaxReached(CoreUnit) then
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = iMaximumCore
endif
if MatrixCoreZeroReached(CoreUnit) then
set tMatrixInformation["Sparks"][GetHandleId(CoreUnit)] = 0
endif
endfunction
private module Initialization
private static method onInit takes nothing returns nothing
set tMatrixInformation = Table.create()
endmethod
endmodule
endlibrary
This gives me many errors in the areas where the 2D Table Array is used.
I have searched high and low in the web and I have not found a proper manual on Tables 3.1 or an tutorial.
I used the exact syntax described in the documentation of vexorian.
If someone could help me, I would really appreciate that!
Last edited by a moderator: