In my map, the structures in question have a unique pathing footprint that allows land units to move "inside" of certain parts of them. The problem is that when multiple units move to these structures, they end up clumping together inside and it becomes difficult for other units to enter. As the structure repairs units inside of it, it becomes very difficult for the other team to break into it.
So, as a solution, I'd like to create an effect that issues orders to move to a random point in a ring outside of the structure, and then Stop at that point. I think the desired behavior can be done using the same sort of effect as I have now, which searches for nearby structures and orders the unit to move to the nearest one only when the unit doesn't have orders; the main difference would be that rather than moving directly to the point of the structure, it would consistently pick the same "random" point (random in the sense that different units would pick a different point) outside the structure and move to that instead.
Here's a picture that illustrates the problem:
One thing that must remain consistent is the unit constantly searching for the nearest structure, even once it's arrived at its destination. Units already do this right now as the Search Area effect I use is called by a behavior with a periodic effect that is enabled through validation only when the unit doesn't have orders, which it shouldn't once it's reached its destination; the problem is the tendency to "lump" up targetting the same point.
I'm thinking one way to do this is to have another Search Area effect on units found by the first Search Area effect. This new Search Area would be sourced on the found unit and would have a large radius under the Search: Areas field, and then a smaller radius under the Search: Exclude field. However, I don't know how to guarantee that the same point would be selected every time.
Does anyone have any suggestions on how to go about doing this, or any better ideas on how to structure it? I have a hunch how I could do it in triggers but I am very much trying to avoid using them for this particular mechanic.
You could order the unit to an offset point, using a persistent effect. You would need a sufficient amount of offset points in the persistent, and they need to be distributed in a circular shape (order to points in a random point on a circle is a lot easier to do with triggers, though).
Also, you would need to prevent the unit from getting an order to a new random point for every check.
The issue order just would need a not moving validator and a Location Range to prevent it from moving again if it is within certain distance parameters
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I'm having trouble doing this, so I'm just going to shelve it for a while and work on other things. I'll post in the topic again if I have any luck in the future.
Thanks for the help!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
The effect I'm trying to make here is the logical conclusion to ones discussed in couple of other topics I posted a while back, where I asked how to make a unit seek out and move to the nearest structure of a nearest type, and how to validate an effect so it gives its owner orders only when said owner doesn't have orders.
In my map, the structures in question have a unique pathing footprint that allows land units to move "inside" of certain parts of them. The problem is that when multiple units move to these structures, they end up clumping together inside and it becomes difficult for other units to enter. As the structure repairs units inside of it, it becomes very difficult for the other team to break into it.
So, as a solution, I'd like to create an effect that issues orders to move to a random point in a ring outside of the structure, and then Stop at that point. I think the desired behavior can be done using the same sort of effect as I have now, which searches for nearby structures and orders the unit to move to the nearest one only when the unit doesn't have orders; the main difference would be that rather than moving directly to the point of the structure, it would consistently pick the same "random" point (random in the sense that different units would pick a different point) outside the structure and move to that instead.
Here's a picture that illustrates the problem:
One thing that must remain consistent is the unit constantly searching for the nearest structure, even once it's arrived at its destination. Units already do this right now as the Search Area effect I use is called by a behavior with a periodic effect that is enabled through validation only when the unit doesn't have orders, which it shouldn't once it's reached its destination; the problem is the tendency to "lump" up targetting the same point.
I'm thinking one way to do this is to have another Search Area effect on units found by the first Search Area effect. This new Search Area would be sourced on the found unit and would have a large radius under the Search: Areas field, and then a smaller radius under the Search: Exclude field. However, I don't know how to guarantee that the same point would be selected every time.
Does anyone have any suggestions on how to go about doing this, or any better ideas on how to structure it? I have a hunch how I could do it in triggers but I am very much trying to avoid using them for this particular mechanic.
You could order the unit to an offset point, using a persistent effect. You would need a sufficient amount of offset points in the persistent, and they need to be distributed in a circular shape (order to points in a random point on a circle is a lot easier to do with triggers, though).
Also, you would need to prevent the unit from getting an order to a new random point for every check.
The issue order just would need a not moving validator and a Location Range to prevent it from moving again if it is within certain distance parameters
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I'm having trouble doing this, so I'm just going to shelve it for a while and work on other things. I'll post in the topic again if I have any luck in the future.
Thanks for the help!