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

GUI Problem

Status
Not open for further replies.
Level 5
Joined
Aug 2, 2008
Messages
123
I have a GUI problem.
I've simplified it down a bit but this is it:

  • Events
  • Unit - A unit starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to (My Spell)
  • Actions
  • Set Position[1] = (Position of (Triggering unit))
  • Set Position[2] = (Position[1] offset by 100 towards (facing of (Triggering unit)) degrees)
  • Set Enemies[1] = Units within 80.00 of Position[2] Matching unit belongs to an enemy equal true (simplified of what I have)
  • Unit group - Pick every unit in Enemies[1] and do actions
  • Loop - Actions
  • If (all conditions are true) then do (then Actions) else do (Else Actions)
  • If - Conditions
  • ((Picked unit) is alive) Equal to true
  • Then - Actions
  • Unit cause (Triggering Unit to deal Damage to Picked unit)
  • Unit - Pause (Picked Unit)
  • Wait ## Game time seconds
  • Unit - Unpause (picked unit)
  • Else - Actions
  • Do nothing
For some reason it doesnt unpause the enemy
 
Level 1
Joined
Dec 15, 2009
Messages
8
Triggering unit is actually a "Local" value, meaning you can use it after waits. The rest is true though, you will have to store them in a variable (or, as you have done, in a unit group).
  • Spell
    • Events
    • Conditions
    • Actions
      • Set UnitGroup = (Units within 80 of Point matching (((Triggering unit) belongs to an enemy of (Owner of (Triggering Unit)) Equal to True))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
This should work unless you alter the "UnitGroup" variable in a different trigger during the wait,
 
Level 5
Joined
Aug 2, 2008
Messages
123
Using what NO.OB said I came up with this, The unit Group "Enemies" is not used in any other triggers.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    71.4 KB · Views: 102
Level 5
Joined
Aug 2, 2008
Messages
123
I realise that you are supposed to use Trigger Wraps, I just have things to do - I don't enjoy typing out the same trigger.
And what you said just goes against what NO.OB said..
 
Level 1
Joined
Dec 15, 2009
Messages
8
What you're doing is extremely weird. You're picking all units in the unit group for each unit in the unit group.

I told you to do this:
  • Spell
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Enemies and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
      • Wait 0.50 seconds
      • Unit Group - Pick every unit in Enemies and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
What you're doing is this:
  • Spell
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Enemies and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in Enemies and do (Actions)
                • Loop - Actions
                  • Unit - Pause (Picked unit)
              • Wait 0.50 seconds
              • Unit Group - Pick every unit in Enemies and do (Actions)
                • Loop - Actions
                  • Unit - Unpause (Picked unit)
            • Else - Actions
Now, to be honest I have NO idea what happens when you pick units in a unit group while picking units in a unit group, but it just cannot be good. Just follow my instructions properly and your trigger should work.

Off-topic: You can right-click the name of a trigger (NOT in the Left Bar that shows all the triggers, but at the top of the actual trigger) and select "Copy As Text". You can paste that between the trigger tags so you won't have to type anything
 
Status
Not open for further replies.
Top