• 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.

[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