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

[Trigger] Another trigger failure

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
781
  • Collision
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set tempgroup = (Units of type Static Orb)
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Set temppoint = (Position of (Picked unit))
          • Set tempgroup2 = (Units within 50.00 of temppoint matching ((Unit-type of (Matching unit)) Equal to (==) Static Orb))
          • Unit Group - Remove (Picked unit) from tempgroup2
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in tempgroup2) Greater than or equal to (>=) 1
            • Then - Actions
              • Unit Group - Add (Picked unit) to collisiongroup
              • Unit - Order (Picked unit) to Orc Tauren Chieftain - War Stomp
            • Else - Actions
      • Custom script: call DestroyGroup(udg_tempgroup)
      • Custom script: call DestroyGroup(udg_tempgroup2)
      • Custom script: call RemoveLocation(udg_temppoint)
Always returns false. I'm probably missing some small stupid detail, but I can't see it. Anyone?
 
Level 11
Joined
Nov 15, 2007
Messages
781
It returns false because when I add an event to "Else do - ", that event always runs. And when I remove the condition it runs, too.
 
Level 11
Joined
Nov 15, 2007
Messages
781
The units have no collision and there's another ability which draws them closer together, to the point where many of them end up stacked atop one another. I'd say they're within 1 range of eachother, and still it won't detect it.

Edit: Okay, this is weird as hell. It's detecting dead units but not living units...
 
Level 5
Joined
Feb 21, 2009
Messages
136
  • Collision
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set tempgroup = (Units of type Static Orb)
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Set temppoint = (Position of (Picked unit))
          • Set tempgroup2 = (Units within 50.00 of temppoint matching ((Unit-type of (Matching unit)) Equal to (==) Static Orb))
          • Unit Group - Remove (Picked unit) from tempgroup2
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in tempgroup2) Greater than or equal to (>=) 1
            • Then - Actions
              • Unit Group - Add (Picked unit) to collisiongroup
              • Unit - Order (Picked unit) to Orc Tauren Chieftain - War Stomp
            • Else - Actions
      • Custom script: call DestroyGroup(udg_tempgroup)
      • Custom script: call DestroyGroup(udg_tempgroup2)
      • Custom script: call RemoveLocation(udg_temppoint)
Always returns false. I'm probably missing some small stupid detail, but I can't see it. Anyone?



Leaks.. make
  • Custom script: call RemoveLocation(udg_temppoint)
be in the loop
 
Level 11
Joined
Nov 15, 2007
Messages
781
No, a unit group loop runs once for each individual unit in the group. The problem was it doesn't detect locust units; I knew it'd be something I should've already known. Just not sure why it detects dead locusts. Is there a way to detect locust units or will I have to create temporary corpses all over the place? :xxd:
 
Level 11
Joined
Nov 15, 2007
Messages
781
I already went through the trouble of indexing every locust unit's location to an array and comparing range between them for this system, which was sortof a hassle for something that was supposed to be a quick spell. Thanks anyway, I'll probably use this locust detection thing a lot in the future.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I do not see it returning any value let alone a boolean.

Anyway, you can loop through locusts if they are in a group. You can not pick locusts to add them to a group via the pick in X radious of position action. You can however add locust units to a group as they are created or pick them via all untis of type (I think).
 
Status
Not open for further replies.
Top