What I'm basically trying to do is define a Region variable based on what Region a unit enters.
So to give a better idea, I have something like 50 regions. As an example, if a unit enters Region 001, a variable "NextRegion" will be set to Region 002, and the unit will be issued an order to Region 002. Upon entering Region 002, "NextRegion" will be set to 003, and it continues like that.
I'm having trouble because there is no event for a unit entering a generic region; it has to be specific. So instead I thought, perhaps a periodic 0.0 sec event that checks if the position of the unit is within the region.
However the deepest issue is that it's difficult to define these regions numerically like I had originally planned, because I discovered that region names are not actually defined in the map. So I tried doing something like RegionFromId(Variable Integer), and upon entering, ordering the unit to RegionFromId(Variable Integer +1) and of course setting the variable +1 as well and all that. Well for some reason that doesn't seem to do anything, even if I just use a set integer instead of a variable. It never does the initial order to move to that region. It does if I just select the specific region, however.
Anyway, if I tediously pick each region and and define exactly what the next region should be, the unit will move as it should.
I used RegionFromID in one of my own maps, which worked. The thing is, that you have to place all of the regions in the order you need them, to use RegionFromID. What I done in my map, was to make an initialization trigger with a for each to put all of the regions into a region array. Then, I could just call the regions from the array when I needed them.
I hope this helped. Reply if you still got issues, or if I should clarify anything.
What I'm basically trying to do is define a Region variable based on what Region a unit enters.
So to give a better idea, I have something like 50 regions. As an example, if a unit enters Region 001, a variable "NextRegion" will be set to Region 002, and the unit will be issued an order to Region 002. Upon entering Region 002, "NextRegion" will be set to 003, and it continues like that.
I'm having trouble because there is no event for a unit entering a generic region; it has to be specific. So instead I thought, perhaps a periodic 0.0 sec event that checks if the position of the unit is within the region.
However the deepest issue is that it's difficult to define these regions numerically like I had originally planned, because I discovered that region names are not actually defined in the map. So I tried doing something like RegionFromId(Variable Integer), and upon entering, ordering the unit to RegionFromId(Variable Integer +1) and of course setting the variable +1 as well and all that. Well for some reason that doesn't seem to do anything, even if I just use a set integer instead of a variable. It never does the initial order to move to that region. It does if I just select the specific region, however.
Anyway, if I tediously pick each region and and define exactly what the next region should be, the unit will move as it should.
Point being, I need an efficient way to do this.
I used RegionFromID in one of my own maps, which worked. The thing is, that you have to place all of the regions in the order you need them, to use RegionFromID. What I done in my map, was to make an initialization trigger with a for each to put all of the regions into a region array. Then, I could just call the regions from the array when I needed them.
I hope this helped. Reply if you still got issues, or if I should clarify anything.
@ScorpSCII: Go
How did you set each region to the array?
Which I thought would result in "RegionFromId(Picked integer)" essentially.
I also tried
Doesn't seem to be working. I think I'm doing it wrong.
This is how my trigger looks like, and it works perfectly.
It indeed works perfectly, thank you very much!