Suppose I where to create this:
Would the private global variable be MUI?
2 units of different players die at the same time, is the same private global variable used?
Does this mean that MUI keeps increasing for each time a unit dies for every player, or is MUI reset?
Suppose I where to make a spell with more private global variables, would this method be safe to use or should I use a different approach?
(I finally found some time to start on working with vJass so I'm still kind of new. I do however have experience in other programming languages and know enough about OOP.
Which means my learning curve will probably improve with the right explanations.)
JASS:
scope derp initializer init
globals
private integer MUI = 0
endglobals
private function doSomething takes nothing returns nothing
set MUI = MUI + 1
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i>11
call TriggerRegisterPlayerUnitEvent(t, Player(i), 'EVENT_PLAYER_UNIT_DEATH', null)
set i = i + 1
endloop
call TriggerAddAction(t, function doSomething)
set t = null
endfunction
endscope
Would the private global variable be MUI?
2 units of different players die at the same time, is the same private global variable used?
Does this mean that MUI keeps increasing for each time a unit dies for every player, or is MUI reset?
Suppose I where to make a spell with more private global variables, would this method be safe to use or should I use a different approach?
(I finally found some time to start on working with vJass so I'm still kind of new. I do however have experience in other programming languages and know enough about OOP.
Which means my learning curve will probably improve with the right explanations.)