• 🏆 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] Spot the problem?

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I have two triggers, both have relatively the same thing. though one works and one does not.
TRIGGER 1
  • Events
  • Unit - a unit owned by player 1 (red) finishes training a unit
  • Conditions
  • ((Trained unit) is A structure) Equal to false
  • (Unit-type of (trained unit)) not equal to citizen 1
  • (Unit-type of (trained unit)) not equal to citizen 2
  • (Unit-type of (trained unit)) not equal to citizen 3
  • Actions
  • Set Red = (Red +1)
TRIGGER 2
  • Events
  • A unit owned by player 1 (red) Dies
  • Conditions
  • ((Trained unit) is A structure) Equal to false
  • (Unit-type of (trained unit)) not equal to citizen 1
  • (Unit-type of (trained unit)) not equal to citizen 2
  • (Unit-type of (trained unit)) not equal to citizen 3
  • Actions
  • Set Red = (Red -1)
Now this trigger works relatively well. I have another trigger that shows the players amount of units when he/she types "-unit" . . . My PROBLEM is that when a structure dies (doesnt matter which one) it registers as "Red - 1" . . . How would i go about fixing this???
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
You should use If/then/else actions, and add in the 'if' the structure, then in 'then' nothing, and in else, set it to -1.

ROFL

I have two triggers, both have relatively the same thing. though one works and one does not.
TRIGGER 1
  • Events
  • Unit - a unit owned by player 1 (red) finishes training a unit
  • Conditions
  • ((Trained unit) is A structure) Equal to false
  • (Unit-type of (trained unit)) not equal to citizen 1
  • (Unit-type of (trained unit)) not equal to citizen 2
  • (Unit-type of (trained unit)) not equal to citizen 3
  • Actions
  • Set Red = (Red +1)
TRIGGER 2
  • Events
  • A unit owned by player 1 (red) Dies
  • Conditions
  • ((Trained unit) is A structure) Equal to false
  • (Unit-type of (trained unit)) not equal to citizen 1
  • (Unit-type of (trained unit)) not equal to citizen 2
  • (Unit-type of (trained unit)) not equal to citizen 3
  • Actions
  • Set Red = (Red -1)
Now this trigger works relatively well. I have another trigger that shows the players amount of units when he/she types "-unit" . . . My PROBLEM is that when a structure dies (doesnt matter which one) it registers as "Red - 1" . . . How would i go about fixing this???

In the second trigger, you do not have a trained unit. You have a dying unit that is the same as triggering unit.
 
Status
Not open for further replies.
Top