HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Local Variables

05-21-2004, 11:55 PM#1
Shimrra
What is the function to create a local variable?
05-22-2004, 12:16 AM#2
linkmaster23
custom script: local <variable type> <variable name>

Here's also a list of locals you wouldn't have dreamed thinking about... :)
05-22-2004, 12:37 AM#3
Shimrra
I'm having problems... How do I set the Owner of Unit, Target of Ability Being Cast, and Last Created Unit to a local variable?
05-22-2004, 12:52 AM#4
linkmaster23
I'll just talk to you over MSN. :)
05-22-2004, 05:39 AM#5
Xinlitik
I typed up some...
Code:
local unit u
local player p
set u = GetSpellTargetUnit() //Target Unit of Ability Being Cast

set u = GetLastCreatedUnit() //Last Created Unit

set u = GetTriggerUnit() //Triggering unit

set u = GetKillingUnit() //Killing unit

set u = GetDyingUnit() //Dying unit

set u = GetSummonedUnit() //Summoned unit

set u = GetSummoningUnit() //Summoning unit

set u = GetLearningUnit() //Hero learning a skill

set p = GetOwningPlayer(u) //Owner of "u"

Hope that helps.. just a few examples.
05-23-2004, 07:44 PM#6
Shimrra
Thank you Xinlitik. I have one more question: What is the name for a special effect variable?
05-23-2004, 07:54 PM#7
johnfn
Quote:
Originally Posted by Shimrra
Thank you Xinlitik. I have one more question: What is the name for a special effect variable?
Its just plain effect.


Like my avatar?
05-23-2004, 08:06 PM#8
Vexorian
You just have to check the top of common.j (extract scripts\common.j from mpq) there are all the types declared