[General] Limit the Building being build

Level 9
Joined
Mar 26, 2020
Messages
205
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