HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Casting-Time Spells Insist On Following

08-10-2009, 10:46 PM#1
thehellman
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
Summoner
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
Trigger:
Collapse Events
Unit - A unit leaves (Region centered at (Position of <caster>) with size (<width>, <height>))
Collapse Conditions
(Triggering unit) Equal to <target unit of ability being cast>
Collapse Actions
Unit - Order <caster> to Stop
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
Anitarf
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
Summoner
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
Tot
why not chencking the distance between target and caster?
Expand JASS:
08-14-2009, 04:06 PM#6
Earth-Fury
Quote:
Originally Posted by Summoner
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.

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
Summoner
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
Panto
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
thehellman
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.