| 03-15-2009, 10:04 PM | #1 |
I created a simple trigger to when a building is built then a region would center on it. I have tested it multiple times and the region seems to stay in place. Trigger: It says random point so I could just monitor it's movement or there lack of. I don't know any JASS or programming languages for the WE Please help. |
| 03-15-2009, 10:10 PM | #2 | |
Quote:
The tooltip says "this has no effect unless the specified region is a variable", set a variable for the region you're using at it should go fine. |
| 03-15-2009, 10:15 PM | #3 |
No, what that means is that it cannot be something like "Current Camera Bounds". When a region is converted to JASS (it is a rect) and it looks like gg_rct_Rect_Name, so that qualifies as a variable. The reason its not working is because instead of using "Random point in (Playable map area)" you should be using "Position of (Triggering unit)". Hope this helps. |
| 03-15-2009, 11:06 PM | #4 | |
Quote:
Yea I tried putting the positioning as the position of the constructed building and it still didn't work. I just tried this Trigger: Set CONV_REG = CONV CHAMBER <gen>then added this to the main trigger: Trigger: Region - Center CONV_REG on (Position of Conv_Chamber)And it didn't work. |
| 03-15-2009, 11:41 PM | #5 |
Where did this "CONV_REG" variable come from? Why don't you just set the region "CONV CHAMBER" to something like this: Trigger: This would set 'TempRect' to a box around the constructed structure with height/width of 64 units. |
| 03-16-2009, 12:52 AM | #6 |
Region != region. Heck, in GUI, region is not always equal to region... GUI regions are a total and utter mess. Also, don't name variables the same names as each other but differentiated only by case. Bad shit happens. |
| 03-16-2009, 02:33 AM | #7 |
Griffen is right, you're treating two different things the same when they shouldn't be. What you're doing is like trying to change a constant. Moving "regions" only works on regions created with triggers (then assigned to a variable). You can't move regions placed in the WE afaik. |
| 03-16-2009, 07:01 AM | #8 | |
Quote:
They aren't different from any other rect |
| 03-16-2009, 08:10 AM | #9 |
What are you trying to do with the Region after its position is set? If you're trying to use "Unit - A unit enters CONV CHAMBER <gen>", it will fail because of how that GUI function works. |
| 03-16-2009, 02:29 PM | #10 |
Yes I want to make it so when the building is built and a certain unit enters it's area then an even happens. That is exactly what I want to do. Alright some of this makes sense and some of it doesn't... Let me explain what I did. I set up a region in the Editor named CONV CHAMBER, placed it in some trees just as a place holder. I am setting up this trigger to move the region around the actual chamber when it is finished constructing. There is a certain unit that I want to bring into the vicinity of the chamber and have an event happen. Now some of you are saying it won't work and I don't understand the explanations. I assigned the CONV_REG region in the Init triggers to register the variable right off the bat. Listen if I could just only use a trigger saying "Unit comes within [range] of conversion chamber" then I would BUT that range trigger is confusing to me because it doesn't use the variables i register... I dunno it's weird. Sorry if I am pissing some of you off, I wish I had time and tolerance to learn JASS and other languages but I just don't understand them, let alone C. |
| 03-16-2009, 03:31 PM | #11 |
Trigger: Unit - A unit enters CONV CHAMBER <gen> JASS:function TriggerRegisterEnterRectSimple takes trigger trig, rect r returns event local region rectRegion = CreateRegion() call RegionAddRect(rectRegion, r) return TriggerRegisterEnterRegion(trig, rectRegion, null) endfunction Then when you use Trigger: Region - Center CONV CHAMBER <gen> on (Position of Conv_Chamber)Ahhh, I hope all this makes sense.. It's 4am xD tldr: here's how you fix your problem: Trigger: Constructed Chamber
|
| 03-16-2009, 10:30 PM | #12 |
So what you are saying is that when the region is registered it is registered to that exact location and that when the region is moved the new location isn't the registered one? Either way I tried this: Trigger: Which is all fine and dandy BUT when I create a new trigger for the unit entering the region it WON'T use variables, instead the event (Unit - unit enters region) only wants regions that aren't variables. |
| 03-16-2009, 11:32 PM | #13 | ||
Quote:
Quote:
Trigger: Trigger - Add to Some Trigger the event (Unit - A unit enters Conv_Region) |
| 03-17-2009, 08:52 PM | #15 |
You could also just refer to that region with a variable, and when you "move" the region, create a new but similar region in the place you want it, assign it to that variable, and remove the old region. |
