• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

regions a lot of regions..need help

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2007
Messages
72
Am doing map " Bitefight " like web browser game..
And i need trigger that can do something like this:
When unit enter a region (unknown region)
then trigger set that region to "marked region"
so then i can do actions like "create units in 'marked region' ...".
So do i must have a list of region? because if not it will be playable area and i don't want that and also i don't want to have a 100 triggers.
So this is like some variable where i store all the regions and then when unit
enter one of x ,then i set variable to that one and do actions..

If anyone have a idea how to do it please..
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
The problem is that there is no event like A Unit Enters Any Region and a condition Entered Region = YOUR REGION. That could have solved many problems for you but lets stay to the matter at hand.

Try a repeating timer and a condition to check if region contains a unit. but the region must be stored in an array variable and cycle through all this indexes through a loop.
 
Level 4
Joined
Oct 28, 2007
Messages
72
but the region must be stored in an array variable and cycle through all this indexes through a loop.

can you explain how to do just a simple example am noob at array variable
and what u think that trigger checks if unit is in the region if unit is then i will set some variable to 1 if unit isnt then 0 and if is 1 i will do actions but still i need to select that region to do that...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
What the hell?
This looks exactly the same as another system I've just made.

Well, check it out, if it is what you wanted, I guess it's all right, otherwise explain your problem a little bit further ;)
(I've only got 1 problem, a weird one: I create a function with 2 conditions, if they are both correct, the if/then/else will activate.
Though they are both correct, it doesn't activate, I've checked both conditions and it worked for the both of them - alone.
Well, just check the map to see the problem)

  • "Init" (sets up the regions, in this case 189 regions with only 2 actual regions).
  • "change Terrain Test" (this is a test-function, so you can see where the regions are located... you'll disvocer that they are magically on the correct position :p)
(Only those triggers are mine, all others may not be copied/edited).
 

Attachments

  • Nightmare_Suvivors_Fixed.w3x
    920.2 KB · Views: 40
Level 4
Joined
Oct 28, 2007
Messages
72
cool am cheking it now but u confus me
"ets up the regions, in this case 189 regions with only 2 actual regions"?
i got 100 real regions but i need to that one be activated when unit/hero enter to that one..so i dont need to do for every trigger if unit enter region 88...

i chek it and i dont get the trigger..what it supose to do?randomly move unit to that fiealds with symetric doors?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
In that case it's even easier:

Use the region-variable I have used in an init-trigger and set Region[1] to the first region; Region[2] to the second, ...

(It just seemed like too much work, so I've made a system that does everyithng automatically, the 2 regions I've used are actually the regions that are NOT included in the system xD).
 
Level 4
Joined
Oct 28, 2007
Messages
72
so u just take area split into regions xxx and if unit is in one of them it active ur action?
 
Level 4
Joined
Oct 28, 2007
Messages
72
i need one thing to create variable region of that area so i can add my actions to it
if u understand ..like when unit enter to that regions i need to know what regions is that..simply as that
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Erm, create a loop from 1 to [amount of regions], create an if/then/else inside the loop, with the condition "If (Entering Unit) is in Region[Integer A] equal to true" and then do your actions.
He still needs an event to fire the trigger which will be in that case 'A unit enters REGION' and the problem is the REGION can't be a variable so (Entering Unit) will not refer to any unit as there is no event.
 
Level 4
Joined
Oct 28, 2007
Messages
72
well u create a regions - your area (in the middle) so how to to for whole area so if i dont want to have blind spots...?
init
  • Events
    • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • Set Reals[1] = -9792.00
      • Set Reals[3] = -8576.00
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set Reals[2] = 8960.00
          • Set Reals[4] = 7712.00
          • For each (Integer B) from 1 to 14, do (Actions)
            • Loop - Actions
              • Set Loc[1] = (Center of (Region(Reals[1], Reals[2], Reals[3], Reals[4])))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (gg_rct_Middle_Region_1 contains Loc[1]) Equal to True
                      • (gg_rct_Middle_Region_2 contains Loc[1]) Equal to True
                • Then - Actions
                  • Set Reals[2] = (Reals[2] - 1344.00)
                  • Set Reals[4] = (Reals[4] - 1344.00)
                • Else - Actions
                  • Set Integer = (Integer + 1)
                  • Set Rect[Integer] = (Region(Reals[1], Reals[2], Reals[3], Reals[4]))
                  • Trigger - Add to gg_trg_Terrain_Modifier_Build the event (Unit - A unit enters Rect[Integer])
                  • Set Reals[2] = (Reals[2] - 1344.00)
                  • Set Reals[4] = (Reals[4] - 1344.00)
              • Custom script: call RemoveLocation(udg_Loc[1])
          • Set Reals[1] = (Reals[1] + 1312.00)
          • Set Reals[3] = (Reals[3] + 1312.00)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Remove the if/then/else in the middle, obviously, since that creates the "blind spot" (only use the "Else"-functions of it).

@ Starguizer: The event is inside the trigger I gave him ("Trigger - Add event to trigger"), but of course you couldn't know that ^^

Ohh, by the way: your map needs to be perfectly symmetrical and you need to adjust the coördinates to the correct reals.
 
Level 4
Joined
Oct 28, 2007
Messages
72
so the rect is the region? that is triggered?and i need to do lil bigger regions so it wont do any dmg?i try that but am confused try to do that if u have time...
 

Attachments

  • bgggg.w3x
    39.3 KB · Views: 34
Level 28
Joined
Jan 26, 2007
Messages
4,789
Erm... damage? Damage to what?
You can make them bigger if you want, it doesn't really matter...

(to clear things up:
Rect = rectangle, commonly referred to as "Region", because of the World Editor, while "regions" actually are a combinations of multiple rects).

But when I say "Region", I always mean "Rect" (unless told otherwise).

(My guess is that you use WEU?)
 
Level 4
Joined
Oct 28, 2007
Messages
72
well i have a idea how to do this easier but only with regions i will set up like chess table
example if unit get to B5
if unit is in region B and region 5 then....but i dont know how to set there a region...well if u can try to see that file that i upload and something to do with him..if u cant...
 

Attachments

  • chess_table.gif
    chess_table.gif
    31.3 KB · Views: 76
Level 28
Joined
Jan 26, 2007
Messages
4,789
Good, WEU is crap for nowadays standards.

I don't get that you need to be in 2 regions, 1 region is the little square.
In my trigger, B5 would be 1 region, not 2 overlapping regions (Region #13, to be precise
- if you want a hexadecimal code for it: (((B-10) * 8) + 5), or in general: (((X-10) * 8) + Y), where X = the letter and Y = the number).

Just set up the trigger like I've done, but with your coördinates, add event to another trigger that checks if a unit enters a region (this is done through triggers), then - inside that trigger - create a loop from 1 to the amount of regions your map has.

In the chess-example:

Create a loop from 1 to 64 (there are 64 squares on a chess-board).
Then create an if/then/else, with the condition "If (Entering Unit) is in Region[Integer A] equal to true" (boolean).

In the actions, do whatever you want...

If the unit enters B5, the condition will be true when Integer A = 13 and the actions will be fired.
 
Level 4
Joined
Oct 28, 2007
Messages
72
am i dont know how to set it told ya suck at this ...
here how i imagine to do 1st i will define center of a and b region
then i try to center of b to move on a but not on center a but on the center line also for a same story...that loc will create a point weach i can use..for actions that i need but like i say i suck at array stuff...but still will be a lot of triggers..i try just to copy that yours but the resolution of map it count isnit?
 

Attachments

  • untitled.PNG
    untitled.PNG
    100.3 KB · Views: 79
Level 28
Joined
Jan 26, 2007
Messages
4,789
You don't get it -.-

I said create a loop!
The condition should be inside an if/then/else-function and the if/then/else-function should be inside a loop!

  • Events
  • Conditions
  • Actions
    • For each (Integer B) from 1 to [Number of Regions], do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Rect[(Integer B)] contains (Entering unit)) Equal to True
          • Then - Actions
          • Else - Actions
"Integer B" isn't a variable...
(and I use B, because I use "Integer A" often, I don't want them to override...)

Do not put an event/condition in this trigger...
 
Level 4
Joined
Oct 28, 2007
Messages
72
listen here is again map regions are set up just create dam trigger..or this post will go to 100 posts..please...i dont want to boar u all night..here is 1:30am..
 

Attachments

  • bgggg2.w3x
    39.1 KB · Views: 53
Level 28
Joined
Jan 26, 2007
Messages
4,789
I really can't work like this... I'm trying my best to explain you how to do it, but seemingly you don't get it.
I don't even know what you want to achieve with this trigger and you're bossing me around, while I'm doing my best to help you.
It's the same time for me as well, so I'm just going to do it quickly...

I assume that isn't your real map? (Since you've said you had hundreds of regions, yet I only see 30 in this one and this map is crap).
In that case, creating the trigger would be a waste of effort (seriously, if you would've imported the trigger from the map you gave me to the original map, it would've failed... miserably, it works with coördinates, so unless the terrain is exactly the same, it won't work).

I've said before that the terrain has to be perfectly symmetrical, which isn't the case, so it's impossible to use my method (really, it's impossible... nothing to do about it).

This is the oter method that I tried to explain, a lot easier when using only 20-50 regions, but with 100+ regions, it becomes a big-ass trigger.

Well, it's your choice of course:
  • Open your original map, make the terrain perfectly symmetrical and give it to me to do the triggering
  • Create 100+ regions, copy/paste the same 2 actions 100 times and change the region of every action... yet again, a hundred times...

I don't care which one you choose, as long as I get enough information...

For my test-map:
Just run with the hero to where the other area's are, you'll see a message pop up with the correct region number...
 

Attachments

  • bgggg2.w3x
    40.7 KB · Views: 50
Level 4
Joined
Oct 28, 2007
Messages
72
tnx very very much..
true this isnt the map ,some friend will create the terrain...ok i get it now this was simple
example so i get this example...tnx sorry for trouble you so much..
 
Status
Not open for further replies.
Top