Patrol a unit help

Omnizohar

New Member
Reaction score
0
I want to make a unit that will patrol around a unit in a circle form. So hes circling around this unit who is standing still but problem is I dont know how to make my unit patrol in a circle around a unit. Sorry if I didn't explain it clearly.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
well you say the unit is going to stand still ?
then you could make regions all around him and order the unit to attack-move to the next region.
or you could make points around him
 

Komaqtion

You can change this now in User CP.
Reaction score
469
with the regions you coul make a trigger like this:
Event - Elapsed game time 1 second
Action - set Point_Variable[1] to the first region, and do so with every region in order with arrays and then make a trigger for when the unit enters a region and then make if actions for each region
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Code:
Nifty Patrol Trigger
    Event
     Every 2 seconds of gametime
    Condition
    Action
        set udg_angle = udg_angle + 36
        if udg_angle >= 360 then
             set udg_angle = 0
        Unit - Order <Your unit> to Attack/move to ((Position of (<Your target>)) offset by 256.00 towards udg_angle degrees)
(Pseudo code).
That trigger would require a real variable (the udg_angle) to save the last spot (as a degree) the patroling unit was ordered to. When it reaches 360 (a full circle) it will automatically set to 0 again, so the numbers won't get astronomically big after a while. That maybe won't work too well; you'll have to play around with the event interval.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top