Allowing to build only one of that type buildings

LmmcDarkY

New Member
Reaction score
1
If units builds a building he cant build another one. The best way would be hiding buildings icon in build list but when building dies it must be back there hope you got my idea.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
You might be able to try this trigger:

Trigger:
  • Player - Limit training of Footman to 1 for Player 1 (Red)


Obviously modify it to your needs.
 

Corleone

New Member
Reaction score
44
Try this:

Trigger:
  • Unit built
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Number of units in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Footman))) Equal to 1) and ((Issued order) Equal to (Order(YourBuildingOrder)))
    • Actions
      • Unit - Order (Triggering unit) to Stop


This trigger checks how many units of that type are already in the map and whether the issued order is equal to 'build YourUnit'. If these conditions are matched, it orders the building unit to stop.
 

LmmcDarkY

New Member
Reaction score
1
sorry for double post but if that building is upgradeable after upgrading it i can build first building again...
 

Corleone

New Member
Reaction score
44
You should include another condition to the trigger I posted then:

Trigger:
  • Unit built
    • Conditions
      • (Number of units in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Knight))) Equal to 1


Where "Knight" is the upgraded version of your building. If it is equal to 1 it means that there already is a building of that type in your map and hence, you can no longer build the non-upgraded version.
 

Seprest

New Member
Reaction score
15
then make another trigger checking for if there is any of those upgraded buildings, just add to the conditions.

If you have multiple people that can build these buildings, and want each to be able to build 1 each, I suggest you make a boolean array that is turned "true" if the building is built, each index of the array 1-12 can refer to a player. If one of the buildings is destroyed(any of the upgrades+the first building) then check the owner of it and turn that slot in the boolean array to false.\

just my input
 

Seprest

New Member
Reaction score
15
yarg

you could also copy the op's trigger, add the extra condition, and an additional one to check for the players color, check if any of X units(for triggering player) exist for (triggering unit's player).

I prefer booleans, but this would work neat and simple as well if you have multiple people that can build a single instance of the building.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top