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

How to make Building only buildable on Gold Mine?

Level 3
Joined
May 11, 2009
Messages
32
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.
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
This is the option to make a building be only buildable on gold mines:

1736306188666.png
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
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
 
Level 3
Joined
May 11, 2009
Messages
32
Cool ok, I can do that.

What happens if they cancel the building though? It could be exploited to remove my locations(Gold Mines).
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
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.
 
Top