• 🏆 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!

[General] Queueing Building Upgrades

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2008
Messages
353
Am looking for a trigger that will enable me to queue building upgrades same way as when you queue units. If it can be done w/o triggers pls do tell.

Currently when you upgrade a building it makes the upgrade button be replaced with the cancel button
 
Level 5
Joined
Nov 21, 2014
Messages
151
Am looking for a trigger that will enable me to queue building upgrades same way as when you queue units. If it can be done w/o triggers pls do tell.

Currently when you upgrade a building it makes the upgrade button be replaced with the cancel button

What do you mean, an Upgrade or a Research? Do you mean as in your main base upgrade or a weapon tech research? and no, you cannot do this without triggers either way.

EDIT: it's i think quite simple to triger anyway.
 
Level 8
Joined
Jul 10, 2008
Messages
353
What do you mean, an Upgrade or a Research? Do you mean as in your main base upgrade or a weapon tech research? and no, you cannot do this without triggers either way.

EDIT: it's i think quite simple to triger anyway.
Its a research for a unit, in a building. It has many levels, so i want it to be able to be queued same way a unit is queued to be build.

It may be simple to trigger it for you, but not for me :p
 
Level 6
Joined
Mar 17, 2012
Messages
105
Queueing is hard coded to units, I suppose if you wanted to make upgrades queue-able you'd have to make a unit that acted as a psuedo upgrade. Once the psuedo-upgrade unit finishes "upgrading", use triggers to relocate it somewhere. Give it the "Locust" ability and "Invulnerable" abilities. Then Hide the unit using triggers. After the unit finishes training, make that unit Unavailable for that player through triggers.
 
Level 6
Joined
Mar 17, 2012
Messages
105
How do I do that?

Here's a quick trigger I made that accomplishes the task.

  • Research
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Trained unit)) Equal to (Some_Technology)
          • (Unit-type of (Trained unit)) Equal to (Some_Other_Technology)
          • (Unit-type of (Trained unit)) Equal to (Some_Other_Other_Technology)
    • Actions
      • Set UNIT_ResearchedTechnology = (Trained unit)
      • Unit - Move UNIT_ResearchedTechnology instantly to (Center of (Your_Region_Here)) <gen>)
      • Unit - Hide UNIT_ResearchedTechnology
      • Player - Make (Unit-type of UNIT_ResearchedTechnology) Unavailable for training/construction by (Owner of (Triggering unit))
      • -------- // the rest of this is optional and just plays the "research complete" sound to the player --------
      • Custom script: set udg_PLAYER_LocalPlayer = GetLocalPlayer()
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PLAYER_LocalPlayer Equal to (Owner of (Triggering unit))
        • Then - Actions
          • Sound - Play ResearchComplete <gen>
          • Game - Display to (Player group(PLAYER_LocalPlayer)) the text: Research Complete!
        • Else - Actions
Some_Technology, Some_Other_Technology, etc., these are just units that you create that act as upgrades. This means that if you already had a bunch of upgrades made for your map, sorry, if you want to queue them you'll have to convert them all into units!

UNIT_ResearchedTechnology is a Unit variable which we set to the trained unit. The trained unit by the way is just some custom unit that acts as an upgrade. Nothing really matters about the unit's stats, model, or appearance, except the training time, tooltip, and gold/lumber cost, since it is behaving as an upgrade.

"Your_Region_Here" is just some region that's out of the way of gameplay, e.g., in a corner of your map protected by Boundaries. This is sort of an unnecessary step because a hidden unit can't cause too many problems, but its better safe than sorry.

We make the unit unavailable after it has been trained, because then you can't make multiple of the same upgrade.

Everything below the comment (the rest of this is optional) is optional. It plays a sound and gives a message to the player who finished training the unit. If your map is a single player map, you don't need to worry about the custom script and if/then/else function; you can just play the sound and deliver the message to all players.

If your upgrades have levels, you could also simulate that by tweaking with the "Make unit available" triggers (make the next upgrade unit, which is disabled at map initialization, available after a certain upgrade unit finishes training).
 
Level 12
Joined
May 20, 2009
Messages
822
Make sure you give the Locust ability to the unit through the Object Editor, and not through triggers. Through triggers can cause problems, because for a split second they still have pathing and can be killed. Also if they have the Locust ability, they don't need the invulnerability ability. They are already completely untargetable, even by AoE.
 
Status
Not open for further replies.
Top