• 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] Building/Tech not working

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2010
Messages
312
Shitty title but oh well I didn't know how to say it...

In my map, when a player builds a building it is automatically given to an ally computer and is shared by all the allies. That building is required for more buildings to be made. All those players are also given an upgrade with the same name as the building and is used to go back and forth between levels. I thought I could do this by using the research trigger but that doesn't allow me to reduce the level of the upgrade.

I'm wondering if there is any other way to accomplish this? Below is an example of what I mean because i'm bad at explaining things.

  • Fire Pit
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Fire Pit
    • Actions
      • Set ua_Building[(Player number of (Owner of (Constructing structure)))] = (Constructing structure)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item-type of (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Wood)) Equal to Wood) and ((Charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Wood)) Greater than or equal to 16)
          • ((Item-type of (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Stone)) Equal to Stone) and ((Charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Wood)) Greater than or equal to 6)
        • Then - Actions
          • Item - Set charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Wood) to ((Charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Wood)) - 16)
          • Item - Set charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Stone) to ((Charges remaining in (Item carried by ua_Player_Hero[(Player number of (Owner of (Constructing structure)))] of type Stone)) - 6)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Triggering unit)) Equal to Player 1 (Red)
                  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                  • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                  • (Owner of (Triggering unit)) Equal to Player 7 (Green)
            • Then - Actions
              • Unit - Change ownership of (Constructing structure) to Player 9 (Gray) and Retain color
              • Player Group - Pick every player in Team1 and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of Fire Pit [Up] to 1 for (Picked player)
            • Else - Actions
              • Unit - Change ownership of (Constructing structure) to Player 10 (Light Blue) and Retain color
              • Player Group - Pick every player in Team2 and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of Fire Pit [Up] to 1 for (Picked player)
        • Else - Actions
          • Game - Display to (Player group((Owner of ua_Building[(Player number of (Owner of (Triggering unit)))]))) the text: |c00ff0000More reso...
          • Unit - Remove ua_Building[(Player number of (Owner of (Constructing structure)))] from the game
  • Building Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
          • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Fire Pit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
              • And - All (Conditions) are true
                • Conditions
                  • (Number of units in (Units owned by Player 9 (Gray) of type Fire Pit)) Equal to 0
                  • (Number of units in (Units owned by Player 9 (Gray) of type Fire Pit with Dinner)) Equal to 0
            • Then - Actions
              • Player Group - Pick every player in Team1 and do (Actions)
                • Loop - Actions
                  • Player - Set the current research level of Fire Pit [Up] to 0 for (Picked player)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
                  • And - All (Conditions) are true
                    • Conditions
                      • (Number of units in (Units owned by Player 10 (Light Blue) of type Fire Pit)) Equal to 0
                      • (Number of units in (Units owned by Player 10 (Light Blue) of type Fire Pit with Dinner)) Equal to 0
                • Then - Actions
                  • Player Group - Pick every player in Team2 and do (Actions)
                    • Loop - Actions
                      • Player - Set the current research level of Fire Pit [Up] to 0 for (Picked player)
                • Else - Actions
        • Else - Actions
Thanks in advance for any help given!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
The only way in WarCraft III is to use an invisible dummy unit that you give to every player when the building finished and is required for whatever reason (such as more buildings). Units can be created and removed at will and still produce the requirements tooltip.

This was used in the map Dark Deeds where some buildings required certain ranks to use.

Alternatively you could consider moving to StarCraft II seeing how much the game has improved recently. In StarCraft II you can "unresearch" upgrades via triggers and it has an entire system governing tooltip requirements (including when to show or hide as well as the number of things needed for tests to pass).
 
Status
Not open for further replies.
Top