Limitation for region triggers? help needed

Do you need World Editor help? Ask here!
Forum rules
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)
BugMeNot
Posts: 141
Joined: Wed Jan 21, 2009 12:46 pm

Limitation for region triggers? help needed

Unread post by BugMeNot »

OK so i have a problem with the few triggers world editors gui is offering me. My current trigger is

Event: a unit enters region(5)
Condition: unit is equal to darkgreen
Condition: terrain is equal to Cityscape grass
Action: Give unit the ability (command aura)

I am looking for an event that doesn't make you choose a specific region because the trigger will work the same and wont have to be copy/paste hundreds of times and edit the regions since this map has approx: 300 regions.

What i would like is something such as
Event: a unit enters a region

If no gui trigger can be made as simple as requested, perhaps someone who knows jass can help create a trigger that would fit appropriate. Please help, and thanks to who ever has a solution!
This is a guest account intended for use by people who wish to remain anonymous or hate registering.
(Please don't forget to sign your posts with your name if you want us to know who you are.)
http://www.bugmenot.com/view/3ice.hu

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Limitation for region triggers? help needed

Unread post by 3ICE »

No such event is available.

When I work with regions, I put them in arrays for reusability:
Regions Regions
t_jm t_eve Events t_lin t_jb t_all Map Initialization t_jm t_co Conditions t_jbm t_act Actions t_j t_set Set Region_array[0]=Untitled Region 001 t_j t_set Set Region_array[1]=Untitled Region 002 t_j t_set Set Region_array[2]=Untitled Region 003 t_lin ... t_jb t_set Set Region_array[299]=Untitled Region 300
Then adding them all as an event is as simple as:
Initialization Initialization
t_jm t_eve Events t_lin t_jb t_all Map Initialization t_jm t_co Conditions t_jbm t_act Actions t_jb t_jbm t_act For each integer A between 0 and 299 do t_emp t_emp t_jb t_tri Trigger - Add new event to Trigger 001: t_emp t_emp t_emp t_jb t_eve A unit enters Region_array[Integer A]
ImageImageImageImageImage
Image
ImageImage

BugMeNot
Posts: 141
Joined: Wed Jan 21, 2009 12:46 pm

Re: Limitation for region triggers? help needed

Unread post by BugMeNot »

OK so i attempted to add regions as variables using arrays but seems it doesn't save any triggers (still have to use around 300)

i'm not sure how this works with regions relating to changing the tiles. Like i need a quick way to add spells to a unit entering odd regions 1,3,5,7 for player 1 and player 2 even regions 2,4,6,8 as of now i would have to edit each trigger for all 300 regions example i'm working with:

1st region trigger of about 300
Event: a unit enters region 001
Condition: terrain type at (center of region 001) equal to cityscape grass
Condition: Owner of Triggering unit equal to player 11(Dark green)
Action: add command aura to (triggering unit)

*also the same trigger for leaving a region is made for each region

This is the only method i can think of to work with terrain changes in each region( as posted before, a player types -T1 and all "even or odd" regions will change)

please be specific again which helps a lot!
This is a guest account intended for use by people who wish to remain anonymous or hate registering.
(Please don't forget to sign your posts with your name if you want us to know who you are.)
http://www.bugmenot.com/view/3ice.hu

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Limitation for region triggers? help needed

Unread post by 3ICE »

Well you are not being specific at all.
Even (0 2 4 6 8...) Even (0 2 4 6 8...)
t_jm t_eve Events t_lin t_jb t_all Map Initialization t_jm t_co Conditions t_jbm t_act Actions t_jb t_jbm t_act For each integer A between 0 and 149 do t_emp t_emp t_jb t_tri Trigger - Add new events to Trigger 001: t_emp t_emp t_emp t_j t_eve A unit enters Region_array[2*Integer A] t_emp t_emp t_emp t_jb t_eve A unit leaves Region_array[2*Integer A]
Odd (1 3 5 7 9...) Odd (1 3 5 7 9...)
t_jm t_eve Events t_lin t_jb t_all Map Initialization t_jm t_co Conditions t_jbm t_act Actions t_jb t_jbm t_act For each integer A between 0 and 149 do t_emp t_emp t_jb t_tri Trigger - Add new events to Trigger 002: t_emp t_emp t_emp t_j t_eve A unit enters Region_array[(2*Integer A)+1] t_emp t_emp t_emp t_jb t_eve A unit leaves Region_array[(2*Integer A)+1]
ImageImageImageImageImage
Image
ImageImage

Thurst4blood
Posts: 39
Joined: Fri May 21, 2010 6:50 pm
Account: Thurst4blood

Re: Limitation for region triggers? help needed

Unread post by Thurst4blood »

Would this work for making kill regions in mazes?

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Limitation for region triggers? help needed

Unread post by 3ICE »

Yes, but why bother? Setting up the 1000 regions for my loop-through method above is exactly the same amount of work as setting up the 1000 events for the good old kill trigger. And the good old kill trigger is easier to maintain and uses less memory and CPU.

Unless you need to do something fancy with the regions (like above: every second region is picked, etc) there is no reason to put them in an array.
ImageImageImageImageImage
Image
ImageImage

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: Limitation for region triggers? help needed

Unread post by 3ICE »

Here is an easier to maintain version of the region setup I posted above:
Regions Regions
t_jm t_eve Events t_lin t_jb t_all Map Initialization t_jm t_co Conditions t_jbm t_act Actions t_j t_set Set i=0 t_j t_set Set Region_array=Untitled Region 001 t_j t_set Set i=i+1 t_j t_set Set Region_array=Untitled Region 002 t_j t_set Set i=i+1 t_j t_set Set Region_array=Untitled Region 003 t_j t_set Set i=i+1 t_lin ... t_j t_set Set i=i+1 t_jb t_set Set Region_array=Untitled Region 300
It uses a counter, so if you accidentally leave out, say region 150, you don't have to go back and change every array index from 151 to 300 and decrease it by 1. The building block is:
t_set Set i=i+1 //Increment counter
t_set Set Region_array=Untitled Region ___ //next
Just repeat these two lines and change every second line to the next region.

(Admins CAN double post - I make the rules!Image)
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 114 guests