• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Movement of unit around of another unit

Status
Not open for further replies.
Level 3
Joined
Oct 20, 2017
Messages
52
Hello guys, I'm having trouble creating a trigger that orders a unit to move in round from another unit.
Sorry for my English ; -;
Trigger to create the unit that goes around the caster:
  • Create Unit
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Summon_Unit(Spell)
    • Actions
      • Set Caster = (Triggering unit)
      • Unit - Create 1 Faerie Dragon (Custom) for (Triggering player) at (Position of Caster) facing Default building facing degrees
      • Set Summon_Unit = (Last created unit)
Shoot the order of movement of the created unit, but it is very likely that you are having difficulty, because I wanted to place an order to move around the caster:
  • Movement
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • -------- UnitMovement --------
      • Set Point_Movement = (Random point in (Region centered at (Position of Caster) with size (300.00, 300.00)))
      • Unit - Order Summon_Unit to Move To Point_Movement
Can someone help me?
 
Last edited:
Level 17
Joined
Mar 21, 2011
Messages
1,611
It should work as long as there is only one unit with this ability.
Also, your variables have to be unique to this trigger.

Side notes:
-you should disable the Movement trigger and enable it as soon as the ability is learned.
-you are leaking periodically
 
Level 3
Joined
Oct 20, 2017
Messages
52
I know, but I realized that the unit moves only in a region that is in front of Caster, but I wanted Caster to be in the center of the region.
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
  • Set VariableSet loc_caster = (Position of some unit)
  • Set VariableSet distance = (Random real number between 0.00 and 300.00)
  • Set VariableSet angle = (Random real number between 1.00 and 360.00)
  • Set VariableSet loc_polar = (loc_caster offset by distance towards angle degrees.)
  • ...Order unit to move to loc_polar
  • RemoveLocation...
 
Status
Not open for further replies.
Top