Causing Unit Fear

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
Hey guys,

I've got a problem. I'm needing a unit to run away if they come to close to an object.

Basically you can place down torches, and i was wanting any units owned by Player 12 to run away from these torches if they go near them. Any ideas?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Unit Within Range? It doesn't exactly matter where the torch is, since all you need is for the approaching unit to run in the opposite direction.

You could use Immolation or an aura, periodically check for the buff and move units with the buff away.
 

xtian07

Member
Reaction score
2
If the player 12 is controlled by a computer player, then this might work
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit comes within 500.00 of Torch 0000 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Unit - Order (Triggering unit) to Move To ((Position of Torch 0000 <gen>) offset by 1000.00 towards (Random angle) degrees)

Note: Make a unit with any building as a base. Remove all unnecessary stuffs from the building then set the model, Icon and Name of building to Torch.
Hope this helps :D
 

chukky-jr

Member
Reaction score
15
^the random angle is actually not a very good choice, since if unit come from angle of 180 and the generated random angle is 0, then that unit will actually come close to the torch to cross it to reach that random point

i suggest using what xtian07 said but instead of using random angle, keep track of angle that unit came from, then use it for each corresponding unit, something along 'angle between torch and unit' might work (i guess)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
give the torches a 1 imolation and every second have it cast silence at its position where it disables attacks but not casting for 1.5 secs

then grab a damage detection system (like Weeps GDD)

and then do something like this:

Events
-Variable - GDD_Damage_Event becomes equal to 0.00
Conditions
-Unit Type of GDD_Damaging_Unit is equal to (your torch)
Actions
-Unit - Order GDD_Damaged_Unit to stop

PS. wc3 tags are messed up for me
PPS. My version will work if extra torches are placed and xtians wont, but mine is a little harder to implement
 

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
The torches are NOT preplaced. I'll probably use a buff detection system instead.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Torch gets placed > Add New Event: A unit comes within 400 of (Placed torch).
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Trigger:
  • Torch Add Event
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Torch
    • Actions
      • Trigger - Add to Torch Approach <gen> the event (Unit - A unit comes within 400.00 of (Summoned unit))

Trigger:
  • Torch Approach
    • Events
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint2 = (TempPoint offset by 500.00 towards ((Facing of (Triggering unit)) + 180.00) degrees)
      • Unit - Order (Triggering unit) to Move To TempPoint2
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call RemoveLocation (udg_TempPoint2)

Something like this?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top