Since regions can over-lap and the game map itself is considered a region I think the best method would be just test against the regions themselves individually. I can't think off hand of a way to definitely return a region that a unit is in but you can definitely check if a unit is in a region, if you get what I'm saying.
There are a few strategies to do this, one would be events for each region that track and remember all units coming and going from them for instance. Another would be at each request for that info poll all the regions and return the most desirable one that meets the conditions.
One more thing, it's a different question but related to this...
For some reason I can't see where to do the condition "number of living units in a region with matching conditions". It should be really simple but I can't find it anywhere!
for tracking what region the unit is in ...... Do you have any sort of ...... region array that dictates an integer value that represents a specific region...
if that would be the case you could set the custom value of a unit = to the region hes entering.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
It'd definitely be initiated by making a comparison condition and then adjusting one side or the other and going to the functions section and looking for it there.
Hey takes some getting used to for sure, btw I just found it: Create a new condition, click on the left most bracket of the condition, when the function list pops up click on the unit group label and it'll be there as "Units in region matching condition". Or if you're seeking the number itself, first 'number of units in unit group' and then specify that 'units in region matching conditions' as the group to acquire the amount of.
I found units in region matching condition, as I have used that once or twice before. I can't get it to say number of living units = 0 though. I have seen other people using this condition:
number of living units in a region with matching conditions
Amount = x
Try adding a unit to a unit group when it enters a region and removing it from it when it leaves. Then just do a loop that checks which unit group the unit is in.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Let say I have quite a lot of regions on the map, I want it to be able to tell me what region the unit is currently standing in when I click it.
So when I click the unit, I could get that he is standing in Region 007 and then save that to a variable or do whatever.
Thanks
Since regions can over-lap and the game map itself is considered a region I think the best method would be just test against the regions themselves individually. I can't think off hand of a way to definitely return a region that a unit is in but you can definitely check if a unit is in a region, if you get what I'm saying.
There are a few strategies to do this, one would be events for each region that track and remember all units coming and going from them for instance. Another would be at each request for that info poll all the regions and return the most desirable one that meets the conditions.
@BumpInTheNight: Go
Yeah, I was thinking that might be the only way to do it, but with lot's of units and lots of regions thats going to add up to some very big triggers!
Thanks for your help though.
One more thing, it's a different question but related to this...
For some reason I can't see where to do the condition "number of living units in a region with matching conditions". It should be really simple but I can't find it anywhere!
@James7285: Go
for tracking what region the unit is in ...... Do you have any sort of ...... region array that dictates an integer value that represents a specific region...
if that would be the case you could set the custom value of a unit = to the region hes entering.
@SouLCarveRR: Go
This...this would be an excellent course of action. Those custom variables are life savers for things like this.
@James7285: Go
It'd definitely be initiated by making a comparison condition and then adjusting one side or the other and going to the functions section and looking for it there.
@SouLCarveRR: Go
I'll have a look into it... if I can get my head round that! lol
@BumpInTheNight: Go
I did have a look in all the comparison conditions, but I can't for the life of me find it! I'm sure it's just me being stupid!
Hey takes some getting used to for sure, btw I just found it: Create a new condition, click on the left most bracket of the condition, when the function list pops up click on the unit group label and it'll be there as "Units in region matching condition". Or if you're seeking the number itself, first 'number of units in unit group' and then specify that 'units in region matching conditions' as the group to acquire the amount of.
@BumpInTheNight: Go
Thanks for the help
I found units in region matching condition, as I have used that once or twice before. I can't get it to say number of living units = 0 though. I have seen other people using this condition:
number of living units in a region with matching conditions Amount = x
@James7285: Go
my bad you're right I do remember seeing that specific wording as a trigger and yah I'm having an equally difficult time remembering how to get to it.
ED: Well, I think this is it after all, I mean it does the same thing any ways.
@BumpInTheNight: Go
Thats the one! your a legend, thanks!
Try adding a unit to a unit group when it enters a region and removing it from it when it leaves. Then just do a loop that checks which unit group the unit is in.