Tar-Quaeron
New Member
- Reaction score
- 0
Hello,
I just recently learned Jass (i'm still a noob at it) and I have a few questions on Mui in Jass. So let's start from the premiss that nothing truly happens at the same time in Wc3, if you go into micro or 10^-1 micro seconds (the scale of a computer). From what I read local variables assume different values for each instance, for each triggering, of a function. But the only way to set the local variables is by using stuff like GetTriggerUnit(), GetAttacker(), GetAttackedUnit(), etc. Now apparently only GetTriggerUnit is actually a local variable? Does this mean that it is possible to get stuff mixed up if a second instance of the trigger is triggered before the 2nd line of the first instance is read and applied?
For example if we have this function that is triggered by a UNIT_PLAYER_EVENT_REGISTER_ATTACK (I can't be bothered to go look up the actual constant):
It is possible that the same trigger is triggered before the first instance of the trigger has the time to get GetAttackedUnit into before GetAttackedUnit is changed according to the second instance?
And the ingersA and B that you also have in GUI, are those local or global variables?
Thx in advance,
I just recently learned Jass (i'm still a noob at it) and I have a few questions on Mui in Jass. So let's start from the premiss that nothing truly happens at the same time in Wc3, if you go into micro or 10^-1 micro seconds (the scale of a computer). From what I read local variables assume different values for each instance, for each triggering, of a function. But the only way to set the local variables is by using stuff like GetTriggerUnit(), GetAttacker(), GetAttackedUnit(), etc. Now apparently only GetTriggerUnit is actually a local variable? Does this mean that it is possible to get stuff mixed up if a second instance of the trigger is triggered before the 2nd line of the first instance is read and applied?
For example if we have this function that is triggered by a UNIT_PLAYER_EVENT_REGISTER_ATTACK (I can't be bothered to go look up the actual constant):
JASS:
function haha takes nothing returns nothing
local unit u
if GetUnitId(GetAttacker()) == 039;h00T039;
set u = GetAttackedUnitBJ()
endif
endfunction
It is possible that the same trigger is triggered before the first instance of the trigger has the time to get GetAttackedUnit into before GetAttackedUnit is changed according to the second instance?
And the ingersA and B that you also have in GUI, are those local or global variables?
Thx in advance,