• 🏆 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!

Moving a Region

Status
Not open for further replies.
Level 6
Joined
Apr 27, 2006
Messages
186
I have a preset region in my map, I would like to move this region elsewhere when a certain unit casts a certain ability, how do I do this?
 
Level 9
Joined
Jul 27, 2006
Messages
652
Region - Move Region

Theres a action under the Region section, called Move Region.
Hope this helps
:smile:
 
Level 6
Joined
Apr 27, 2006
Messages
186
I've tried that already, it doesn't move regions (it says something like: "Only moves trigger created regions" or something).
 
Level 9
Joined
Jul 27, 2006
Messages
652
Hmmm

You sure?
What kind of region are you trying to move? Is it a variable or a preplaced region?
If its a variable and "Region - Move Region" isnt working then my only suggestion is to destroy and recreate the region...
If its preplaced then i suggest creating a variable and doing the above...
Btw how many times have you tested "Region - Move Region"?
 
Level 6
Joined
Apr 27, 2006
Messages
186
Once is all it really takes :\, and I have already said it was preplaced, oh well, can you explain to me how variable regions work then?
 
Level 9
Joined
Jul 27, 2006
Messages
652
Misread

Sorry i skim read you post...
I dont have much experiance with regions (i use locations) but im pretty sure that you can:
Set VarRegion = PreplacedRegion <gen>
Region - Move Region (VarRegion to TargetLoc)
TargetLoc being the center of the target region position (i think).
I dont have acess to WE atm, but i think this is a close enough guide line...
 
Level 6
Joined
Apr 27, 2006
Messages
186
Doesn't work, and Paskovich wrote somewhere that there was a JASS command to move it, but I didn't understand how to use it :\.
 
Level 9
Joined
Jul 27, 2006
Messages
652
Damn

It doesnt? Damn, then im stumped... If i had my WE i would investigate but atm i cant help you any more, sorry :sad:
 
Level 11
Joined
Oct 13, 2005
Messages
233
There was a command like "Center region on (location)" command I believe. Otherwise, you can call MoveRectToLoc. First, you'll need a variable for the region and for the location to be moved to. Then, you'll make a custom script action and type in: "call MoveRectToLoc(udg_rect_name, udg_location_name)" You would replace rect_name with the variable name of your rect (region in GUI), and any spaces should be typed as _, do the same for the location as well.
 
Level 6
Joined
Apr 27, 2006
Messages
186
So let's say my point's name was "TempPoint" and my region's name was "Bore Tunnel Wyrm <gen>" would this be the correct command?
call MoveRectToLoc(udg_Tunnel_Wyrm_<gen>, udg_TempPoint)
 
Level 11
Joined
Oct 13, 2005
Messages
233
Bore Tunnel Wyrm <gen> is the GUI name for rects that the World Editor generates. It would be easier to set another variable to that, but if you want to use the original, replace the "udg_" with "gg_rct_" and just put in only the rect name (Bore Tunnel Wyrm) without the <gen>.
 
Level 6
Joined
Apr 27, 2006
Messages
186
Didn't work for me either XD. Mabye the problem is with my trigger, here it is:

My ability basically makes a portal between two points, allowing a unit to enter one side and exit out of the other after a duration.

Bore Tunnel Region Move
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Bore Tunnel
((Triggering unit) Not equal to Duelers[1]) and ((Triggering unit) Not equal to Duelers[2])
Actions
Set boreTunneler = (Triggering unit)
Set TempPoint = (Position of (Triggering unit))
Custom script: call MoveRectToLoc(gg_rct_TunnelWyrm, udg_TempPoint)
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\VampiricAura\VampiricAura.mdl
Set boreTunnelEffect[1] = (Last created special effect)
Custom script: call RemoveLocation (udg_TempPoint)
Set TempPoint = (Point(8300.00, 7786.00))
Custom script: call MoveRectToLoc(gg_rct_FountainWyrm, udg_TempPoint)
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Undead\VampiricAura\VampiricAura.mdl
Set boreTunnelEffect[2] = (Last created special effect)
Custom script: call RemoveLocation (udg_TempPoint)

Bore Tunnel Entered Wyrm
Events
Unit - A unit enters TunnelWyrm <gen>
Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Entering unit)) Equal to Player 1 (Red)
(Owner of (Entering unit)) Equal to Player 2 (Blue)
(Owner of (Entering unit)) Equal to Player 3 (Teal)
(Owner of (Entering unit)) Equal to Player 4 (Purple)
(Owner of (Entering unit)) Equal to Player 5 (Yellow)
(Owner of (Entering unit)) Equal to Player 6 (Orange)
(Owner of (Entering unit)) Equal to Player 7 (Green)
(Owner of (Entering unit)) Equal to Player 8 (Pink)
(Unit-type of (Entering unit)) Not equal to Carrier Hawk
Actions
Unit - Pause (Entering unit)
Wait (5.00 - (Real((Level of Bore Tunnel for boreTunneler)))) seconds
Set TempPoint = (Center of FountainWyrm <gen>)
Unit - Move (Entering unit) instantly to TempPoint
Custom script: call RemoveLocation (udg_TempPoint)
Unit - Unpause (Entering unit)
Unit - Set life of (Entering unit) to ((Life of (Entering unit)) + ((1.50 + (0.50 x (Real((Level of Bore Tunnel for boreTunneler))))) x (Max life of (Entering unit))))


Bore Tunnel Entered Fountain
Events
Unit - A unit enters FountainWyrm <gen>
Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Entering unit)) Equal to Player 1 (Red)
(Owner of (Entering unit)) Equal to Player 2 (Blue)
(Owner of (Entering unit)) Equal to Player 3 (Teal)
(Owner of (Entering unit)) Equal to Player 4 (Purple)
(Owner of (Entering unit)) Equal to Player 5 (Yellow)
(Owner of (Entering unit)) Equal to Player 6 (Orange)
(Owner of (Entering unit)) Equal to Player 7 (Green)
(Owner of (Entering unit)) Equal to Player 8 (Pink)
(Unit-type of (Entering unit)) Not equal to Carrier Hawk
Actions
Unit - Pause (Entering unit)
Wait (5.00 - (Real((Level of Bore Tunnel for boreTunneler)))) seconds
Set TempPoint = (Center of TunnelWyrm <gen>)
Unit - Move (Entering unit) instantly to TempPoint
Custom script: call RemoveLocation (udg_TempPoint)
Unit - Unpause (Entering unit)
Unit - Set life of (Entering unit) to ((Life of (Entering unit)) + ((1.50 + (0.50 x (Real((Level of Bore Tunnel for boreTunneler))))) x (Max life of (Entering unit))))
 
Last edited:
Status
Not open for further replies.
Top