• 🏆 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] Making a Burrow Spell

Status
Not open for further replies.
Level 6
Joined
Jan 13, 2013
Messages
129
So I want to make burrowing spell that will allow the hero to fire out spikes as long as they have mana. So far my initial idea is that I would play the morph animation for the crypt fiend, hide the model (0% transparency maybe), place a dummy unit on top of the burrowed crypt fiend for the hole, remove the hero's ability to move or attack (literally remove attack from the command card) and add an ability to fire the spikes to the command card. Base burrow on immolate and fire spike on finger of death. I don't want to screw around with alternate units from the actual burrow spell as I know it can cause all sorts of issues in conjunction with other custom systems.
I'm using Jass, not looking for someone to write the ability for me just some tips from people who know how to achieve this better or have made similar abilities. For example if its possible to actually get the model to play the morph animation and then remain in the burrowed form without changing the unit type that would be awesome.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
I think what you're wanting is pretty much what you've already said.

Cast the ability.
Make transparency 0% of the caster so it's "invisible"
Create a dummy unit that is the the Crypt lord / Crypt fiend
Then use SetUnitAnimationByIndex( u, index) I think the burrow one is like 8 ( you can easily figure this out)
Then whenever this spell ends you either can play the Unburrow animation by the same function and reset the transparency of the real unit.

If you use a toggle spell like immolation (ie costs mana) the unit will automatically turn off immolation when it runs out of mana, just be sure to keep that in mind and have your code check so you properly can get rid of the dummy if the burrow should "end" without the unburrow being used.
 
Level 6
Joined
Jan 13, 2013
Messages
129
Mhm, I've used a few other toggle spells so I've got that part figured out. The animation was one I thing I havn't been able to get to work but I was using a function that took animation strings so I'll try that index one instead. Thanks a ton!
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
I have seen this spell on a spellpack before but coded on vJASS. You could check the burrow animation name on magos.

Edit: It can be toggle artificially using triggers but might come in handy instead of default toggles.
 
Status
Not open for further replies.
Top