• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Need help fixing a trigger

Status
Not open for further replies.
Level 18
Joined
Jan 12, 2011
Messages
1,513
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