| 08-03-2007, 06:03 AM | #1 |
I don't know how to word this correctly, so, I'll try my best. I'm trying to create a trigger that will make an Auto-Casted ability automatically cast on a unit (Gold Mine) within range. This will allow it to stand near the unit (Gold Mine) to gain gold everytime the auto-casted ability is finished casting. I don't know if my triggers are incorrect, or if I'm just using a whacky spell to base it off of. The spell I'm basing it off of is the unit ability "Heal." The only problem is when more than one unit is trying to cast the ability on the Gold Mine, it says "Unit is already being healed." The trigger goes like this: Trigger: Any help is appreciated. Thanks. |
| 08-03-2007, 06:45 AM | #2 |
The problem is that heal is hardcoded not to allow more than one heal to be used on the unit at once. Try a different auto-cast ability. I don't know what one. Just experiment though, you'll find one. |
| 08-03-2007, 08:59 AM | #3 |
I think what limits you from having multiple heals is the heal buff. Unfortunately, it seems it's duration is hardcoded to be either one second or to equal the cooldown of the heal ability. A good autocast ability might be hard to find, instead, you could try a regular ability and reorder it's casting with your gain gold trigger. The tricky part here is that you would need to wait until the end of the cooldown, and using the bugged "casting unit" and "target unit of ability being cast" after a wait is a no-no. You can use the not bugged "triggering unit" instead of "casting unit", but for the "target unit of ability being cast" you would need to store it to a local variable before the wait. Also, use the event "starts the effect of an ability" rather than the one you're using now. |
| 08-03-2007, 03:51 PM | #4 | |
Quote:
Oh, ok. So, what you're trying to say here is that it'll take me a while to find a good auto-cast. Hmm.. I see.. Thanks for the post, I'll try it out. |
| 08-03-2007, 04:57 PM | #5 |
I think Anitarf's method would work best. Simply add another action that says "Issue order targeting a unit", and make the triggering unit cast it on the original target unit. I'd do it in JASS for you, but I've got no time. But it's fairly simple. Just store the casting unit and the gold mine unit in 2 local unit variables, add the gold, wait a short time (a second would work), and then issue the order again. |
| 08-03-2007, 08:22 PM | #6 |
Alright, so, I don't quite get it, sorry.. I'm not very good with World Editor. I stored the casting unit and the gold mine in two local variables, but then I got stuck. I'm doing "Issue Order Targeting a Unit" and setting my caster to cast a spell on the Gold Mine. I don't know if I did it right, but I can only allow them to cast actual spells, and not the custom spell that I made. I made gold out of the original spell "Storm Bolt," but I don't know if that's right. Trigger: |
| 08-03-2007, 08:31 PM | #7 |
That is the correct way to issue the order. Issueing a unit to cast one of the original spells will make it cast any spell based on that original. Are you sure your stormbolt can target the gold mine? Perhaps try a non-offensive spell for a base (inner fire). |
| 08-03-2007, 08:34 PM | #8 |
Well, see, the thing is my gold mine isn't actually a gold mine, it's just a unit in control of an enemy player that was based off of a Farm and modeled into a Gold Mine. So, technically, if I allow Storm Bolt to target a mechanical or structural unit, it should work. I should use Inner Fire, shouldn't I, so I can auto-cast the spell? My objective is to allow units who have the auto-cast ability on auto-cast to gain gold when they're next to the Gold Mine. |
| 08-03-2007, 09:07 PM | #9 |
you can do something like this (it is how i detected an autocast in a map before) Just make the buff for the spell that gives gold give a buff named Gold This also checks for the Goldmine unit in range doesn't matter who controls it |
| 08-03-2007, 10:32 PM | #10 | |
Quote:
|
