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

Need help with a spell - Fear.

Status
Not open for further replies.
Level 12
Joined
Nov 5, 2007
Messages
730
I have literally no ideas on how to do this, any help would be appreciated.

Fear - All enemy units within x AoE of the caster will flee in terror for x seconds.

The player should lose control of his units, and they should run away from the caster in this manner:

lolsf.png


The units should have the fear buff on them, if it disappears for any reason, they should stop running away.

Whoever provides any help will be +repped, thanks in advance.
 
Level 4
Joined
Jan 9, 2010
Messages
89
I think I have made what you want here. Try the spell and see if it's what you need. Unfortnately, after about an hour I could still not get the unit animations to work. Could anyone fix that?
 

Attachments

  • Fear.w3x
    18.5 KB · Views: 64
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well there are a few ways to do this. You could have a periodic timer that orders affected units to move away from the caster. In this case, the timer would be expiring so quickly that its impossible to over-ride it with user clicks.

Another nice way of doing this would be to detect when the affected units are issued any orders, and then cancel the order and re-issue the "scared" move-away order. This may be the best way to approach your problem. In order to detect when the buff is removed you would have to have a timer that checks the buff's level (if it's 0, it's gone).

ED_Reborn said:
I think I have made what you want here. Try the spell and see if it's what you need. Unfortnately, after about an hour I could still not get the unit animations to work. Could anyone fix that?

Well it doesn't look like you tried using Animation - Set unit animation (or SetUnitAnimation), but that wouldn't give you a nice looking effect either. You would have to use the JASS-only function, SetUnitAnimationByIndex. Either way, you don't want to ignore pathing for units that have "Fear".
 
Level 12
Joined
Nov 5, 2007
Messages
730
Damn, the spells is just what I wanted, but the animation is really a problem.

Berbanog, is it possible to combine the JASS function with the trigger so the animations show properly?
 
Level 4
Joined
Jan 9, 2010
Messages
89
I gound out what is wrong with the animations. It was my "clever" move to use warstomp as the spell /facedesk.

Change it to thunderclap, or maybe roar or something.
 
Level 12
Joined
Nov 5, 2007
Messages
730
I changed it to Howl of Terror, and being that the animations were still bugged, I changed your move unit instantly trigger to order unit to move every 0.15 seconds (smallest interval I can use if I want the animation to work decently).

Do you think that the interval is small enough? I'm a bit concerned about players overriding it with other orders, I'll test it now... Any other ideas if it doesn't work?
 
Level 4
Joined
Jan 9, 2010
Messages
89
I never kept the animations in the spell after i had tried it.

I think I know how you could fix it though. Make it move instantly again, and then add a boolean value to the hashtable. In in the trigger where i move the units you add an if/then/else and compare that boolean, and then adding the animations in the then section and setting the boolean to the opposite.

Also, it leaks too much -.- (I was tired)

Another thing is that, as berbanog said, it ignores the pathing. I have no idea on how i would fix that though.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I don't know why you're using SetUnitPosition to move the units, when you could just as easily order them to move to a certain point. I already gave you a few methods of removing unit control from a player.
 
Status
Not open for further replies.
Top