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

Variable Assigned Units not Recognized

Status
Not open for further replies.
Level 6
Joined
Sep 11, 2006
Messages
172
Hello again,

I'm starting to have strange problems with my map. My older triggers are recognizing variable assigned units when the units set them off, but my new triggers don't seem to recognize these same units.

For Example:

  • Exit
    • Events
      • Unit - A unit leaves Region 058 <gen>
    • Conditions
      • ((Triggering unit) is in (Units in Region 059 <gen>)) Equal to True
    • Actions
      • If ((Triggering unit) Equal to Survivor[1]) then do (Set Outside[1] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[2]) then do (Set Outside[2] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[3]) then do (Set Outside[3] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[4]) then do (Set Outside[4] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[5]) then do (Set Outside[5] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[6]) then do (Set Outside[6] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[7]) then do (Set Outside[7] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[8]) then do (Set Outside[8] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[9]) then do (Set Outside[9] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[10]) then do (Set Outside[10] = True) else do (Do nothing)
      • If ((Triggering unit) Equal to Survivor[11]) then do (Set Outside[11] = True) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[1]
        • Then - Actions
          • If (TheThing[1] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[1] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[2]
        • Then - Actions
          • If (TheThing[2] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[2] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[3]
        • Then - Actions
          • If (TheThing[3] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[3] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[4]
        • Then - Actions
          • If (TheThing[4] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[4] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[5]
        • Then - Actions
          • If (TheThing[5] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[5] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[6]
        • Then - Actions
          • If (TheThing[6] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[6] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[7]
        • Then - Actions
          • If (TheThing[7] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[7] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[8]
        • Then - Actions
          • If (TheThing[8] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[8] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[9]
        • Then - Actions
          • If (TheThing[9] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[9] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[10]
        • Then - Actions
          • If (TheThing[10] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[10] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Thing[11]
        • Then - Actions
          • If (TheThing[11] Equal to Player 1 (Red)) then do (Set Outside[1] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 2 (Blue)) then do (Set Outside[2] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 3 (Teal)) then do (Set Outside[3] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 4 (Purple)) then do (Set Outside[4] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 5 (Yellow)) then do (Set Outside[5] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 6 (Orange)) then do (Set Outside[6] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 7 (Green)) then do (Set Outside[7] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 8 (Pink)) then do (Set Outside[8] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 9 (Gray)) then do (Set Outside[9] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 10 (Light Blue)) then do (Set Outside[10] = True) else do (Do nothing)
          • If (TheThing[11] Equal to Player 11 (Dark Green)) then do (Set Outside[11] = True) else do (Do nothing)
        • Else - Actions
          • Do nothing
This is an older trigger that works and recognizes the variable assigned unit that is entering the region.

But...

  • Transformation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burst Out
    • Actions
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Casting unit) Equal to Thing[1]
        • Then - Actions
          • Special Effect - Destroy Burst_Effects[1]
          • Special Effect - Destroy Burst_Effects[2]
          • Special Effect - Destroy Burst_Effects[3]
          • Special Effect - Destroy Burst_Effects[4]
          • Special Effect - Destroy Burst_Effects[5]
          • Special Effect - Destroy Burst_Effects[6]
          • Special Effect - Destroy Burst_Effects[7]
          • Set Temp_Point[20] = (Position of Thing[1])
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
          • Set Burst_Effects[1] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Set Burst_Effects[2] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
          • Set Burst_Effects[3] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\Human\HumanBlood\HumanBloodLarge0.mdl
          • Set Burst_Effects[4] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
          • Set Burst_Effects[5] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\NightElf\NightElfBlood\NightElfBloodDruidoftheClaw.mdl
          • Set Burst_Effects[6] = (Last created special effect)
          • Special Effect - Create a special effect at Temp_Point[20] using Objects\Spawnmodels\NightElf\NightElfBlood\NightElfBloodDruidoftheClaw.mdl
          • Unit - Move Thing[1] instantly to (Center of ThingTrans <gen>), facing (Facing of Thing[1]) degrees
          • Unit - Move Assimilator 0109 <gen> instantly to Temp_Point[20], facing (Facing of Thing[1]) degrees
          • Unit - Change ownership of Assimilator 0109 <gen> to Player 12 (Brown) and Retain color
          • Unit - Change ownership of Thing[1] to Neutral Passive and Retain color
          • Custom script: call RemoveLocation (udg_Temp_Point[20])
          • Wait 1.20 seconds
          • Special Effect - Destroy Burst_Effects[1]
          • Special Effect - Destroy Burst_Effects[2]
          • Special Effect - Destroy Burst_Effects[3]
          • Special Effect - Destroy Burst_Effects[4]
          • Special Effect - Destroy Burst_Effects[5]
          • Special Effect - Destroy Burst_Effects[6]
          • Special Effect - Destroy Burst_Effects[7]
        • Else - Actions
          • Do nothing
This is a new trigger that does not work. The casting unit is not recognized and the trigger does not fire. Any ideas why this is happening?
 
Level 6
Joined
Sep 11, 2006
Messages
172
Ok, it seems that whenever i set a variable to a unit, that unit doesn't get assigned even though i told it to. This is happening on all my triggers that use set variable for a unit. They are not getting set anymore. Any ideas why this might be happening?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
You can assign 2 variables to 1 unit.

It sounds like you are hitting the op limit for map initialization. When that happens, it results in many variables not being initialized correctly. The end result are triggers not working (no events attached etc), variables with no value (never set) and a whole lot of problems.

Only fixes are to use fewer triggers, less globals (avoid setting global array size as that is opperation heavy and usless for most types) or to switch to JASS where you can break your code down more efficently.
 
When using multiple If\Then\Elses with a similar condition, you can put them in another's Else section like this:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Triggering unit) Equal to Thing[1]
      • Then - Actions
        • -------- actions --------
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Triggering unit) Equal to Thing[2]
          • Then - Actions
            • -------- actions --------
          • Else - Actions
            • -------- etc. etc. --------
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
why did you add this to the FIRST and the LAST trigger???...

  • Special Effect - Destroy Burst_Effects[1]
  • Special Effect - Destroy Burst_Effects[2]
  • Special Effect - Destroy Burst_Effects[3]
  • Special Effect - Destroy Burst_Effects[4]
  • Special Effect - Destroy Burst_Effects[5]
  • Special Effect - Destroy Burst_Effects[6]
  • Special Effect - Destroy Burst_Effects[7]
 
Status
Not open for further replies.
Top