• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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
364
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 64
Joined
Jan 18, 2005
Messages
27,232
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