• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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:
Level 4
Joined
Nov 25, 2008
Messages
76
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.
 
Level 5
Joined
Sep 10, 2006
Messages
185
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.
Top