• 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] Need help fixing a trigger

Status
Not open for further replies.
Level 19
Joined
Jan 12, 2011
Messages
1,523
Alright so i got a trigger that once you research an upgrade it adds 15 to both Dark green and Yellow's income (Gold per minute), it also enables 2 portals.

The thing is once any of those 2 portals die each one triggers a separate trigger that reduces both Dark Green and Yellow's gold income by 15.

However when 1 dies it triggers both triggers and ends up reducing both of their income by 30.

Here are the triggers:
  • Build
    • Events
      • Unit - The Great Forge 2300 <gen> Finishes research
    • Conditions
      • (Researched tech-type) Equal to (==) Ironforge-Stormwind Railway (Human)
    • Actions
      • Set Ironforge = (Center of Ironforge <gen>)
      • Set Stormwind = (Center of Stormwind <gen>)
      • Set PlayerGold[5] = (PlayerGold[5] + 15)
      • Set PlayerGold[11] = (PlayerGold[11] + 15)
      • Game - Display to (All players) the text: The Dwarves of Iron...
      • Neutral Building - Set Deeprun Tram 0037 <gen> destination to Ironforge
      • Neutral Building - Set Deeprun Tram 2435 <gen> destination to Stormwind
      • Neutral Building - Enable Deeprun Tram 0037 <gen>
      • Neutral Building - Enable Deeprun Tram 2435 <gen>
      • Unit - Change ownership of Deeprun Tram 0037 <gen> to Player 11 (Dark Green) and Change color
      • Unit - Change ownership of Deeprun Tram 2435 <gen> to Player 5 (Yellow) and Change color
      • Unit - Make Deeprun Tram 0037 <gen> Vulnerable
      • Unit - Make Deeprun Tram 2435 <gen> Vulnerable
      • Custom script: call RemoveLocation(udg_Ironforge)
      • Custom script: call RemoveLocation(udg_Stormwind)
      • Trigger - Turn off (This trigger)
  • Death 1
    • Events
      • Unit - Deeprun Tram 2435 <gen> Dies
    • Conditions
    • Actions
      • Trigger - Turn off Death 2 <gen>
      • Set PlayerGold[5] = (PlayerGold[5] - 15)
      • Set PlayerGold[11] = (PlayerGold[11] - 15)
      • Neutral Building - Disable Deeprun Tram 0037 <gen>
      • Trigger - Turn off (This trigger)
  • Death 2
    • Events
      • Unit - Deeprun Tram 0037 <gen> Dies
    • Conditions
    • Actions
      • Trigger - Turn off Death 1 <gen>
      • Set PlayerGold[5] = (PlayerGold[5] - 15)
      • Set PlayerGold[11] = (PlayerGold[11] - 15)
      • Neutral Building - Disable Deeprun Tram 2435 <gen>
      • Trigger - Turn off (This trigger)
 
Level 7
Joined
Mar 6, 2006
Messages
282
Try:

In each Death trigger, change the ownership back to neutral (or w/e it was) BEFORE you disable it.

If that doesn't work, then just condense the two Death triggers into one:

  • Death
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Deeprun Tram
  • Actions
    • Set PlayerGold[5] = (PlayerGold[5] - 15)
    • Set PlayerGold[11] = (PlayerGold[11] - 15)
    • Neutral Building - Disable Deeprun Tram 2037 <gen>
    • Neutral Building - Disable Deeprun Tram 2435 <gen>
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top