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

Building Construction?

Status
Not open for further replies.
Construction Bonus
Events
Unit - A unit Begins construction
Conditions
Actions
Unit - Set (Constructing structure) construction progress to ((Number of units in (Units owned by (Owner of (Constructing structure)) matching (((Matching unit) is A town-hall-type unit) Equal to True))) x 10)%


Why doesn't this work?



Also how would I trigger the creation of a line of structures from point A to point B, skipping the spots that are unbuildable or unpathable.
 
Level 14
Joined
Jul 26, 2008
Messages
1,009
Wrap [GUI] tags around it.

Also it looks like you are calling a group without having created that group yet.

I could be wrong here, but try making a group variable then grouping all units owned by the Owner of Constructing Unit that match the conditions of being a town hall type, then after that call the group in the Number of Units in(your group).

Should do it, but don't quote me there :X
 
Level 7
Joined
Jan 17, 2010
Messages
61
Try this:

  • Construction Complete
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • ((Triggering unit) is A town-hall-type unit) Equal to True
    • Actions
      • Set TownHalls = (TownHalls + 1)
TownHalls is an Integer variable


  • Building Destroyed
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A town-hall-type unit) Equal to True
    • Actions
      • Set TownHalls = (TownHalls - 1)
  • Construction Bonus
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set Bonus = (TownHalls x 10)
      • Game - Display to (All players) the text: (You have + ((String(TownHalls)) + ( to give you a + ((String(Bonus)) + % completion bonus!))))
      • Wait 0.10 seconds
      • Unit - Set (Triggering unit) construction progress to Bonus%
The main reason yours (and my previous suggestion) wasn't working is you have to have a wait after construction is started before applying the bonus.
Of course this is over simplified for use in a map. i.e. you need additional conditions, variables for different players...
 
Last edited:
Status
Not open for further replies.
Top