Make units move in a circular fashion

Zealot

Member
Reaction score
11
I'd like to know a way using GUI to make a unit move in a way the lightning shield orbs move around a hero or make the unit move in a random direction in a region around a hero but it can't go out of the hero's invisible region borders (only if it didn't catch up). I'd like a way using (move unit instantly) instead of the order functions. Is there any way? :confused:
 

Moridin

Snow Leopard
Reaction score
144
I'd like to know a way using GUI to make a unit move in a way the lightning shield orbs move around a hero

I've actually made a spell that uses this. Here, for just the movement you would need the first 3 triggers. You can ignore most of the configuirables and the actions meant to start the 4th and 5th triggers.

Or, if your idea is similar, you could just use the spell entirely. :p

make the unit move in a random direction in a region around a hero but it can't go out of the hero's invisible region borders (only if it didn't catch up). I'd like a way using (move unit instantly) instead of the order functions. Is there any way?

I don't exactly know what you mean by this, but there IS a way used for moving units around without ordering them. It's called sliding. Essentially you have a very fast periodic trigger (0.03 to 0.08) and constantly shift the units position by very little, instantly. This gives the illusion that it is "sliding" along the ground, along a set path.
 

Zealot

Member
Reaction score
11
Thanks Moridin I wil ltry to understand how to make a unit spin from your triggers instead of outright copying it.

I don't exactly know what you mean by this, but there IS a way used for moving units around without ordering them. It's called sliding. Essentially you have a very fast periodic trigger (0.03 to 0.08) and constantly shift the units position by very little, instantly. This gives the illusion that it is "sliding" along the ground, along a set path.

I know about the sliding thing, but I don't know how to make the unit to actually move in random directions ,when I try I end up with a unit that can go in one direction only, both ways, but even so only one direction.
 

Moridin

Snow Leopard
Reaction score
144
Well, you can copy my work if you want to. That's why it's in the Resources section. :p

At the same time, it would be good if you understood what was happening so you would know how to change it according to your needs.

but I don't know how to make the unit to actually move in random directions ,when I try I end up with a unit that can go in one direction only, both ways, but even so only one direction.

I still don't understand exactly what you want. What do you want to happen?
 

Zealot

Member
Reaction score
11
I want the unit to move randomly around the hero, the path being as unpredictable as possible, like instead of it moving circularly around the unit it goes berserk in any direction it wants but it still remains around the hero.
 

Moridin

Snow Leopard
Reaction score
144
Oh. That's still pretty easy. What you do is this essentially. Create the unit at the location of the hero. Bring up a random point around the hero in a certain radius and save it's location relative to the hero (easily done using offset). Then you use a slide trigger to move the unit there, while constantly refreshing the relative location, so it moves with the moving hero. Have a real variable store the distance traveled by the point, and when the distance traveled = the distance to the point (implying it's gotten there), you can use this event:

Game - Value of Real variable

To detect the moment the real variable = the distance its supposed to travel. When the trigger with this event fires off, just set a new random point relative to the hero and repeat.
 

Zealot

Member
Reaction score
11
I will try that, but until I managed to take from your triggers what I wanted and I now see what causes the unit to rotate. But what is the integer A for? Is it because you were using multiple units?

Trigger:
  • EN Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Explosive Sling
    • Actions
      • Set FireNado_Caster = (Casting unit)
      • Trigger - Turn on EN Spin <gen>
      • Unit Group - Add (Triggering unit) to EN_casters
      • Set temp_point = (Position of (Triggering unit))
      • Set temp_point_2 = (temp_point offset by 100.00 towards ((Real((Integer A))) x 120.00) degrees)
      • Unit - Create 1 Fireball for (Triggering player) at temp_point_2 facing Default building facing degrees
      • Set FireNado_Tornado1 = (Last created unit)
      • Custom script: call RemoveLocation (udg_temp_point)
      • Custom script: call RemoveLocation (udg_temp_point_2)
      • Set EN_Current_angle[(Integer A)] = ((Real((Integer A))) x 120.00)


Trigger:
  • EN Spin
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set EN_Current_angle[(Integer A)] = (EN_Current_angle[(Integer A)] + 12.00)
      • Set Current_unit = FireNado_Tornado1
      • Set temp_point = (Position of FireNado_Caster)
      • Set temp_point_2 = (temp_point offset by 50.00 towards EN_Current_angle[(Integer A)] degrees)
      • Unit - Move FireNado_Tornado1 instantly to temp_point_2
      • Custom script: call RemoveLocation (udg_temp_point)
      • Custom script: call RemoveLocation (udg_temp_point_2)
 

Moridin

Snow Leopard
Reaction score
144
Yes the integer A was because there was a possiblity of more than 1 bomb. It cycled from 1 to the max number of bombs, allowing the looped actions to to work on each one of them.

These actions will not work, seeing as there's no "Integer A".

Set temp_point_2 = (temp_point offset by 100.00 towards ((Real((Integer A))) x 120.00) degrees)

Set EN_Current_angle[(Integer A)] = (EN_Current_angle[(Integer A)] + 12.00)

Set EN_Current_angle[(Integer A)] = ((Real((Integer A))) x 120.00)

Set temp_point_2 = (temp_point offset by 50.00 towards EN_Current_angle[(Integer A)] degrees)

But otherwise the trigger will work :). You just need to replace that with something (1 will work for you btw). Replacing all the integer As with 1s will work.

You should also realise that because you don't have many units to slide, you don't need the EN_Current_angle real variable to be an array.
 
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