- Joined
- Oct 12, 2007
- Messages
- 148
well i have some question regarding to this turtorial im reading ... i posted questions withing that thread/turtorial but no1 answered it lol so i decided to ask it here :3
im reading http://www.hiveworkshop.com/forums/...als-280/beginning-jass-tutorial-series-30765/
lesson 2
i dont know wat *multi-instanceability* is ... does it mean exectue several actions at once? ... and what's the difference between actions and function? i mean they both perform ... an action. I'm kindda stuck on lesson 2 been reading it for couple hours and my brain hurts so i decided to ask
and im gonna list a few more questions i got
1)
2)
i have a lot more questions but plz answer these 1st so i can continue
ty
im reading http://www.hiveworkshop.com/forums/...als-280/beginning-jass-tutorial-series-30765/
lesson 2
What is the difference between Local and Global variables?
-Local variables are variables only usable by the function they’re declared in. These are used for cleaning Memory Leaks (which will be explained later), neatening code, and making script Multi-instanceable.
-Globals are variables which can be accessed by any function, but can also be changed by any function. This can be bad for multi-instanceability (which will now be referred to as MUI), depending. MUI will be discussed later on.
i dont know wat *multi-instanceability* is ... does it mean exectue several actions at once? ... and what's the difference between actions and function? i mean they both perform ... an action. I'm kindda stuck on lesson 2 been reading it for couple hours and my brain hurts so i decided to ask
and im gonna list a few more questions i got
1)
which of these is the variable? is it the *unit*? or is it the *u*? and what does it mean when u set *local unit u = createunit()*? does it mean there will be a unit created and this created unit's name is *u*? sorry i just never had a single programing class all my lifeHow do I create a local variable?
-There are two ways to creating/setting a variable.
function variable_test takes nothing returns nothing
local unit u = CreateUnit()
endfunction
This method creates and sets it in one line, at the beginning of the function.
2)
uhm... whats this *…..*? is it the name of a unit (after u press ctr+d? cuz i didn't see any number or non-letter-symbols when i pressed ctr+d. like pally is Hpal)?function variable_test takes nothing returns nothing
local unit u
set u = CreateUnit(…..) //Creates a unit and sets the variable to it
endfunction
And this method creates a blank variable, to be set later on in the function.
i have a lot more questions but plz answer these 1st so i can continue
ty