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

[Trigger] Trying to make buildings cost through triggers...

Status
Not open for further replies.
Level 5
Joined
Sep 10, 2006
Messages
185
I'm making the price of the tower 5 x the point value of the tower.

  • Building Cost
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current gold) Greater than or equal to ((Point-value of (Constructing structure)) x 5)
        • Then - Actions
          • Player - Add ((Point-value of (Constructing structure)) x (5 x -1)) to (Owner of (Triggering unit)) Current gold
        • Else - Actions
          • Game - Display to (All players) for 5.00 seconds the text: |c00f2c435Not enoug...
          • Unit - Order (Triggering unit) to Stop
          • Unit - Remove (Constructed Unit) from the game
All it does is print out the message. How do I refer to the building unit and the structure he is creating?

I want not having enough gold to stop creation and remove it. Also, is there an easy way to make it send the message to owner of triggering unit?
 
Last edited:
Use Constructing Structure, to refer to the unit that is building the structure and Constructed Structure to refer to the building that is created.

Constructing Structure returns the unit that is building the structure not the structure itself.

Constructed Structure returns the building that is being constructed.
 
Use Constructing Structure, to refer to the unit that is building the structure and Constructed Structure to refer to the building that is created.

Constructing Structure returns the unit that is building the structure not the structure itself.

Constructed Structure returns the building that is being constructed.

I had the game print out the constructing structure and the constructed structure.

Building a castle, the output was.

Castle
(null)

However, all I had to do was remove the constructing structure, and the unit stops, obviously.

Ty for the helps :)
 
Status
Not open for further replies.
Back
Top