Xorifelse
I'd love to elaborate about discussions...........
- Reaction score
- 87
I've managed to use some of that bad ass LUA scripting and generate an SLK table from it. But I don't really understand how to read a SLK table in vJass.
There is little to find on how the SLK tables work, and the only example which I could find on the Internet is the one from JassHelperManual.
However, that example is broken and doesn't seem to work for me.
Can someone throw me a bone here?
And here is the SLK table:
All it does is display (null), while this is directly from the manual with a code fix. Because in the manual it's returns nothing.
There is little to find on how the SLK tables work, and the only example which I could find on the Internet is the one from JassHelperManual.
However, that example is broken and doesn't seem to work for me.
Can someone throw me a bone here?
JASS:
library fooooo
//! loaddata baarrrrr.slk
struct meh
static thistype array values
public string title
public string icon
public string question
public string answer
public integer points
public integer category
public integer difficulty
public boolean active
static method getFromKey takes integer i returns thistype
if ( .values<i> != 0 ) then
set .values<i> = thistype.create()
endif
return .values<i>
endmethod
static method onInit takes nothing returns nothing
local integer i = 0
loop
call BJDebugMsg( .getFromKey(i).title )
set i = i + 1
exitwhen i > 12
endloop
endmethod
endstruct
endlibrary</i></i></i>
And here is the SLK table:
Code:
ID;PSCALC3
C;X1;Y1;K"meh"
C;X2;Y1;K"title"
C;X3;Y1;K"icon"
C;X4;Y1;K"question"
C;X5;Y1;K"answer"
C;X6;Y1;K"points"
C;X7;Y1;K"category"
C;X8;Y1;K"difficulty"
C;X9;Y1;K"active"
C;X1;Y2;K1
C;X2;Y2;K"titel"
C;X3;Y2;K"Icoon"
C;X4;Y2;K"Vraag"
C;X5;Y2;K"antwoord"
C;X6;Y2;K1
C;X7;Y2;K1
C;X8;Y2;K1
C;X9;Y2;K1
E
All it does is display (null), while this is directly from the manual with a code fix. Because in the manual it's returns nothing.