• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Why does it say it is not declared, though it is clearly declared?

Status
Not open for further replies.
Level 6
Joined
Apr 15, 2016
Messages
118
dsa.png

It's clearly right there, the first integer with the maximum instance, and the second line of error is the current instance, upon trying to call a "removeLocation". What is the deal here?
 
I don't get it, you mean I should add "udg" in the arrays part too?
Yes, if it's a variable that you've created in the Trigger Editor then it has to have the "udg_" prefix, no exceptions.

It's how you can distinguish between variables created in the editor and variables that you've created in your code:
  • Actions
    • Set MyVariable = 1
vJASS:
globals
 integer MyVariable = 1
endglobals
Both of these can exist at the same time without interfering with one another despite having the same name. This is because the one in the trigger will be given the "udg_" prefix when it's being handled internally, if that makes sense.
 
Last edited:
Uncle wrote _udg erroneously, so to avoid confusion it is in fact udg_.

For context the game’s generated variables for things like regions, camera angles, specific units directly referred to in trigger lines use the gg_ prefix and many internal variables for more complex jass functions use bj_ as their prefix.

If you ever aren’t sure how to refer to a variable or object you can make a new trigger with a single action that references the thing and then convert that trigger to JASS (Edit > Convert to Custom Text). Then look at the line and see how the thing is referred to.
 
Status
Not open for further replies.
Back
Top