• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Custom script, get unit variable

Status
Not open for further replies.
Heya.

I use this custom script when I want to add Locust to a unit.
  • Custom script: call UnitAddAbility( GetSpellTargetUnit(), 'Aloc' )
It works.

I have a case where I need to add Locust to a stored unit.
uChest_Unit_Buffer <- unit variable

I get an error when saving this:
  • Custom script: call UnitAddAbility( GetuChest_Unit_Buffer(), 'Aloc' )

What do type when I want to use the unit variable instead of target of ability?
 
To use GUI generated globals in custom script, simply put "udg_" before the variable name:

uChest_Unit_Buffer ---> udg_uChest_Unit_Buffer

Hm yeah. It's just that I have actually tried that already and I still get the error.
Before you write "are you sure the variable is called that", yes it is ;)

Edit:
The error says "undeclared function".
Does that mean it thinks I didn't set the uChest_Unit_Buffer anywhere?
Because I do that as well.
 
Status
Not open for further replies.
Top