• 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.

Integer A array variable removal

Status
Not open for further replies.
Level 12
Joined
Jun 28, 2008
Messages
688
How do I remove a Loop Integer A variable with custom script?
  • Custom script: call RemoveLocation(udg_Radius[(Integer A)])
Obviously that does not work, so what do I put after the name of the variable to remove it?

This problem is causing an ability to leak 18 locations every 0.1 seconds, so help would be greatly appreciated.
 
Level 6
Joined
Sep 13, 2008
Messages
261
For anyone to fix this I'm pretty sure you're gonna have to post the whole trigger.

But in most cases all you have to do is make a Global variable integer and start at 1 and add to it 1 for each loop. Then put it in for variable A. in like that
  • Custom script: call RemoveLocation(udg_Radius[(GlobalInteger)])
 
Level 12
Joined
Jun 28, 2008
Messages
688
Thanks Dr Super Good.

And @howl2000, this is my trigger, I was trying to figure out how to remove a variable with an Integer A array value.

  • Effect1
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Angle[(Integer A)] Less than or equal to 360.00
            • Then - Actions
              • Set Angle[(Integer A)] = (Angle[(Integer A)] + 5.00)
            • Else - Actions
              • Set Angle[(Integer A)] = 0.00
          • Set Radius[(Integer A)] = (RoDCPoint offset by 500.00 towards Angle[(Integer A)] degrees)
          • Special Effect - Create a special effect at Radius[(Integer A)] using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
          • Set lcspfx = (Last created special effect)
          • Custom script: call DestroyEffect(udg_lcspfx)
          • Custom script: call RemoveLocation(udg_Radius[bj_forLoopAIndex])
      • Set RoDRaPoint = (RoDCPoint offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)
      • Special Effect - Create a special effect at RoDRaPoint using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
      • Set lcspfx = (Last created special effect)
      • Custom script: call DestroyEffect(udg_lcspfx)
      • Custom script: call RemoveLocation(udg_RoDRaPoint)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 500.00 of RoDCPoint matching ((Matching unit) Not equal to RoDCaster)) and do (Actions)
        • Loop - Actions
          • Unit - Cause RoDCaster to damage (Picked unit), dealing (((Max life of (Picked unit)) x 0.10) x 0.03) damage of attack type Spells and damage type Normal
 
Level 6
Joined
Sep 13, 2008
Messages
261
Just fill in Dr. Supergood's code he knows what he is talking about 100% of the times ive seen him post.
 
Status
Not open for further replies.
Top