| 07-17-2003, 01:53 AM | #1 |
I just wanted to know how to make a spell(called Tomeup) which Kills the target unit while converting its life into attributes for the hero.I tried and failed horribly. Method 1:Use the Generic Unit Event Begins Casting EVENTS: A Unit begins casting an ability CONDITIONS: Ability being cast equal to Tomeup Actions: Special Effect-Create on casting unit in overhead using Abilities/Spells/Human/Blizzard/BlizzardTarget.mdl Unit-Kill Targeted Unit of Issued Order The Problem with this is that there is no event to match the TARGETED UNIT OF ISSUED ORDER so the computer never detects the unit the spell is being cast on.I tried to find an Event Response which has something like Target Unit of Casted Ability but I cannot find one.This simple approach did not work for me.I already tried detecting an order string and then storing the targeted unit but doing that is too tedious and involves too many variables.For example say if the if they targeted one unit with tomeup but before reaching it(since its out of range) targeted another unit and other things along those lines.The biggest problem im having is somehow detecting the targted unit of the spell being cast.Please help me with this problem if you can. |
| 07-17-2003, 07:59 AM | #2 |
Unfortunately Blizzard did indeed forget the event reactions for the casting events. So I fear you have to store the order target. I guess the best solution is to store the target per caster unit by putting the targets in an array and storing the index in the user data field of the caster unit. |
| 07-17-2003, 04:05 PM | #3 |
OMG I was so infatuated with trying to find a way that i could not see the simple solution right before my eyes. Thx Andy you helped alot man. I was thinking Ill store the targets and orders and stuff but the real simple solution would be to just store the targets in an array of 12 spots and then detect the ability being cast do the corresponding thing on the target. To deal with any other or cancelations of targets before they got in range i would be able to use the same trigger I used to store the targeted unit in the first place. The Player number thing would also help alot.Personally I am ashamed to take help from people like this but I guess sometimes a little help dont hurt. Believe me this was my last resort and it worked out perfectly thx to u. |
| 07-19-2003, 11:18 AM | #4 |
What is the user data field? emote_sweat And how do one access it? |
| 07-19-2003, 09:26 PM | #5 |
It is there since TFT, and it can be accessed by these natives: native GetUnitUserData takes unit whichUnit returns integer native SetUnitUserData takes unit whichUnit, integer data returns nothing |
