• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Clickable Spell while moving

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Hi all.

I'm making a top-down shooter and I'm having trouble figuring out how to have a clickable spell that can be clicked while a unit is being moved via triggers.

Something along the lines of keyboard event, but not with a spell because in order to have the spell fire, the unit has to stop moving and its a bit tedious especially since I'm making a top down manic shooter where the player will have to dodge too many bullets and shoot at the same time.

Any ideas?
 
Level 12
Joined
Oct 16, 2010
Messages
680
use channel as dummy ability and set art duration,cast time, follow through time to 0.
then it wont breake by movement

but anyway if u move the unit via trigger then it never should be a problem either... unless u use GUI move unit that calls a stop order
 
Last edited:

sentrywiz

S

sentrywiz

use channel as dummy ability and set art duration,cast time, follow through time to 0.
then it wont breake by movement

but anyway if u move the unit via trigger then it never should be a problem either... unless u use GUI move unit that calls a stop order

I am using channel with everything you said to 0. But like I said, when I am moving the unit, the unit cannot cast a spell. So I must stop moving the unit, then it casts a spell.
 

sentrywiz

S

sentrywiz

Do you mean that when you are walking and you cast an ability, you must continue to walk?

The unit gets moved via triggers every 0.05 seconds up to 50 range in a direction. During moving, I cannot cast anything, because clicking the ability does nothing until the unit stops, has a split second to start the effect then the spell fires.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Try some JASS functions.
Instead of moving unit with
  • Unit - Move (Unit) instantly to (Location)
Try moving it this way:
  • Custom script: call SetUnitX(udg_Unit,GetLocationX(udg_Location))
  • Custom script: call SetUnitY(udg_Unit,GetLocationY(udg_Location))
If Unit is not a variable, then you'll need to use a function to get it.
For instance, "Triggering Unit" is "GetTriggerUnit()".
 

sentrywiz

S

sentrywiz

I thought of Berserk, but didn't try it. I thought Channel is better. I'll give it a try
 
Status
Not open for further replies.
Top