• 🏆 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!

Irritating Array Leak

Status
Not open for further replies.
Level 4
Joined
May 6, 2007
Messages
87
Hey, guys.

I get an error when I attempt to compile this code. I'm not sure how to get the custom script to work; removing udg_creep_location[array_position] doesn't seem to work.

  • Creep Respawn
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Wendigo 0087 <gen>
          • (Triggering unit) Equal to Wendigo 0085 <gen>
          • (Triggering unit) Equal to Ancient Wendigo 0084 <gen>
          • (Triggering unit) Equal to Wendigo 0086 <gen>
          • (Triggering unit) Equal to Murloc Huntsman 0143 <gen>
          • (Triggering unit) Equal to Murloc Tiderunner 0145 <gen>
          • (Triggering unit) Equal to Murloc Nightcrawler 0142 <gen>
          • (Triggering unit) Equal to Murloc Huntsman 0144 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0120 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0328 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0326 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0119 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0298 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0296 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0325 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0323 <gen>
          • (Triggering unit) Equal to Ice Troll Trapper 0118 <gen>
    • Actions
      • Set Creep_Location[(Custom value of (Dying unit))] = (Position of (Dying unit))
      • Wait 30.00 seconds
      • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at Creep_Location[(Custom value of (Dying unit))] facing Default building facing degrees
      • Set Array_Position = (Custom value of (Dying unit))
      • Custom script: call RemoveLocation(udg_Creep_Location[Array_Position])
Any ideas?

Thanks for your time.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
it is really easy. you put a udg_ prefix before Creep_Location, because it is global.
Array_Position is also a global, why do you not put a udg_ prefix there?
That was your mistake ;)
EVERY global made with GUI needs the udg_ prefix when accesed in Custom script
 
Status
Not open for further replies.
Top