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

[GUI] Advanced Build Mechanic 1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: IcemanBo
Triggers -

  • Human Build Icons
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Peasant <--- Change this to your new Worker
    • Actions
      • -------- IF WORKER PRESSED "BUILD" OR "ADVANCED BUILD" --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(manashieldon)) <--- This and the next are the orders for the spell, you don't have
              • (Issued order) Equal to (Order(manashieldoff)) ;to use Manashield, you need need an order with no target.
        • Then - Actions
          • -------- Advanced Construction --------
          • Player - Make Town Hall Unavailable for training/construction by (Owner of (Ordered unit)) <--- Change these to
          • Player - Make Farm Unavailable for training/construction by (Owner of (Ordered unit)) ;whatever you want.
          • Player - Make Barracks Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Altar of Kings Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Lumber Mill Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Blacksmith Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Scout Tower Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Arcane Vault Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Workshop Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Arcane Sanctum Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Gryphon Aviary Available for training/construction by (Owner of (Ordered unit))
          • -------- FORCE "BUILD" KEY --------
          • Game - Force (Owner of (Ordered unit)) to press the key Z <--- This can be changed using the text files.
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(windwalk)) <--- This is the next ability, again you just need an order with no
            • Then - Actions ;target. It is advisable to remove all the effects the ability has, too.
              • -------- Basic Construction --------
              • Player - Make Workshop Unavailable for training/construction by (Owner of (Ordered unit)) <--- You can change
              • Player - Make Arcane Sanctum Unavailable for training/construction by (Owner of (Ordered unit)) ;These too.
              • Player - Make Gryphon Aviary Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Town Hall Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Farm Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Altar of Kings Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Barracks Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Lumber Mill Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Blacksmith Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Scout Tower Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Arcane Vault Available for training/construction by (Owner of (Ordered unit))
              • -------- FORCE "BUILD" KEY --------
              • Game - Force (Owner of (Ordered unit)) to press the key Z
            • Else - Actions
"]



  • Orc Build Icons
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Peon
    • Actions
      • -------- IF WORKER PRESSED "BUILD" OR "ADVANCED BUILD" --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(manashieldon))
              • (Issued order) Equal to (Order(manashieldoff))
        • Then - Actions
          • -------- Advanced Construction --------
          • Player - Make Great Hall Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Orc Burrow Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Barracks Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Altar of Storms Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make War Mill Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Watch Tower Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Voodoo Lounge Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Tauren Totem Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Spirit Lodge Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Beastiary Available for training/construction by (Owner of (Ordered unit))
          • -------- FORCE "BUILD" KEY --------
          • Game - Force (Owner of (Ordered unit)) to press the key Z
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(windwalk))
            • Then - Actions
              • -------- Basic Construction --------
              • Player - Make Tauren Totem Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Spirit Lodge Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Beastiary Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Great Hall Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Orc Burrow Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Altar of Storms Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Barracks Available for training/construction by (Owner of (Ordered unit))
              • Player - Make War Mill Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Watch Tower Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Voodoo Lounge Available for training/construction by (Owner of (Ordered unit))
              • -------- FORCE "BUILD" KEY --------
              • Game - Force (Owner of (Ordered unit)) to press the key Z
            • Else - Actions



  • Undead Build Icons
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Acolyte
    • Actions
      • -------- IF WORKER PRESSED "BUILD" OR "ADVANCED BUILD" --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(manashieldon))
              • (Issued order) Equal to (Order(manashieldoff))
        • Then - Actions
          • -------- Advanced Construction --------
          • Player - Make Necropolis Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Ziggurat Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Crypt Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Altar of Darkness Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Graveyard Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Haunted Gold Mine Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Tomb of Relics Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Sacrificial Pit Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Slaughterhouse Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Temple of the Damned Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Boneyard Available for training/construction by (Owner of (Ordered unit))
          • -------- FORCE "BUILD" KEY --------
          • Game - Force (Owner of (Ordered unit)) to press the key Z
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(windwalk))
            • Then - Actions
              • -------- Basic Construction --------
              • Player - Make Sacrificial Pit Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Slaughterhouse Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Temple of the Damned Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Boneyard Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Necropolis Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Ziggurat Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Altar of Darkness Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Crypt Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Graveyard Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Haunted Gold Mine Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Tomb of Relics Available for training/construction by (Owner of (Ordered unit))
              • -------- FORCE "BUILD" KEY --------
              • Game - Force (Owner of (Ordered unit)) to press the key Z
            • Else - Actions



  • Night Elf Build Icons
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Wisp
    • Actions
      • -------- IF WORKER PRESSED "BUILD" OR "ADVANCED BUILD" --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(manashieldon))
              • (Issued order) Equal to (Order(manashieldoff))
        • Then - Actions
          • -------- Advanced Construction --------
          • Player - Make Tree of Life Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Moon Well Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Altar of Elders Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Ancient of War Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Hunter's Hall Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Ancient Protector Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Ancient of Wonders Unavailable for training/construction by (Owner of (Ordered unit))
          • Player - Make Ancient of Lore Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Ancient of Wind Available for training/construction by (Owner of (Ordered unit))
          • Player - Make Chimaera Roost Available for training/construction by (Owner of (Ordered unit))
          • -------- FORCE "BUILD" KEY --------
          • Game - Force (Owner of (Ordered unit)) to press the key Z
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Issued order) Equal to (Order(windwalk))
            • Then - Actions
              • -------- Basic Construction --------
              • Player - Make Ancient of Lore Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Ancient of Wind Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Chimaera Roost Unavailable for training/construction by (Owner of (Ordered unit))
              • Player - Make Tree of Life Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Moon Well Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Altar of Elders Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Ancient of War Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Hunter's Hall Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Ancient Protector Available for training/construction by (Owner of (Ordered unit))
              • Player - Make Ancient of Wonders Available for training/construction by (Owner of (Ordered unit))
              • -------- FORCE "BUILD" KEY --------
              • Game - Force (Owner of (Ordered unit)) to press the key Z
            • Else - Actions



  • Fix For Acolyte
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sacrificial Pit
    • Actions
      • Player - Set the current research level of Sacrificial Pit to 1 for (Owner of (Constructed structure))


Changes to Text Files -

CommandStrings.txt
[CmdBuildHuman]
Tip= <--- There is a space after this, if it wasn't there it would show "Missing String!"
Ubertip= <--- Same for here
Hotkey=Z < ---- Here you can change the Build Command's Hotkey, make sure to change it to whatever you use in the triggers!

[CmdBuildOrc]
Tip=
Ubertip=
Hotkey=Z

[CmdBuildNightElf]
Tip=
Ubertip=
Hotkey=Z

[CmdBuildUndead]
Tip=
Ubertip=
Hotkey=Z

HumanAbilityFunc.txt
[AHbu]
Art=ReplaceableTextures\CommandButtons\BTNBlank.blp <-- This actually needs to be an icon, or else Green.
Buttonpos=2,1
Order=humanbuild <--- You might be able to use this order for the triggers, I haven't tested it.

Same thing for NightElfAbilityFunc, OrcAbilityFunc, and UndeadAbilityFunc.

Except it's going to be AEbu for Night Elf, AObu for Orc, and AUbu for Undead. For further information on the text files, just look at them in the map. You can actually control a lot of stuff with them that you normally couldn't.

EDIT: To get a full demonstration on how this works inside and out, you'll have to look at the tutorial this is linked to. Check my profile, it should be in there somewhere.

The original system was created by the team ZanManagement. Icon Art for the Human, Undead, and Night Elf Advanced Build buttons are by me. There are some adaptations to make it work with the the original 4 WC3 races. It's kinda messy, but it works.

Basically, the way it works is that you click on/press the hotkey for either build icon, using some orderstrings it triggers the disabling of some buildings, and enables others. Then it forces the hotkey for the real build button.

The way this is set up is using some very interesting things that I didn't actually know where possible before learning this off their maps.

There are some issues; Here are the ones I know about.

1. When selecting a worker and telling it to build a "Basic" building, then selecting another worker and telling it to build an "Advanced" building, the order for the Basic Building will be cancelled due to the unavailability of the building.

2. I DO PROVIDE A FIX FOR THIS IN THE MAP, but Acolytes Sacrifice ability becomes disabled when going to Basic Buildings. The requirement for Sacrifice initially is having a Sacrificial Pit, and when the Sacrificial Pit is disabled the ability requiring it is automatically disabled as well.

This happens for any ability that requires something. An example is in the Human Campaign, Priests didn't have Inner Fire even on their command card (Until later into the Campaign), because the research for Priest Master Training was disabled on the map via trigger.

The work-around is making a dummy upgrade that by trigger is automatically set to 1 once a Sacrificial Pit is detected by the player. However this creates an issue as well. Having no Sacrificial Pit but having built one previously will still enable the ability, since "Tech cannot be unlearned' using the "Set Current Research Level" Action.

3. You get two clicky-clicky sounds, because two buttons are being pressed virtually at the same time, which is kind of annoying.

The map is completely blank, and you have 1 Worker of each race. Simply use the following Cheat Codes to test things out!

greedisgood 99999999 <--- For max possible money
warpten
Contents

Advanced Build Demonstration Map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 23:22, 4th Feb 2014 BPower: Store Owner of (Ordered unit)) into variable. It's unacceptable as it is now. The configuration isn't user-friendly at all and I don't see a real use in this...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

23:22, 4th Feb 2014
BPower:
Store Owner of (Ordered unit)) into variable. It's unacceptable as it is now.

The configuration isn't user-friendly at all and I don't see a real use in this "system".

Change this wishy-washy description of your system.
Basically everything in there is like this sentence:
"You can actually control a lot of stuff with them that you normally couldn't."
I've read the wall of text you posted and I would really appreciate it if you would be more distinct with less words.
 
Level 12
Joined
May 20, 2009
Messages
822
There is an event for when a unit goes into their build menu (and a hero into their skill menu) that you should handle for the basic build skills. It'll make it a lot smoother, versus hoping that the player doesn't press 'z' on their own.

I'll look into that. But for now I'm working on something else.

EDIT: Are you sure? Whats the event?

And actually, them pressing Z is entirely fine. The actual button/command is really only functioning as memory at this point.

But I think I see what you mean, the way you're talking about it I probably don't have to modify the original build button.
 
  • Like
Reactions: ILH

Deleted member 219079

D

Deleted member 219079

My map totally needs this. Is there any way to prevent the click sound from playing twice?
 
Level 12
Joined
May 20, 2009
Messages
822
My map totally needs this. Is there any way to prevent the click sound from playing twice?

Uuuuh...I don't really know. xD

Try what the other guy just suggested; It might do that...

The Event he's talking about is
  • Test
    • Events
      • Game - The 'Build Structure' button is clicked
Using that you can make only 1 click sound for the Basic build button, but the Advanced Build Button will still have 2.

However, this will also remove the need for the custom imported text files.

But at the same time will require 2 separate triggers for each worker, because you'll need a separate event for the Advanced Build.

EDIT: Actually, I don't know if that'll work at all. When you go to press the Advanced Build icon, it'll disable tech then force the Basic Build icon, which would then switch the tech around again if I'm not mistaken.
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
If you have only one condition, don't use Multiple Or Conditions for it.

Store "OrderedUnit" into a temp unit variable.

For me, idk.. I don't think this is very useful at the moment.

- System is very strict and doesnt allow variation
- You can't config anything
- It more just shows a simple methode how to use it, but nothing I would import as a system

I think you should work on it to improve it. Keep up doing.
Posting triggers is not a must have. Maker said it, and gave links of some ressources which have no trigger shown in description.

But because most users ask for it and it's more comfortable for everyone to have a short look into triggers before to decide if to download it or not, it maybe would be better it was a submission rule.

Spell Submission Rules

Edit:
Please use [HlDDEN] [/HIDDEN] tags to hide your code.
 
Level 12
Joined
May 20, 2009
Messages
822
I see no reason to have a variable...This is pretty clean, straight-forward and easy to manipulate. You just make your new worker, give it the abilities, then copy this and change all the buildings.

Edit:
Please use [HlDDEN] [/HIDDEN] tags to hide your code.

Will do. xD

This is also a pretty expandable system. The limit to the amount of buildings a worker could build with this system is 84, because you have 7 available buttons (12, minus the 5 basic commands) to trigger a switch. Just gotta find 7 different abilities that have a command string that don't target anything and everything that the ability does can be removed. XD

Edit:

If you have only one condition, don't use Multiple Or Conditions for it.

Store "OrderedUnit" into a temp unit variable.

For me, idk.. I don't think this is very useful at the moment.

- System is very strict and doesnt allow variation
- You can't config anything
- It more just shows a simple methode how to use it, but nothing I would import as a system

I think you should work on it to improve it. Keep up doing.

I completely forgot that OR Condition was there, I was messing around with it to see if I could fix some of the issues with it. I forgot to remove it. xD

I'll update it if it's entirely necessary.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
The variable is for code speed and efficiency. The way you have it now the code is slow and inefficient compared to what it would be with the variable.
The variable also makes editing easier and it makes code easier to read.

Show an example of how to add more buildings to this system then. Would the code be a few short lines of code like an actual system ? Or would it be copy and paste a ton of stuff which is like a template not a system.
 
Level 12
Joined
May 20, 2009
Messages
822
The variable is for code speed and efficiency. The way you have it now the code is slow and inefficient compared to what it would be with the variable.
The variable also makes editing easier and it makes code easier to read.

Show an example of how to add more buildings to this system then. Would the code be a few short lines of code like an actual system ? Or would it be copy and paste a ton of stuff which is like a template not a system.

It already fires instantly, how much faster could it get?

It's pretty straight-forward on how to expand it in the first place. If someone can't figure it out, then they should learn basic triggering and how to Copy/Paste first.

I'm not trying to sound rude but there's really no reason for this stuff. =x
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
It already fires instantly, how much faster could it get?

Nothing fires instantly. Everything takes a certain amount of time to fire. You may not notice a difference if this is your only trigger but with more and more triggers the lag cause by triggers will start to show. That simple fact is why everything should be efficient.

It's pretty straight-forward on how to expand it in the first place. If someone can't figure it out, then they should learn basic triggering and how to Copy/Paste first.

I'm not trying to sound rude but there's really no reason for this stuff. =x

A system should not be copy and paste all the triggers over and over again. A system is something that handles everything for you with very minimal function calls.
I'm asking for an example of your system.

You should focus more on compacting things. Make an actual system not a template. Make things more efficient. The way you have it now it will never be approved.
 
I see no reason to have a variable...This is pretty clean, straight-forward and easy to manipulate. You just make your new worker, give it the abilities, then copy this and change all the buildings.

Now if you compare to fire this trigger with variable, and then without variable.. you won't feel any differences of course.

But it's just a good habit always to optimize code where you can. If you would not be strict always with optimizing code in big projects for example, with usually tons of code... then you can feel difference.

Also just what a variable stands for, it's just variable :) ... if you have a larger code, then suddenly you recognize you have mixed something up or want to do some changes,
would it be better to change every single line in code with this reference? Or preferably change only one variable on top of trigger which does this job for you.
 
Level 12
Joined
May 20, 2009
Messages
822
I am working on and off on improving this. I've already fixed the double-clicky, and next I'm gonna work on shrinking it down some. I'll fix the leaks and work on making it easier to understand as well, when I get the motivation to work on this again. It may take some time, though. I'm lazy. xD

Use this

  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851994)
In place of

  • Game - Force (Owner of (Ordered unit)) to press the key Z
I know you gotta manually clear the thingy for GetTriggerUnit and stuff (I think...) but that fix will come along with the other leaks.

Just because this is here though, doesn't mean you don't have to use the text files. Those are still necessary to make the original build icon for each worker as un-noticeable as possible.

I should also mention that this system could be great for Tower Defense maps, because you can have 66 different buildable structures on one unit and they are all accessible.

11 structures for each "Command Card", 6 open buttons on the normal Command Card.
 

Deleted member 237964

D

Deleted member 237964

That's exacly what i was looking for.Excellent!
 
Level 16
Joined
May 25, 2004
Messages
1,170
I am working on and off on improving this. I've already fixed the double-clicky, and next I'm gonna work on shrinking it down some. I'll fix the leaks and work on making it easier to understand as well, when I get the motivation to work on this again. It may take some time, though. I'm lazy. xD

Use this

  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851994)
In place of

  • Game - Force (Owner of (Ordered unit)) to press the key Z
I know you gotta manually clear the thingy for GetTriggerUnit and stuff (I think...) but that fix will come along with the other leaks.

Just because this is here though, doesn't mean you don't have to use the text files. Those are still necessary to make the original build icon for each worker as un-noticeable as possible.

I should also mention that this system could be great for Tower Defense maps, because you can have 66 different buildable structures on one unit and they are all accessible.

11 structures for each "Command Card", 6 open buttons on the normal Command Card.
Technically I don't for the Adv Build button, but when I click the normal build button it does the double clicks. How do I fix that?
 
Top