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

[Solved] Simple GUI Fear Spell

Status
Not open for further replies.
Level 21
Joined
May 29, 2013
Messages
1,567
I'm trying to make a Fear spell that makes an enemy unit run out of control for a duration of time and prevents it from attacking and casting spells.

I absolutely suck at making triggers, so I've tried to make it as simple as possible. Anyway, I based my custom Fear spell on Drunken Haze, since it has an option to prevent attacks and spells (like Silence).

I want the targeted enemy unit(s) to run around, so I made a trigger that adds the Tornado Wander ability (with edited AoE) to all units that have the custom Fear buff (edited Drunken Haze buff). I know adding the Tornado Wander ability turns the unit's collision off, so I turn it back on in a trigger.

The problem is, when I add the Tornado Wander to the enemy units, they immediately start to follow my units, even though they can't do anything because their attacks and abilities are disabled.

Why does this happen, and how can I make them run around without following my units?
I tried this but it didn't work.
  • FearWander
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Drunken Haze) Equal to True)) and do (Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by (Random real number between 200.00 and 400.00) towards (Random angle) degrees))
By the way, I've tried using this, but it can't be dispelled and sometimes when multiple units are feared, all of them completely stop and just stand there until the duration is over.
 
Last edited:
Level 21
Joined
May 29, 2013
Messages
1,567
Umm... you have mixed things up. You should replace "Matching unit" with "Picked unit" and "Picked unit" with "Matching unit".
Oops! I changed it, but it still doesn't work. The enemy unit turns to a random direction and twitches, but still follows my units.
I also tried intercepting orders like this, but it causes the game to crash when the spell is cast.
  • Trigger
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) has buff Fear) Equal to True
    • Actions
      • Unit - Order (Ordered unit) to Move To ((Position of (Ordered unit)) offset by (Random real number between 200.00 and 400.00) towards (Random angle) degrees)
 
Last edited:
Level 21
Joined
May 29, 2013
Messages
1,567
Because your trigger 'triggers' itself.
You order, he detects an order, he orders, he detects an order... -> crash.
Thank you, I see what you mean, but I don't understand this:
Just had some boolean
Add condition Bool = True
Before ordering, Bool = False,
After ordering, Bool = True
What boolean should I add?
 
Create a variable of boolean type, name it whatever you'd like, Order_Boolean for example, set its default value to True
Add a condition to your trigger:
Order_Boolean = True

In actions, first line should be Order_Boolean = False
Last line has to be Order_Boolean = True.

That way, when your trigger will order your unit to move, it won't trigger again since Order_Boolean will be set to False.
 
Level 21
Joined
May 29, 2013
Messages
1,567
Create a variable of boolean type, name it whatever you'd like, Order_Boolean for example, set its default value to True
Add a condition to your trigger:
Order_Boolean = True

In actions, first line should be Order_Boolean = False
Last line has to be Order_Boolean = True.

That way, when your trigger will order your unit to move, it won't trigger again since Order_Boolean will be set to False.
Thank you so much! It works perfectly now. +rep
 
Status
Not open for further replies.
Top