• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Automated Harvest

Status
Not open for further replies.
Level 2
Joined
Jun 18, 2013
Messages
16
I want make a buildings (like Haunted Mine to build directly on gold mine) and I want to make an ability wich start harvest gold autamated (so no worker need). It is possible and how to make it?
 
Level 16
Joined
Sep 29, 2008
Messages
366
yes it's possible.

you need 3 things

- A custom ability than can turns on/off
- A periodic trigger that responses to ability cast/stops order
- A texttag that shows you the amount of gold harvested.


Just add the custom ability to ur mine and make the trigger to detect when the mine cast its ability.
the periodic trigger will add a certain amount of gold to mine's owner on each execution until it checks the ability is turned off.
On each execution create a text over the mine showing the amount of gold increased.
 
Use haunted gold mine as the base for your building. Then use a periodic trigger like so:

  • Events -
    • Time - Every 1.00 seconds of game time
  • Conditions -
  • Actions -
    • Unit Group - Pick every unit (type of (matching unt)) equal to Harvester) and do
      • Loop - Actions
        • Set Your_Unit = (picked unit)
        • Unit Group - Pick every unit within 10 of (picked unit) (unit of type gold mine) and do
          • Loop - Actions
            • Neutral Building - remove 10 gold from (picked unit)
            • Set tempLoc = (position of (picked unit))
            • Floating Text - create floating text at (tempLoc) that reads +10
            • Floating Text - set permanence to false
            • Floating Text - show (last created floating text)
            • Player - add 10 gold to (owner of Your_unit)
You will also need to destroy leaks. I wrote this without WE so it's not perfect but it should give you an idea. Read the tutorial "things that leak," it's in the triggers and scripts forum.

Have you tried adding the harvest gold ability to a structure along with the return gold ability?

You could also create 5 dummy units to do the harvesting and make them invisible, invulnerable and give them locust. No one would know they were there doing the harvesting.
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,296
You could create an invisible unit to do the mining for you. This unit would be invisible, invulnerable and unselectable so will always mine. Using triggers, when mine is finished you create such a dummy unit and order it onto the mine. This unit will need triggers to kill it when the mine dies.

A pure trigger solution like Legal Ease suggested would probably be the most reliable. Remember to only turn it on when at least 1 such mine exists, otherwise it should be off to save resources.

Such a shame Warcraft III does not have automatic harvester support like StarCraft II has.
 
Status
Not open for further replies.
Top