• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[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