Function returning entered region?

mango

Member
Reaction score
0
Hi,

I'm working on a simple GUI trigger for entering buildings. Rather than instant-moving units between regions to enter houses, I'm using a framework kit made of walls and roofs so that players can actually ENTER buildings. I'm now working on an efficient way to hide the roofs when a unit enters the region.
I'm trying to write the whole system in 2 triggers; one for entering the house (region) and one for exiting. I'm using many of the Unit Enters Region event and inserting each individual house region, so the trigger fires every time a player enters ANY house. The problem now is getting ONLY the roof of the ACTUAL ENTERED house to hide -- I already know I can do this using a handful of If/Then/Else actions, but that's really inefficient.

My question is (since I am no JASS expert): is there a call function in JASS that would allow me to return the entered region from a "unit enters region" event? Maybe something like "Call GetEnteredRegion(udg_***...)" and then I could save it as a variable?? I really have no idea what it would look like, I'm truly a JASS noob, but this would make the whole script a million times simpler and efficient :)

Thanks so much in advance
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
well as to yew im no jass expert. but can you just set the roof to an unselectable flying unit? just get the height right and when a unit enters the region set its transparency to 100%. then just the opposite when the unit leaves :] hope i is t3h halpful
 

mango

Member
Reaction score
0
Welllll I don't really need an action specifically to hide the roof -- I'm using the Animation- Hide Doodads in Rect action for that. What I need to know is if there is a function or call in JASS that would let me fire a trigger using several Unit Enters Region events and sort through each to return EXACTLY WHICH region is being entered. I hope that is more understandable, and thanks for the thought!
 

Uszi

New Member
Reaction score
5
:DSeems like you could do a boolean check to see if the region contains both the unit and the doodad, and if so then hide the doodad.

Trigger:
  • Events
    • A unit enters a region
    • Conditions
    • Region contains X unit = true
    • Region contains X doodad = true
    • Actions
    • Hide X doodad


I think. Don't have the editor on this comp, posting from work. :D
 

Azlier

Old World Ghost
Reaction score
461
You can get the entered region, but not the rect. To get the rect, you will need something like my R&R. Jass only though, I'm afraid :(.

Well, unless you pull off the standard GUI struct hack.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You could make a region array and loop thru each instances to find out which one contains the triggering unit. Or you can make multiple triggers...
 

Azlier

Old World Ghost
Reaction score
461
Region array: Neater, but even less efficient than a bunch of if's.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top