I am trying to use triggers to pick all units in a region, and then create copies in a different region (alternatively moving units), keeping their formations intact.
Not sure how to do it, and I couldn't find anything by searching. Any help?
You need to find their bearings relative to the centre of the region (angle and distance) and store it in an integer variable array with two dimensions. You can then reverse the process in your destination region.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I would advise looking at the LOTV campaign mission with the moving platform since that uses the same principle to determine where to move units to relative to their current location.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Couldn't you just use some basic math? Like grab the point of the first unit, then every other unit you could subtract the x & y of their position and the first units, to get their relative position.
The new units would then be the first unit and its position, then the remaining units would be the first units position +- the relative numbers.
When you say "Like grab the point of the first unit, then every other unit you could subtract the x & y of their position and the first units, to get their relative position." could you instead just refer me to the trigger actions you're talking about?
Not sure what a region has to do with a "first unit". It's going to be a multiplayer map. The units are not pre-placed.
I need to know which actions to use, not meaningless descriptions of what will happen. The trigger editor isn't intuitive enough for me to just imagine something happening, and then tell it to do it.
It's got weird quirks, like converting reals to integers, when the real should have been an integer to begin with. There are plenty of examples when it comes to triggers where it's just a case of knowing where to begin with an action, rather than it making sense where to begin.
I am on this forum because it's the last bastion of hope for mapmaking. I don't need you to derail my question. I do need to know what actions to use.
You will mostly be using Variable Set actions and Create Units Facing Angle actions. The functions you need are Position Of Unit, Facing Angle Of Unit, and Point With Polar Offset. Depending how you want to initiate your duplication the Point From XY and Convert Circle To Region functions may also be helpful.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I am trying to use triggers to pick all units in a region, and then create copies in a different region (alternatively moving units), keeping their formations intact.
Not sure how to do it, and I couldn't find anything by searching. Any help?
You need to find their bearings relative to the centre of the region (angle and distance) and store it in an integer variable array with two dimensions. You can then reverse the process in your destination region.
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
In reply to DrSuperEvil:
I would advise looking at the LOTV campaign mission with the moving platform since that uses the same principle to determine where to move units to relative to their current location.
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
Couldn't you just use some basic math? Like grab the point of the first unit, then every other unit you could subtract the x & y of their position and the first units, to get their relative position.
The new units would then be the first unit and its position, then the remaining units would be the first units position +- the relative numbers.
In reply to MaskedImposter:
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
The first unit wouldn't be relative, it would be absolute. Every other unit would be relative to the first unit.
In reply to MaskedImposter:
You will mostly be using Variable Set actions and Create Units Facing Angle actions. The functions you need are Position Of Unit, Facing Angle Of Unit, and Point With Polar Offset. Depending how you want to initiate your duplication the Point From XY and Convert Circle To Region functions may also be helpful.
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