Region Edge to Other Edge

BlackRose

Forum User
Reaction score
239
I want a unit to move from one point which is on the edge of the region to another edge... so it travels from like one edge to another.

attachment.php


How'd I go about doing this [potentially in the simplest most understable answer]?
 

Rushhour

New Member
Reaction score
46
JASS:
local real startX1=GetRectMinX(gg_rct_yourRect)
local real startY1=GetRectMaxY(gg_rct_yourRect)
local real targetX1=GetRectMaxX(gg_rct_yourRect)
local real targetY1=GetRectMinY(gg_rct_yourRect)
//order unit to move from startX1,startY1 to move to targetX1,targetY1
//moves from top left to bottom right

local real startX2=startX1
local real startY2=targetY1
local real targetX2=targetX1
local real targetY2=startY1
//moves units from bottom left to top right

call SetUnitPosition(unit,startX1/2, startY1/2)
call IssuePointOrder(unit,targetX1/2,targetY1/2)
 

BlackRose

Forum User
Reaction score
239
Is that from one random point on the edge to another random point of the opposite edge?

Looks like Corners.
 
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