• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Set Variable to a Condition ?

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
How do i set a variable to be affected by my condition, in my case i need Hero 123... ( which is my variable ) to be instant moved to a region after they killed everything in that region, but for soem reason the neutral passive heroes gets instant moved as well. I set the heroes to be neutral passive, until one possess them / choose to play that hero

I tried to set it up so if Hero 1 is a neutral passive then Do nothing, but for some reason it wont work and i am not sure how to set my Hero Variable to Hero equal to neutral passive either

Also is there an easy way to change the Variables menu to the condition menu ?
i don't know maybe from the hashtable or something ?

  • AllUnitsAreDead
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Set tempGroup = (Units in fightRegion matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in tempGroup) Equal to 0
        • Then - Actions
          • Set tempPoint = (Center of baseRegion)
          • For each (Integer A) from 0 to 10, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                  • Do nothing
                • Else - Actions
              • Unit - Move Ian 0000 <gen> instantly to tempPoint
              • Unit - Move Malte 0001 <gen> instantly to tempPoint
              • Unit - Move Niklas 0002 <gen> instantly to tempPoint
              • Unit - Move Thomas 0004 <gen> instantly to tempPoint
              • Unit - Move Carsten 0005 <gen> instantly to tempPoint
              • Unit - Move Joe 0006 <gen> instantly to tempPoint
              • Unit - Move Echolicious 0007 <gen> instantly to tempPoint
              • Unit - Move Sam 0008 <gen> instantly to tempPoint
              • Unit - Move Alexandra 0019 <gen> instantly to tempPoint
              • Unit - Move Martin 0020 <gen> instantly to tempPoint
          • Custom script: call RemoveLocation(udg_tempPoint)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_tempGroup)
  • SettingUpVariables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set baseRegion = Carmara 2 <gen>
      • Set fightRegion = Visison 6 <gen>
      • Set hero[1] = Alexandra 0019 <gen>
      • Set hero[2] = Thomas 0004 <gen>
      • Set hero[3] = Carsten 0005 <gen>
      • Set hero[4] = Malte 0001 <gen>
      • Set hero[5] = Ian 0000 <gen>
      • Set hero[6] = Joe 0006 <gen>
      • Set hero[7] = Echolicious 0007 <gen>
      • Set hero[8] = Martin 0020 <gen>
      • Set hero[9] = Sam 0008 <gen>
      • Set hero[10] = Niklas 0002 <gen>
  • AllUnitsAreDead
    • Events
  • Passive hereos not moved
    • Events
      • Unit - A unit enters Carmara 2 <gen>
      • Unit - A unit owned by Neutral Passive Dies
    • Conditions
      • (hero[1] is in (Units in Carmara 2 <gen>)) Equal to True
      • (hero[2] is in (Units in Carmara 2 <gen> owned by Neutral Passive)) Equal to True
      • (hero[3] is in (Units in Carmara 2 <gen> owned by Neutral Passive)) Equal to True
      • (hero[10] is in (Units owned by Neutral Passive)) Equal to True
    • Actions
      • If ((Matching player) Equal to Neutral Passive) then do (Unit - Kill (Entering unit)) else do (Do nothing)
 
Level 5
Joined
Jan 5, 2019
Messages
108
sorry if these triggers doesn't make sense, they are all messy because i tried fooling around with them. any method that will stop the heroes from stop getting instant moved and who is not picked by a player will be appreciated :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
You are moving all the pre placed units 10 times in response to the area being clear. Try moving just the specific one you want moved, such as by setting it to a variable in another trigger or testing the owner of each unit if it matches you requirements.
 
Level 2
Joined
Jan 31, 2019
Messages
27
Basically you create an unit group with the heroes what you want to move. But then you move all of the heroes regardless, and not just the ones in the group.
 
Level 5
Joined
Jan 5, 2019
Messages
108
I tried to set it like this but it still doesn't work :(
i really like it so it only affects the player who is in the Fighting region

  • AllUnitsAreDead
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Set tempGroup = (Units in Fighting Region <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in tempGroup) Equal to True
          • (hero[1] is in tempGroup) Equal to True
          • (hero[2] is in tempGroup) Equal to True
          • (hero[3] is in tempGroup) Equal to True
          • (hero[4] is in tempGroup) Equal to True
        • Then - Actions
          • Set tempGroup = (Units in fightRegion matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in tempGroup) Equal to 0
              • (Number of units in tempGroup) Equal to 0
            • Then - Actions
              • Set tempPoint = (Center of baseRegion)
              • For each (Integer A) from 0 to 10, do (Actions)
                • Loop - Actions
                  • Unit - Move hero[1] instantly to tempPoint
                  • Unit - Move hero[2] instantly to tempPoint
                  • Unit - Move hero[3] instantly to tempPoint
                  • Unit - Move hero[4] instantly to tempPoint
              • Custom script: call RemoveLocation(udg_tempPoint)
            • Else - Actions
          • Custom script: call DestroyGroup(udg_tempGroup)
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top