• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Moving Regions?

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I was wondering if its possible to move the physical location of a region. For example, moving a region on the side of the map to the centre, or the position of a unit.

  • test
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Region - Center Region 8 <gen> on (Center of (Playable map area))
This trigger did not work (dont comment on leaks, its just a test)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
This is not possible. Regions are a collection of cells appended individually or in a square by a rect.

You can however move rects. I believe GUI refers to "regions" incorrectly when they are infact rects but one can never be sure so it is recommended to not use GUI.

JASS:
native MoveRectTo takes rect whichRect,real newCenterX,real newCenterY returns nothing
native MoveRectToLoc takes rect whichRect,location newCenterLoc returns nothing

Do be aware that the enters region event uses regions. As such changing the position of the rects you used to contruct the region will not change the region that gets tested for unit entry. I am guessing this is how you tried to test if the action worked?
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Im not sure what your last sentence actually means. But to test if the region moved, i created a weather effect over "Region 8". After 5.00 seconds (elapsed time), i did not see the weather effect move to my designated point. So i concluded the region was not moved.

How do you reccomend I edit that jass line to suit my needs? Do i write those jass lines into "custom script"? I need a trigger in my map which periodically moves a region to a unit's position. Im nooby at jass.
 
Level 2
Joined
Dec 22, 2011
Messages
9
The region in WE cannot be moved via triggers i think.

Maybe just use triggers to create a new region centered around where you want it to be and delete the old region >.>
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Parasite EX (an old WC3 map) used movable rects for its bomb system so I garuntee you that you can move editor defined rects with script. That is unless Blizzard some how managed to break it in one of their patches (which seems unlikly).

How do you reccomend I edit that jass line to suit my needs? Do i write those jass lines into "custom script"? I need a trigger in my map which periodically moves a region to a unit's position. Im nooby at jass.
You use it like you do any other jass native.
JASS:
call MoveRectTo(YOUR_RECT,0,0) // this will move YOUR_RECT to the origan of the map
I am prety sure the GUI one does work though. Maybe you were creating the weather effect before you moved the rect.
 
Status
Not open for further replies.
Top