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

Order unit to auto cast in a region?

Status
Not open for further replies.
Level 3
Joined
Aug 15, 2007
Messages
37
What I'm trying to do, is to get my worker (acolyte) to harvest Magic from a gold mine. (Without actually getting any gold)
First, I tried editing the gather(acolyte gold) ability. Failed
Then, I tried editing the gold mine ability. Failed
Then, I tried to create a dummy effect where I placed a region around the mine, then triggered my worker to change animation into work gather gold. Almost didn't fail.
I used a "When unit enters a region" event
cond - "Unit-type of entering region = = worker"
act - tempUnit = entering unit
wait
setUnitAnimationByIndex
wait
run this trigger

I used the last "run this trigger" action because it played the animation only once, freezing on the last frame. (I know that's sloppy. Suggestions?)

The problem was, that if multiple units were ordered to the mine at the same time, only one unit would play the animation.
I would like to just manipulate the gather ability somehow, but I'm not sure how to do it. Without adding gold anyway.
Thanks.
 
Level 4
Joined
Jul 12, 2007
Messages
116
  • GOLD
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Player - Set (Owner of acolyte) Current gold to 0
      • Neutral Building - Set (The Haunted Gold Mine) to 12500 gold

Its kind of simple but it works.

And just use the issue order to target a unit action to order the acolyte to gather.
 
Last edited:
Level 4
Joined
Jul 12, 2007
Messages
116
Your
welcomeani.gif
 
Level 9
Joined
Sep 8, 2004
Messages
633
Do mind that triggers like these have a really negative effect on your map's stability and CPU load. There are definately better ways. A simple and nice work around I like to use is putting the "gold" mined to a good use! You just change the interface's gold icon with something you need, like "Magic" and change some text around in the interface options. Then you can use the "gold" which is now magic to do other things, like "buy" spells, or a way to see your current "magic" level, the possibilities are endless.

Summarized, I do not at all recommend you to use a "every 0.1 seconds" trigger.
 
Status
Not open for further replies.
Top