Mirror Point

Frosthowl

TH.net Regular
Reaction score
15
Hi everyone, so I currently have two units standing right next to each other. What I need them to do is if one of them runs left, the other runs right. If one of them is ordered to move up, the other moves down. I know how to order the issued move, but I dont know how to mirror the point for the second unit to move to. Please help.
 

Squishy

You can change this now in User CP.
Reaction score
127
When one of them moves, you need to order the other one to move the same distance, but change the direction by 90 degrees.
 

Frosthowl

TH.net Regular
Reaction score
15
wow...that was alot easier than my complex trig equations that didn't work ^.^

But how do I get the ordered units point degrees in order to add 90 to it?
 

noworries

New Member
Reaction score
4
I'm not sure how you'd add 90 degrees, however, here is something I just did with two footman.

Code:
Untitled Trigger 001 Copy
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Ordered unit) Equal to Footman 0001 <gen>
    Actions
        Unit - Order Footman 0002 <gen> to Move To ((Position of Footman 0002 <gen>) offset by (Distance between (Position of (Ordered unit)) and (Target point of issued order)) towards (Angle from (Target point of issued order) to (Position of (Ordered unit))) degrees)

keep in mind, this leaks. Basically its completely mirrored, distance between position of ordered unit and target point is how much it moves, and the angle is already backwards since it is checking from Order Point -> Ordered Unit.
 

Squishy

You can change this now in User CP.
Reaction score
127
That works, I just want to add, if you want to add 90 degrees to an angle, you'd use Arithmetic.
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
610
I would use this

Code:
Mirror
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Unit-type of (Ordered unit)) Equal to Footman
    Actions
        Set OrderUnit = (Triggering unit)
        Set Group = (Units in (Playable map area) matching ((Unit-type of OrderUnit) Equal to Footman))
        Unit Group - Pick every unit in Group and do (Actions)
            Loop - Actions
                Set IssuedUnit = (Picked unit)
                Set Point = (Distance between (Position of OrderUnit) and (Position of IssuedUnit))
                Set Angle = (Angle from (Position of OrderUnit) to (Position of OrderUnit))
                Unit - Order OrderUnit to Move To ((Target point of issued order) offset by Point towards Angle degrees)
        Custom script:   call DestroyGroup(udg_Group)
 

Frosthowl

TH.net Regular
Reaction score
15
Heres what I had before, and it still doesnt work.


Code:
Unit - Order (Picked unit) to Move To ((Position of (Ordered unit)) offset by (Distance between (Position of (Ordered unit)) and (Target point of issued order)) towards (180.00 + (Angle from (Position of (Ordered unit)) to (Target point of issued order))) degrees)
 
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