I need to know how to acheive victory when a group of units (1-6) approach a unit that is spawned via triggers. I have 8 triggers and variables, 1 for each player that set up these unit groups(8 players). What i need help with is how i would check if a player group is at this unit they must reach.
I suppose a periodic event is better than a unit entering the range of the unit. I think a if then else statment might be what i need for the victory to trigger correctly.
Yes i did use this idea before but it didnt work so i created this thread, while it wasnt the same as your plan i worry that it only checks to see if a single unit is in the region. I want a entire unit group with varying numbers to have to enter the region to acheive victory.
I see absolutely no reason why you couldn't check if each unit in a unit group is in that region.... here is another version which does exactly that by adding like 3 lines.
AFTER LOOKING AT FIRST SAMPLE MAP: While it does look like this would work it seems that it is pointlessly complex. The "Create Capture Dialog" isnt really needed since all of the units must reach the target unit, so simply saying that will work. Your attach region idea may not be needed, what i did was i used a unit enters region event, but the region was a 3.0 radius around the unit, the unit was found via variable so i wasnt sure if it would work but its not exactly the same as unit enters range of unit so maybe it would.
I am done trying to help you with your questions on this forum. When I have tried to help you in the past you either don't respond at all or respond with the tiniest issues which are so easily solved it's as if you haven't even tried to do anything on your own. I make a map demonstrating the exact solution to your problem and you don't even bother looking at it. This isn't a good way to encourage people to help you.
You aren't going to improve like this, at some point you are going to have to dive in and try to do some problem solving yourself through trial and error and exploring the editor.
AFTER LOOKING AT FIRST SAMPLE MAP: While it does look like this would work it seems that it is pointlessly complex. The "Create Capture Dialog" isnt really needed since all of the units must reach the target unit, so simply saying that will work. Your attach region idea may not be needed, what i did was i used a unit enters region event, but the region was a 3.0 radius around the unit, the unit was found via variable so i wasnt sure if it would work but its not exactly the same as unit enters range of unit so maybe it would.
I had this most recent post in before you posted the second map/comment, the website crashed and im busy doing other things, dont get all enraged because i cant respond instantly. I just dont want things to get too complicated and i dont always want to copy/paste your triggers because then i wont learn. So wheni come back i wont know how to do this! I need instructions on how to solve it, not the outcome with little details.
I don't understand why the dialog is even relevant. It's only there to show that the system is keeping track of units moving in/out of the region. I am not trying to create your map for you...I was creating an example system to demonstrate a solution to your problem which you could use.
Using a region created around unit will not work unless the unit is defined by value rather than variable. That is why I have used the region attach method.
Okay then ill see about using attach region instead, the reason i thought the dialog was there was for players to see how many units they need to win, because they all of their units so there is little point in telling them that. If the dialog is there for a type of "debugging" window then i guess i could use it temporarily.
A solution noone has mentioned (and im not sure if this is really working):
- Periodically (like every second) check the distance between two points (Comparison - Distance between points) to be smaller than XX.
- Point 1: Location of unit you created with triggers
- Point 2: Center of Unit Group (Not sure where this is placed, so might not be working as desired)
Or, maybe a better solution with use of regions:
- 'Move region' to target unit (unit moving? periodically move region to unit)
- use 'Unit enters region' and 'unit leaves region' events and count units owned by human player inside region
It seems like everyone missing the ideal solution so ill step in and end it here. After you spawn your unit run a threaded custom definition with a loop. In the loop run an if then check for number of units or rather unit group in relation to a region. The key part here is the use of the region term (no preplaced regions are ever needed). Within region you need to use the "convert circle to region", which will allow you to choose the position of the unit you just created, passed along through parameters as last created unit, and a radius to define the circle. And there you have it; a trigger than works when a specific unit group come together around a central unit. Ta-da.
And sorry rtschutter but you're mistaken about nothing working without the unit being a defined value and you do not need to precreate a region which can be very messy.
Yes, the reason why I think this is better is only because of the way SC2 handles events. It seems to use fewer resources to call an event once and run a loop all game than to call an event multiple times. The only reason I might avoid this is if I already had a hundred threads running loops...
Well here is a collaborative example map from mitarskoro91 and I. It uses a custom script to define a unit enters region event after the map has already initialized. This way you do not need a premade region or unit to use the unit enters region event.
I think this is better than using a loop or periodic event which is going to take a lot of resources over time.
I need to know how to acheive victory when a group of units (1-6) approach a unit that is spawned via triggers. I have 8 triggers and variables, 1 for each player that set up these unit groups(8 players). What i need help with is how i would check if a player group is at this unit they must reach.
Use a periodic event to check that areas around the unit that needs to be approached for the unit groups.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
I suppose a periodic event is better than a unit entering the range of the unit. I think a if then else statment might be what i need for the victory to trigger correctly.
Here is my recommendation:
Something like that. Using a repeat loop with a wait action is almost always better than a periodic event as far as map performance goes.
I feel like using unit enters region would be the most efficient way so it only runs when the unit comes near it.
@rtschutter: Go
Ah, but the unit is spawned via trigger and then set to a variable, therefore he can't use that as the event.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
You can create a region before the game starts and attach it to the unit later, and base the 'enters region' off of that region.
Here is an example map.
@rtschutter: Go
Yes i did use this idea before but it didnt work so i created this thread, while it wasnt the same as your plan i worry that it only checks to see if a single unit is in the region. I want a entire unit group with varying numbers to have to enter the region to acheive victory.
I see absolutely no reason why you couldn't check if each unit in a unit group is in that region.... here is another version which does exactly that by adding like 3 lines.
AFTER LOOKING AT FIRST SAMPLE MAP: While it does look like this would work it seems that it is pointlessly complex. The "Create Capture Dialog" isnt really needed since all of the units must reach the target unit, so simply saying that will work. Your attach region idea may not be needed, what i did was i used a unit enters region event, but the region was a 3.0 radius around the unit, the unit was found via variable so i wasnt sure if it would work but its not exactly the same as unit enters range of unit so maybe it would.
You didn't even look at it the first time?
I am done trying to help you with your questions on this forum. When I have tried to help you in the past you either don't respond at all or respond with the tiniest issues which are so easily solved it's as if you haven't even tried to do anything on your own. I make a map demonstrating the exact solution to your problem and you don't even bother looking at it. This isn't a good way to encourage people to help you.
You aren't going to improve like this, at some point you are going to have to dive in and try to do some problem solving yourself through trial and error and exploring the editor.
AFTER LOOKING AT FIRST SAMPLE MAP: While it does look like this would work it seems that it is pointlessly complex. The "Create Capture Dialog" isnt really needed since all of the units must reach the target unit, so simply saying that will work. Your attach region idea may not be needed, what i did was i used a unit enters region event, but the region was a 3.0 radius around the unit, the unit was found via variable so i wasnt sure if it would work but its not exactly the same as unit enters range of unit so maybe it would.
I had this most recent post in before you posted the second map/comment, the website crashed and im busy doing other things, dont get all enraged because i cant respond instantly. I just dont want things to get too complicated and i dont always want to copy/paste your triggers because then i wont learn. So wheni come back i wont know how to do this! I need instructions on how to solve it, not the outcome with little details.
I don't understand why the dialog is even relevant. It's only there to show that the system is keeping track of units moving in/out of the region. I am not trying to create your map for you...I was creating an example system to demonstrate a solution to your problem which you could use.
Using a region created around unit will not work unless the unit is defined by value rather than variable. That is why I have used the region attach method.
Okay then ill see about using attach region instead, the reason i thought the dialog was there was for players to see how many units they need to win, because they all of their units so there is little point in telling them that. If the dialog is there for a type of "debugging" window then i guess i could use it temporarily.
Maybe too late, but:
A solution noone has mentioned (and im not sure if this is really working): - Periodically (like every second) check the distance between two points (Comparison - Distance between points) to be smaller than XX. - Point 1: Location of unit you created with triggers - Point 2: Center of Unit Group (Not sure where this is placed, so might not be working as desired)
Or, maybe a better solution with use of regions: - 'Move region' to target unit (unit moving? periodically move region to unit) - use 'Unit enters region' and 'unit leaves region' events and count units owned by human player inside region
It seems like everyone missing the ideal solution so ill step in and end it here. After you spawn your unit run a threaded custom definition with a loop. In the loop run an if then check for number of units or rather unit group in relation to a region. The key part here is the use of the region term (no preplaced regions are ever needed). Within region you need to use the "convert circle to region", which will allow you to choose the position of the unit you just created, passed along through parameters as last created unit, and a radius to define the circle. And there you have it; a trigger than works when a specific unit group come together around a central unit. Ta-da.
And sorry rtschutter but you're mistaken about nothing working without the unit being a defined value and you do not need to precreate a region which can be very messy.
So your solution is to run an endless loop?
Yes, the reason why I think this is better is only because of the way SC2 handles events. It seems to use fewer resources to call an event once and run a loop all game than to call an event multiple times. The only reason I might avoid this is if I already had a hundred threads running loops...
Well here is a collaborative example map from mitarskoro91 and I. It uses a custom script to define a unit enters region event after the map has already initialized. This way you do not need a premade region or unit to use the unit enters region event.
I think this is better than using a loop or periodic event which is going to take a lot of resources over time.