• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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