| 08-10-2009, 10:46 PM | #1 |
A have a dummy spell off of Channel and it has a 2 second casting time. The problem is, if the target goes out of range before the 2 second casting time is over, the caster will run towards the target, which I don't want. Instead I want it after the 2 seconds, if the target is out of range or has gone into fog of war, the spell simply fails. |
| 08-13-2009, 01:28 PM | #2 |
Is target a enemy or firend? I didn't meet the problem when I try it. Maybe you can use trigger to prevent it. You should turn on a trigger when casting You also should set target unit of ability being cast to a variable in the Channel effect trigger. |
| 08-13-2009, 02:45 PM | #3 |
That trigger won't work, since the "region centered on position of caster" will be run only once, when the map starts. Have you considered using a channeling spell instead of casting time, and doing whatever effect you want when the spell finishes? |
| 08-14-2009, 03:20 PM | #4 |
Why? The position of caster will change when the game operating. It's true that I didn't try the trigger because I didn't meet the problem when I made a spell based on Channel as you said. It's only a trigger in theory. |
| 08-14-2009, 03:28 PM | #5 |
why not chencking the distance between target and caster? JASS:if DistanceBetweenPoints(GetUnitLoc(caster),GetUnitLoc(target))>spellRange then call IssueImmediateOrder(caster,"stop") endif |
| 08-14-2009, 04:06 PM | #6 | |
Quote:
In your example, you create a rect centred at the position of a unit, then register that rect to an event. The rect does not move with the unit. it is simply created at it's position. GUI sucks when dealing with regions and rects. |
| 08-15-2009, 09:44 AM | #7 |
Well, well. That means if I want to make a aura spell with trigger, I will need to use other ways? |
| 08-15-2009, 03:30 PM | #8 |
thehellman, is there any way you could put up your map *or* put up a demo map with your unit and spell placed in it? I don't recall running into your problem, and it would help to see what you're actually working with. |
| 08-24-2009, 04:50 PM | #9 |
I'm using Channel as the dummy spell. Give it a 2 second casting time. Cast the spell on an enemy target, then have the enemy target run into fog (black mask, whatever). The caster with then try to follow the target. I didn't necessarily fix the problem, but I found out the user can just press S and it'll stop. It no longer becomes that big of a problem. |
