• 🏆 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!

Auto cast spells like in vampire survivors/halls of torment

Level 2
Joined
Jul 18, 2023
Messages
2
I'm currently messing around with the editor and trying to make a game like vampire survivors/halls of torment. The main feature for this game is that abilities casts automatically depending on attack speed. So does anyone know if this is even possible in the editor? I want abilities to be cast at the direction the player is facing, the only concern of the player should be to move the character.

So if we take a spell like shockwave I want it to be auto cast without any form of player interaction and within a certain interval, like every 3 seconds a shockwave is cast at the direction you're facing. My current idea is that I need a trigger that automatically casts spells when the cooldown is finished, that way I can use the cooldown as "attack speed". Would appreciate your insights on this issue as the rest of the games features would be easy to implement.
 
Level 12
Joined
Jan 10, 2023
Messages
191
Autocast is wrong for a few reasons, because it won't interrupt a direct attack order or move order.

It sounds like we want an ability that will fire off, regardless of conditions, based on the unit's attack speed.
Or maybe not based on attack speed, I suppose if the unit is to be moving while using shockwave you might want it to be independent of the attack speed ?

I would assume that ideally it won't interrupt the unit's order queue since movement orders seem to be a key aspect, this is easier said than done, but if you're willing it can be done.

If you want to use attack speed, say so because getting the unit's attack speed will be a process of its own.



Periodically:
1. stun the caster for however long the caster's spell animation should take
2. make the unit play the animation for the shockwave
3. place a dummy at the caster's location
4. order the dummy to cast shockwave at the target location based on the angle the unit is facing
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,579
I think he wants it to work exactly like Vampire Survivors.
My current idea is that I need a trigger that automatically casts spells when the cooldown is finished, that way I can use the cooldown as "attack speed"
He doesn't actually mean the speed of a unit's basic attack. I think attack in this case means dealing damage, debuffing or anything offensive.

Here's a map I threw together, I was originally going to make it a bit more advanced but I got lazy and figured it might become overcomplicated. This design should get the job done, hopefully it's easy to understand.

I've set it up to use Powerups as the means to learn a new spell or upgrade an existing spell, but it can easily be modified to use any kind of Event.
 

Attachments

  • Vampire Survivors Idea 2.w3m
    49.4 KB · Views: 11
Last edited:
Level 2
Joined
Jul 18, 2023
Messages
2
I think he wants it to work exactly like Vampire Survivors.

He doesn't actually mean the speed of a unit's basic attack. I think attack in this case means dealing damage, debuffing or anything offensive.

Here's a map I threw together, I was originally going to make it a bit more advanced but I got lazy and figured it might become overcomplicated. This design should get the job done, hopefully it's easy to understand.

I've set it up to use Powerups as the means to learn a new spell or upgrade an existing spell, but it can easily be modified to use any kind of Event.
Dude wtf are you kidding me, this is amazing. Why did you stop making the game? The spells work flawlessly, I'm definitely gonna steal all your stuff.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,579
Dude wtf are you kidding me, this is amazing. Why did you stop making the game? The spells work flawlessly, I'm definitely gonna steal all your stuff.
Thanks, feel free to use it.

I made that map last night in about an hour or so. It's a pretty easy concept once you know what to do!

Also, inside of the Systems folder in the Trigger Editor you'll find something called a Unit Indexer. It's a very useful system for storing data directly to a unit, but in this case I actually never used it. Feel free to delete it if you don't play on using it. The GUI Simple Timers (GST) system is needed though since my VS triggers take advantage of it, so don't delete that. That system is used to make Timers easier to use in GUI (the standard trigger editor).
 
Last edited:
Top