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

[JASS] GetTriggeringRegion() and put it in a Region variable

Status
Not open for further replies.
Level 3
Joined
Sep 16, 2007
Messages
21
I searched three forums. I nearly start learning jass. But I need this trigger now.

As far as i understand, to set a region variable, you do;

set TestRegion = GetTriggeringRegion()

I think it also leaks.

Can you please, show me how to get the region, a unit enters and set it a region variable. Then i can create an effect at the center of that region.

I am very good at GUI but there is no TriggeringRegion in GUI.
 
Level 3
Joined
Sep 16, 2007
Messages
21
232ys5.jpg


I add udg_ to the beginning of the region variable. Still doesnt work.
 
Level 11
Joined
Feb 18, 2004
Messages
394
JASS:
constant native GetTriggeringRegion takes nothing returns region
The globals you define in the variable editor with the type name "Region" are of type rect not type region. (Stupid fucking blizzard.)

The "Unit enters a region" event uses this function:
JASS:
function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event
    local region rectRegion = CreateRegion()
    call RegionAddRect(rectRegion, r)
    return TriggerRegisterEnterRegion(trig, rectRegion, null)
endfunction

In short, in the default WE, you can not use GetTriggeringRegion() with the GUI... because it actually uses a region, not a rect... Also, you can't even do what you want with a region (not a rect!), as regions don't have any functions to say, get the center of themselves. (rects do, but thats unimportant when all you have is a region...)
 
Level 3
Joined
Sep 16, 2007
Messages
21
Some info - The regions are preplaced in the editor.

So, as far as i understand, i have to use point variable. Actually, i can use it as well. If you can show me how to "Center of region - the unit enters". I just need the center of that region, not region itself.

Plus, I heard that in World Edit Unlimited there is a "Triggering Region". If i cannot solve my problem with your help, i will have to use WEU :csad:.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
I'm sorry, I have never used the default World Editor for anything else but opening maps. But UMSWE actually creates rects in the rect palette, not regions, am I wrong? To tell you the truth I don't understand the difference between regions and rects. I'll google it up later.

I have NewGen pack and I suggest you to download it as soon as possible but do not download WEU. NewGen has many benefits over the default WE.
http://wc3campaigns.net/showthread.php?t=90999

UMSWE and I suppose WEU too uses the GetTriggeringRegion JASS line for the Region - Get Triggering Region function.
 
Level 11
Joined
Feb 18, 2004
Messages
394
Ok lets go over this again...

there are two types: rect and region. A rect is a rectangle. A region is basically a collection of rects, in any possible shape.

The "Region" Pallet in the World Editor which lets you create "regions" is actually letting you define rects.

"Region" type variables in the Variable Editor are actually of type rect.

The function GetTriggeringRegion() returns a region, not a rect.

Things like "Center of [region]" actually use rects.

If you want 'advanced' GUI crap, get the latest version of NewGen (link in my signature) which includes UMSWE. (Enable it from the "UMSWE" menu in the main WE window of NewGen.) In short, UMSWE > WEU. Don't use WEU at all.

If you want sanity, stop using GUI and learn JASS...
 
Status
Not open for further replies.
Top