• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[General] Limit the Building being build

Level 9
Joined
Mar 26, 2020
Messages
206
I saw an almost 2 decade thread regarding this, except mine is not tied to tech tree or buildable structures, instead mine is set as ability similar to summon and used the 'item build altar' as placeholder ability. How do i set limits of what i can summon/build? i know training units can be cap but how about buildings?
 
Last edited:
Buildings can be capped just the same but if it doesn't come from a worker then you need to find a trick, I'd use research to allow/disallow the ability in this case
  • Build OFF
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Altar of Kings
    • Actions
      • Set VariableSet MyBuildingCount = (MyBuildingCount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MyBuildingCount Greater than or equal to MyBuildingMaximum
        • Then - Actions
          • Player - Set the current research level of Building Allowed to 0 for Player 1 (Red)
        • Else - Actions
  • Build ON
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Altar of Kings
    • Actions
      • Set VariableSet MyBuildingCount = (MyBuildingCount - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MyBuildingCount Less than or equal to MyBuildingMaximum
        • Then - Actions
          • Player - Set the current research level of Building Allowed to 1 for Player 1 (Red)
        • Else - Actions
And then add the research as a requirement for your ability

1767004360757.png


And set it to 1 at the beginning of the map if the player doesn't have said buildings. Also this would be for only 1 player but you can make it MPI easily
 
Back
Top