| 10-18-2003, 02:32 AM | #1 |
I'm making a wonderful little ability called Plague that causes units to be infected with a disease, and any unit infected can also pass it on to nearby units, unlike disease cloud. It starts with a spell targeting an enemy unit. However, I cannot refer to the unit that is being cast upon in the trigger. Right now, I just have it referring to the one doing the casting, so it infects him, but also all of his enemies. How can I refer to the unit I am targeting with the ability? -Tobar :bangH: |
| 10-18-2003, 03:18 AM | #2 | |
Here is an example of a method that works for as many as you want. I wrote this for someone else a while ago. Quote:
Here is what it's doing, in English. Two triggers are required because you can't directly reference the target of an ability. Instead, you save that target when the order is issued, in this case in the 'target' array. To save which index of the array it is in, a custom value is set to the caster. You can retrueve the custom value and therefore the refernced unit when he actually casts. |
| 10-18-2003, 03:52 AM | #3 |
Event Response - Targeted unit of issued Order |
| 10-18-2003, 03:55 AM | #4 |
You can't get the target like that if it's a "Unit finishes casting an ability" event or anything. Only for order issueing. |
| 10-18-2003, 05:15 AM | #5 |
Is there a simpler way just to make it detect what unit I set the order on? I have everything figured except how to make that first part work. NOTE: Not vital, though, as the unit that casts the plague is undead, and thus will be immune, so it could just show up on him instead of on a target. |
| 10-18-2003, 05:34 AM | #6 |
I'll try to explain a bit further, but otherwise Oinkerwinker is correct. I named my unit varible called novaTarget E- a unit issue order targeting an object C- (Unit-type of (Ordered unit)) Equal to () <---- insert the hero that has the spell here C- (Issued order) Equal to (order(frostnova)) <--- now the frostnova would be the order string if you base your spell off frostnova. to find the order string of the ability you based on, go into the ability editor and click on your spell, near the middle there will be a field that says ordersting use. that is the order string for that particilar spell A- set novaTarget = target unit of issued order E- a unit starts the effect of an ability C- ability being cast equals to () <------ insert your spell here A- create SFX on novaTarget <----- or whatever you want, since WE knows who the novaTarget is now. |
| 10-18-2003, 05:40 AM | #7 |
I see, thanks. Use two triggers... wonder why I didn't think of that? And I like to think I'm good at triggering... |
| 10-18-2003, 05:51 AM | #8 |
also if you have we unlimited there is a trigger for this. coulda just used that trigger and it would be easier. |
