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

How to make Building only buildable on Gold Mine?

Status
Not open for further replies.
Level 3
Joined
May 11, 2009
Messages
34
I wanna make a building for example a barracks, only build on Gold Mines I have placed around the map. Now they dont have to be gold mines as I have found you can build on other buildings but in this situation when the building is canceled or destroyed then the original building underneath is removed. Is there a way to go about this without triggers? Or do I need to make triggers for when buildings are destroyed/canceled or player leaves.
 
This is the option to make a building be only buildable on gold mines:

1736306188666.png
 
That still removes the Gold Mine after the building has come and gone.
Yeah, just do what @Pyrogasm said, is very easy:
  • Create Mine
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Mina de Oro encantada
    • Actions
      • Unit - Create 1 Mina de Oro for Player 1 (Red) at (Position of (Dying unit)) facing Default building facing degrees
In case you wanna set the gold:
  • Create Mine
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Mina de Oro encantada
    • Actions
      • Unit - Create 1 Mina de Oro for Player 1 (Red) at (Position of (Dying unit)) facing Default building facing degrees
      • Neutral Building - Set (Last created unit) to (Resource quantity contained in (Dying unit)) gold
 
Cool ok, I can do that.

What happens if they cancel the building though? It could be exploited to remove my locations(Gold Mines).
What exploit are you worried about? If the building is cancelled then the Gold Mine will die and a new one will be created in it's place. If the Gold Mine doesn't die in the situation of a "Cancel" then there is no issue.
 
Status
Not open for further replies.
Back
Top