Hey,
I can't find the right trigger for my event. Maybe you can help me.
This is what I want it to be like:
> Any unit gets into the radius of ANY unit.
There are no units in my map when it starts I spawn them by triggers.
In my map there are fields like in a board game. When a unit enters a field there should be a comparison between both units to find out which one is stronger. The comparison is no problem, but I need to get the unit that stands in the field before the other one enters it into a variable. So if anyone can tell me how I guess I dont even need the trigger.
Dude, I would love to hear the answer too, I just had to deal with this problem too. There's only an event which is like "Any unit gets into the radius of (specific unit)" and you have to specify the unit, but if it doesn't exist yet, you're out of luck. Dynamically creating the trigger doesnt work either.
I played around on a test map and it looks like the event you might have to use is "Unit - Any Unit Enters Region." As Verdagon stated, I wasn't able to get events to trigger for variable units/regions, only for ones premade on the map. There's a few options that I think you can do:
1. Create a premade region on your map. When you spawn a unit attach that region to the unit. When you use the "Unit - Any Unit Enters Region" for that region you can do your comparison to see which unit is stronger.
2. You said that this is like a board game, so you may already have the regions premade on your map. So just use the "Unit - Any Unit Enters Region" trigger and then count how many units are in the region to see if there are two that you need to compare.
3. In the data editor you can create a constant AoE damage effect on around each of your units that does zero damage. There is a trigger units taking damage and you can specify the type of damage to be your AoE, so that will trigger when they are close to eachother.
I attached a copy of an example of solution #1. You can also tweak it for #2, just don't attach the regions to your units. Hope this helps some.
Yeha thank you that helped me alot!
Now I have a region in my map that will be attached to the unit I select. Then it starts moving and the region touches the other unit that stands in a field.
Hey, I can't find the right trigger for my event. Maybe you can help me.
This is what I want it to be like:
> Any unit gets into the radius of ANY unit.
There are no units in my map when it starts I spawn them by triggers.
In my map there are fields like in a board game. When a unit enters a field there should be a comparison between both units to find out which one is stronger. The comparison is no problem, but I need to get the unit that stands in the field before the other one enters it into a variable. So if anyone can tell me how I guess I dont even need the trigger.
Thanks in advance!
Dude, I would love to hear the answer too, I just had to deal with this problem too. There's only an event which is like "Any unit gets into the radius of (specific unit)" and you have to specify the unit, but if it doesn't exist yet, you're out of luck. Dynamically creating the trigger doesnt work either.
TL;DR: bump
I played around on a test map and it looks like the event you might have to use is "Unit - Any Unit Enters Region." As Verdagon stated, I wasn't able to get events to trigger for variable units/regions, only for ones premade on the map. There's a few options that I think you can do:
1. Create a premade region on your map. When you spawn a unit attach that region to the unit. When you use the "Unit - Any Unit Enters Region" for that region you can do your comparison to see which unit is stronger.
2. You said that this is like a board game, so you may already have the regions premade on your map. So just use the "Unit - Any Unit Enters Region" trigger and then count how many units are in the region to see if there are two that you need to compare.
3. In the data editor you can create a constant AoE damage effect on around each of your units that does zero damage. There is a trigger units taking damage and you can specify the type of damage to be your AoE, so that will trigger when they are close to eachother.
I attached a copy of an example of solution #1. You can also tweak it for #2, just don't attach the regions to your units. Hope this helps some.
Yeha thank you that helped me alot! Now I have a region in my map that will be attached to the unit I select. Then it starts moving and the region touches the other unit that stands in a field.