| 01-10-2005, 04:42 AM | #1 |
I need a trigger that creates units at enterd reigon I thought there was one, and it would make it SO much easier I want somthing like this E.unit eneres region (theres like 60) A. create units at entered region that 1 trigger would be so easy and would like to do it that way instead of the way I think I need to which is 60different triggers, or 60different if/then statments So is there any possible way to get enterd region? |
| 01-10-2005, 08:34 AM | #2 |
Melee Initialization Events Unit - A unit enters Region 000 <gen> Conditions Actions Unit - Create 1 Footman for Player 1 (Red) at (Position of (Entering unit)) facing Default building facing degrees If that could work |
| 01-10-2005, 08:40 AM | #3 |
not really as I want them to spawn at the center of the region. My map is a dungeon with tons of square like regions that you walk into, and each has a hive in the middle where I would like the guys to spawn out of. So I wanted unit enters region create units at center of enterd region, or at hive in center of region but center of enterd region dont seem to exist, so I think the only possible way is to trigger EVERY single 1 seperatly, or just a LOT of if/then |
| 01-10-2005, 10:23 AM | #4 |
there is no other way to do it. u need to rely every region to a hive (unit) for example and to spawn the unit at position of unit(hive) that will make u tone of line of trigger but there is no other choice. ![]() |
| 01-10-2005, 12:58 PM | #5 |
I have read that there is a JASS function named GetTriggeringRegion that's unavaliable in GUI. However, trying it out right now I couldn't get it to work, because GUI regions are called "rects" in JASS, and this function doesn't give you a rect, it gives you a region (which apparently means something else in JASS). But there might be a function like "GetEnteredRect", however, I don't know if there is, someone actually skilled in JASS has to tell you that. |
| 01-11-2005, 02:55 AM | #6 |
hmm guess I will wait a bit more b4 I start doing those triggers, just incase a solution pops up :). Hope so |
| 01-11-2005, 03:07 AM | #7 |
There is an entering region. However, what you think is a region (that thing you placed in Worldeditor) is actually a rect. I have actually done a pretty eleborate system that has a "GUI" trigger that uses the entering region. Its called Fight Region. Its actually the core of the map. ITs found in the trigger category fighting Here it is http://weaaddar.wc3campaigns.com/arena7e.w3x Okay, you can now laugh your ass at probably the hardest to read gui trigger ever. |
| 01-11-2005, 03:32 AM | #8 |
you always have that way of helping that does nothing for me lol, with all the complicated junk that I dont understand lol, at least its gui, but I still have no clue. So in simple terms what do I do? E.unit enters region (put all my 50regions here) A. what goes here your trigger looks way complicated, however, I see tons of stuff that I dont need like timers, food supply and cinamatic, so I gota feeling for the simple part I want, it might not be to long I want somthing thats set variable region im in = enterd region(or enterd rect) whatever you would like to call it :) p.s. I never new you made a real map, I always thought you were some trigger geuniss who never put his skills to use on a map lol, you got any other maps? non hero arena though |
| 01-11-2005, 06:10 AM | #9 |
Its a very old map. I updated it to get rid of memory leaks and went a little crazy. Anyway its a two part trigger the event set up is done in the Init. And the begining of fight does the Entering region bit. |
| 01-11-2005, 06:38 AM | #10 |
umm still dont get it lol, maybe 50triggers is just easier. To do it your way do I need the curom text thats at the top where it says the maps name? Also the trigger is more complicated the a simple 2custom scirpt lines correct? Your map dont have many regions so its hard for me to tell if its even what I want, as theres no spawning for enering zones over and over and stuff. and I dont know what this is local location loc=GetRectCenter(gg_rct_Fighting_place) or this if( h2i(udg_regionarray[GetForLoopIndexB()]) == h2i( GetTriggeringRegion () ) ) then or this call SetUnitPositionLoc( GetEnumUnit(),loc) |
| 01-11-2005, 06:55 AM | #11 |
Fighting Place is a region in my map. Since RegionArray is defined as an array of rects, even though it actually is an array of regions the fastest way to do the comparion is to convert both to handles and see if the matching one is as such. This determines which region actually is the Triggering Region for my map. Basically its checking if the value in the regionarray at Integer B is equal to the handle of the triggering region. SetUnitPositionLoc( GetEnumUnit(),loc) sets the position of the Picked Unit in a Pick Every Unit in Group...and sets his location to loc. My map is not like yours, it constantly spawns units in the same spot. And its not a hero arena. The thought insults me. But the thought process is the same. While my trigger goes nuts. You on the other hand want spawning in the region. You would want parrallel arrays. One called RectArray which would hold all your rects. And another called RegionArray which will hold all your regions. You would define all the rects in rect array, then for loop and use my ConvertRect function and store then in RegionArray. Also remember to add the region entrance in custom text as an event for the trigger thats fired. Now in your trigger thats fired upon entrance. You would do the loop to find out which region was the entered region. You can then set a point variable to be the Center of RectArray[ForLoopIndexA/B]. Now spawn all your units you want at that location and remember to destroy it. |
| 01-11-2005, 07:35 AM | #12 |
I played your map now, ya not a hero arena lol, but hey thats not an insult they are not all bad, if some1 good would finally make 1. btw you dont get gold after you get a hero, and you cant level past 5, though I doubt you plan on updating lol, but just lettin you know :) You would define all the rects in rect array, then for loop and use my ConvertRect function and store then in RegionArray dunno what that means ^ you can just post an exact trigger :), though I know most of the good mappers, like yourself seem to like to help, instead of posting exact triggers, but im getting nowhere with this info. Thanks for keep trying to help, most would of gave up by now :) p.s. make a map :) |
| 01-11-2005, 02:14 PM | #13 |
I'll try to translate what weaaddar said: Basically, in JASS, you have regions and you have rects. Rects are the thing you know from GUI as regions, so, whenever you say in GUI something like "create unit at (center of (some region))", you are actually creating the unit at the center of what is in JASS called a "rect". So, we have a JASS rect. Now comes the JASS region, which is something similar, but different and I have no idea how or why. Anyway, it seems that each rect has a corresponding region (actually, from what weaaddar said, I would think there can be a region for each rect, but you have to create them first, and, at the same time you create them, assign them to a variable array alongside another array to which you assign the rects), and when the "unit enters region" event happens (which is actually unit enters "rect" event in JASS), information is stored about the "TriggeringRegion". However, that doesn't help you by itself, because you can only create a unit at the center of a rect, not a region. So, you need to convert your region to a rect. That's why, when converting rects to regions, we assign them to two variable arrays: one for rects and one for regions. Then we can do a region comparison and look through the region array untill we find the region that is the same as TriggeringRegion. Once we find the region, we also find the corresponding rect, because it's stored in the rect variable array under the same index. Now that I look back at what I typed, I'm not even sure I got half of that right (nor, for that matter, that you understood even half of it). Maybe it's best for us GUI noobs to stich with what we know and make one trigger for each region (or, as I did this when I had a similar problem, a periodic trigger that loops through a rect array and checks if a unit is in any of the rects stored in it) |
| 01-12-2005, 05:35 PM | #14 |
I'll try to elaborate further. :) What theese fellas are trying to tell you is that a RECT in JASS is the very same thing as a REGION in GUI. In my WE, which is weird, regions are called rects. Regions are "imaginary" locations created by you at a certain spot and in a certain size. Theese can come in handy when you need some event responses you can't get from the rects. I hope i cleared things out, and didn't say anything that's not true ^^ |
