• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] From what I can tell, this trigger should work :(

Status
Not open for further replies.
Level 3
Joined
Oct 27, 2016
Messages
34
So I've gone over this trigger a few times, and all seems in order. However, for some reason, the trigger keeps picking structures (based on the Blacksmith) as non-structures and treating them as such. Is this particular system broken (as the World Editor often just is) or am I missing some logic? I am sick as all hell, so I wouldn't be COMPLETELY surprised if I was just missing something.

For context, this trigger is meant to pick every unit owned by Player Brown, except for heroes and structures. Then, it's supposed to pick between increasing the unit's custom value, or removing the unit entirely if the custom value is at a certain level. So far, the system seems to work perfectly, with the NOTABLE exception that it is counting STRUCTURES as units. I am going to experiment with moving the condition to the actual conditions area instead of putting it in the Pick Action and see if that works, but I'd still like to know why this isn't working.

  • DespawnControl
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Picked unit) is A structure) Equal to False)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to False
              • (Custom value of (Picked unit)) Greater than or equal to 8
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
              • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\ResourceItems\ResourceEffectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
      • Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Triggering unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to 0
EDIT: As expected, moving the Matching Condition Structure to the Conditions area of the If/Then/Else worked like a charm. However, I'd still like to know if I was making a mistake, or if the Matching Condition doesn't work inside a Pick action, or if something else entirely was going on.

EDIT2: Solved in first reply! I'll leave this up in case anyone else can benefit from it!
 
Last edited:

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,249
Use trigger tags instead of code tags.

It should be
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Picked unit) is A structure) Equal to False)) and do (Actions)
>
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((matching unit) is A structure) Equal to False)) and do (Actions)

and

Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Triggering unit) is A Hero) Equal to True)) and do (Actions)
>
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
 
Level 3
Joined
Oct 27, 2016
Messages
34
Use trigger tags instead of code tags.

It should be
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Picked unit) is A structure) Equal to False)) and do (Actions)
>
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((matching unit) is A structure) Equal to False)) and do (Actions)

and

Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Triggering unit) is A Hero) Equal to True)) and do (Actions)
>
Unit Group - Pick every unit in (Units owned by Player 12 (Brown) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)

Ah jeez, I knew it was something stupid that I should have caught instantly! Fevers, man!

Also thanks for telling me about trigger tags, it's been awhile since I posted on WCIII modding forums :)
 
Status
Not open for further replies.
Top