• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Merge regions

Status
Not open for further replies.
Level 5
Joined
Feb 1, 2009
Messages
107
Quite simply, how do I merge regions using JASS? :)
Describing it better: Taking Reg1, Reg2 and Reg3 and making them work as a single region
 
Level 5
Joined
Feb 1, 2009
Messages
107
Well since Regions and Rects are not the same and WE describes Rects as Regions in GUI. What you need to do is add you rect to a region with a native calle
JASS:
RegionAddRect takes region A, rect B returns nothing

So, if you have a global region that you add your rects to it would work

Sorry, I just started using JASS... can you describe it a little bit more?

First of all, I don't know what a Rect is. If I draw a region with the region pallete, how do I know it's a rect or region?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
To be more precise:

A "rect" in jass is a GUI region (as well as the regions you make through the region palette).
A "region" in jass is an "area" that can contain specific rects and points.

However, when you use the "Unit enters region" event, you are in fact using jass regions, and not gui regions (i.e. rects). If you use that GUI action on a gui region, the rect is converted into a region (through creating a new region and adding the rect to the region)
 
Level 18
Joined
Oct 18, 2007
Messages
930
To be more precise:

A "rect" in jass is a GUI region (as well as the regions you make through the region palette).
A "region" in jass is an "area" that can contain specific rects and points.

However, when you use the "Unit enters region" event, you are in fact using jass regions, and not gui regions (i.e. rects). If you use that GUI action on a gui region, the rect is converted into a region (through creating a new region and adding the rect to the region)

Excactly what i was trying to say :D
 
Level 5
Joined
Feb 1, 2009
Messages
107
That's cool! I understand it now. I'll probably have to learn how to add rects to regions, though. Maybe setting a region variable using JASS, and adding the rects to that variable? If I do it like this, all my "unit enters (region)" events will need to be done in JASS too, right? Or can I do it in GUI and set the (region) to the variable I created using JASS?
 
Level 18
Joined
Oct 18, 2007
Messages
930
No all of your events will have to be done in JASS. My advice is, don't use GUI in JASS. Use JASS in GUI by all means, to remove leaks which can't be removed with plain GUI, but don't put loads of custom scripts in a GUI trigger, effectively making it JASS. It just looks ugly. Either stick to JASS or GUI (I'd recommend JASS).

So true.. :D
 
Status
Not open for further replies.
Top