Dryvnt
New Member
- Reaction score
- 10
How do i make arrays in vJASS? (Or just JASS in general)
I need this for a WIP system
I need this for a WIP system
local type array name
globals
type array name
endglobals
That depends on what you was about to sayOops. Misread the code. Curses!
globals
real array wut
endglobals
function Harh takes nothing returns nothing
local integer lol
set wut[0] = 1
set wut[1] = 2
set wut[2] = 3
loop
exitwhen lol > 2
call BJDebugMsg(R2S(wut[lol]))
set lol = lol + 1
endloop
endfunction
//===========================================================================
function Test takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( trig, 1.00)
call TriggerAddAction( trig, function Harh )
endfunction
function Harh takes nothing returns nothing
local integer lol = 0
local integer array wut
set wut[0] = 1
set wut[1] = 2
set wut[2] = 3
loop
exitwhen lol > 2
call BJDebugMsg(I2S(wut[lol]))
set lol = lol + 1
endloop
endfunction
//===========================================================================
function Test takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterPlayerEvent(trig, Player(0) ,EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction( trig, function Harh )
endfunction
scope MyScope initializer Test
function Harh takes nothing returns nothing
local integer lol = 0
local integer array wut
set wut[0] = 1
set wut[1] = 2
set wut[2] = 3
loop
exitwhen lol > 2
call BJDebugMsg(I2S(wut[lol]))
set lol = lol + 1
endloop
endfunction
//===========================================================================
function Test takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterPlayerEvent(trig, Player(0) ,EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction( trig, function Harh )
endfunction
endscope
Off topic: I thought I would be able to buy your silenceBy any chance, did you originally have the keyword 'array' before the type? ... Oh, and you bumped my rep up drastically.