• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

need help please!

Status
Not open for further replies.
Level 7
Joined
Jun 14, 2009
Messages
235
im not great at triggers (just learned how to use arrays :sad:) but i cannot, remember how you set a unit to be local. So a spell is MuI could anyone please help me?
 
Level 7
Joined
Jun 14, 2009
Messages
235
thank you, i wanted to make a spell that creates a dummy unit (visible), and then casts a spell targeting all units around it after about 3 seconds, but that clearly would cause it to function poorly if I don't set so each one will cast.

EDIT: i was able to set a local unit, but i need to know if i can set local variables. i tried local variable udg_Time but it didn't work, can someone help?
 
Last edited:
Level 16
Joined
Jul 21, 2008
Messages
1,121
You cannot "shade" global variables with locals anymore.

Here is changelog for newest patch:
“Shadowing” global variables with local variables no longer is possible.
• Fixed a type conversion dealing with operators (i.e. adding a handle with an integer)
• Added the ability to store hashtable handles in a hashtable
• Added getSpellTargetX and getSpellTargetY natives
• Added a new base handle type “Agent” of which many types now extend from.
• Added a SaveAgentHandle native which can be used for saving most handle types
• Added a JASS optimization dealing with global variable change events.
• Increased max map file size from 4MB to 8MB.

You can make MUI spells with hashtables. Here is tutorial: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-and-mui-133407/
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
To add to that, having udg_ in front of a variable means you're trying to refer to a global variable.

So if you have created a variable called MyUnit so that it is in the list of global variables, you can refer to it by using udg_MyUnit in a custom script.

But when you're trying to create a local variable, don't use a variable name that is already reserved for a global variable. Just write

local unit u
local integer i

and so on.
 
Status
Not open for further replies.
Top