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

Why NewGen bug my triggers?

Status
Not open for further replies.
I will give you an example

This is the Arcane shield ability... After I re-saved the map with NewGen this is not workingg -WTF man!!
  • Shield
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Shield
    • Actions
      • Custom script: call SetUnitPropWindow(GetTriggerUnit(), 0.0)
      • Custom script: call SetUnitTurnSpeed(GetTriggerUnit(), 0)
      • Custom script: call SetUnitMoveSpeed( GetTriggerUnit(), 0)
      • Unit - Create 1 Arcane Shield for (Owner of Archmage) at (Position of Archmage) facing 270.00 degrees
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of Archmage) matching ((Race of (Matching unit)) Equal to Human)) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Set (Picked unit) acquisition range to 0.00
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of Archmage)) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in (Units within 500.00 of (Position of Archmage))), do (Actions)
            • Loop - Actions
              • Unit - Add Banish self hero to (Picked unit)
              • Unit - Order (Picked unit) to Human Blood Mage - Banish (Picked unit)
              • Unit - Remove Banish self hero from (Picked unit)
      • Set ShieldBarrier = (Last created unit)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 15.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[1] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 30.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[2] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 45.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[3] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 60.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[4] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 75.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[5] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 90.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[6] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 105.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[7] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 120.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[8] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 135.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[9] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 150.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[10] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 165.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[11] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 180.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[11] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 195.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[12] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 210.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[13] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 225.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[13] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 240.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[14] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 255.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[15] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 270.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[16] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 285.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[17] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 300.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[18] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 315.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[19] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 330.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[20] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 345.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[21] = (Last created destructible)
      • Destructible - Create a Pathing Blocker (Both) (Large) at ((Position of Archmage) offset by 500.00 towards 360.00 degrees) facing 270.00 with scale 1.20 and variation 1
      • Set POS_DES_SHIELD[22] = (Last created destructible)
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Man, learn to use "For integer X" loops. What you have can be changed into:
Code:
Set Loc1 = Position of (Caster)
For integer (int loop_var) loop from 1 to 24 do (actions):
    Loop
        Set loc2 = Loc1 offset by 500.00 towards (Real(loop_var) * 15)
        Destructible - Create destructible at loc2
        Set POS_DES_Shield[loop_var] = Last created destructible
        Custom script: call RemoveLocation(udg_loc2)
Custom script: call RemoveLocation(udg_Loc1)

Also, in the part where you create destructibles you leak 48 locations per trigger run, you probably leak in the rest of your trigger
 
Status
Not open for further replies.
Top