Move a region

Status
Not open for further replies.
Level 9
Joined
Sep 20, 2015
Messages
385
Hello, i need help for this issue. I need to move a region in a point, to add the wind effects. But if i use the - move region - trigger it does't work. I tired to set the region to a varialbe (cause it's written in the bottom of the window) but still not working...

Ty
 
Level 4
Joined
Jun 22, 2016
Messages
71
The weather doesn't move with the region. I just made a quick test map and tested it by moving the region and creating a special effect. The new effects are moving but not the starting location of the weather.

I've added my test map to attachments to help show what it's doing. Note JASS Checker has found memory leaks with this quick map I made. I don't know how to fix region leaks.
 

Attachments

  • test.w3m
    16.4 KB · Views: 41
Level 13
Joined
May 10, 2009
Messages
868
[...] Note JASS Checker has found memory leaks with this quick map I made. [...]
  • Region - Center r on ((Center of r) offset by (-200.00, 0.00))
Both (Center of r) and ((point) offet by (x, y)) create and return a point/location data type.

(Center of r):
JASS:
function GetRectCenter takes rect whichRect returns location
    return Location(GetRectCenterX(whichRect), GetRectCenterY(whichRect))
endfunction

Offset:
JASS:
function OffsetLocation takes location loc, real dx, real dy returns location
    return Location(GetLocationX(loc) + dx, GetLocationY(loc) + dy)
endfunction

So, it should be like this:
  • Actions
    • Set p1 = (Center of Region 000 <gen>)
    • Set p2 = (p1 offset by (-200.00, 0.00))
    • Region - Center Region 000 <gen> on p2
    • -------- [...] --------
    • Custom script: call RemoveLocation(udg_p1)
    • Custom script: call RemoveLocation(udg_p2)
 
Status
Not open for further replies.
Top