• 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.

only 1 building

Status
Not open for further replies.
Level 4
Joined
Jul 1, 2009
Messages
65
is there a way to make it so u can only build 1 building of each type.

Example: Peon builds building A. Peon goes back to building list and building A is not an option anymore.
 
Remove it from the list, impossible, only by replacing it with a unit with less buildings to build from "Techtree - Structures Built". The other way to do such thing, is by having two triggers:
  • Trigger1
  • Events
    • Unit - A unit finishes construction
  • Conditions
    • ((Unit-type of (Constructed structure)) Equal to X
  • Actions
    • Set AlreadyConstructed[Player Number of (Owner of (Constructing unit))] = True
    • Trigger - Turn off (This trigger)
  • Trigger2
  • Events
    • Unit - A unit finishes construction
  • Conditions
    • ((Unit-type of (Constructed structure)) Equal to X
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((AlreadyConstructed[Player Number of (Owner of (Constructing unit))]) Equal to True
      • Then - Actions
        • Unit - Order (Constructing unit) to Stop
        • Game - Display to (Player Group(Owner of (Constructing unit))) the text: "You have already built this type of building."
        • Set Owner = (Owner of (Constructing unit))
        • Custom script: if GetLocalPlayer() == udg_Owner then
        • Sound - Play Error <gen>
        • Custom script: endif
      • Else - Actions
  • Trigger3
  • Events
    • Unit - A unit dies
  • Conditions
    • ((Unit-type of (Dying unit)) Equal to X
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (AlreadyConstructed[Player Number of (Dying unit)]) = True
      • Then - Actions
        • Set AlreadyConstructed[Player Number of (Dying unit)] = False
      • Else - Actions
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
that can be a problem with building if they can upgrade
for example
you have tower EYE and tower ZERG
EYE limit = 3
ZERG limit = 100000

now if you start EYE to upgrade to ZERG
(while upgrading) player can build more EYE towers (lets say 3)
and than he cancels upgrades to ZERG and he has 6 EYE towers

that could happen (happens in some maps)
but that all is not a problem if your limited building cannot upgrade xD

so if your really wanna stop it you wold need to count EYE towers and ZERG towers on construction
 
Level 4
Joined
Jul 1, 2009
Messages
65
kk limit will work for me....although its a tower defense....this race doesnt upgrade only adds attachments to upgrades.... :) thnx so much everyone
 
Level 24
Joined
Feb 28, 2007
Messages
3,479
  • TRIG1
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to YourStructure
    • Actions
      • Player - Make YourStructure Unavailable for training/construction by (Owner of(Constructing Structure))
  • TRIG2
    • Events
      • Unit - A unit Cancels construction
    • Conditions
      • (Unit-type of (Canceled structure)) Equal to YourStructure
    • Actions
      • Player - Make YourStructure Available for training/construction by (Owner of (Cancelled structure))
 
Status
Not open for further replies.
Top