• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to change the distance of armies when they're summoned?

Status
Not open for further replies.
Level 4
Joined
Jan 1, 2013
Messages
94
Please help, I want to change the distance between of my armies (like the movie Lord Of The Rings monsters lines up neat and walk together) when they walk out ...sorry for my English and I', a newbie too :ogre_hurrhurr:
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Polar projection

targetX = sourceX + dist * cos(angle)
targetY = sourceY + dist * sin(angle)

You basically compute the target coordinates as if you were travelling from a source location into a given direction at a given distance.

So if you want a group of 3 rows and 4 columns for example, set the center location, the angle ang of the formation and the distance dist between each unit, you can go 3./2*dist towards ang, 4./2*dist towards ang+90° to reach a corner. From there progressively (in a 2d loop) return (reversed ang) in steps of dist to get the individual spots to place units on.

Walking consistenly together however can be a problem. You either have to sync and redirect the targets since you never know if some units get stuck somewhere or maybe better issue the commands as unit group (Unit Group - Issue Order...). That works for unit groups of max 12 units and is like the formation setting next to the minimap ingame. I do not know what the distance between the units it uses there depends on.

edit: When using that group formation feature, the units may also get their spots swapped/reassigned. They do not strictly walk in the exact formation the whole time, only try to shape up at the target location.
 
Level 4
Joined
Jan 1, 2013
Messages
94
Polar projection

targetX = sourceX + dist * cos(angle)
targetY = sourceY + dist * sin(angle)

You basically compute the target coordinates as if you were travelling from a source location into a given direction at a given distance.

So if you want a group of 3 rows and 4 columns for example, set the center location, the angle ang of the formation and the distance dist between each unit, you can go 3./2*dist towards ang, 4./2*dist towards ang+90° to reach a corner. From there progressively (in a 2d loop) return (reversed ang) in steps of dist to get the individual spots to place units on.

Walking consistenly together however can be a problem. You either have to sync and redirect the targets since you never know if some units get stuck somewhere or maybe better issue the commands as unit group (Unit Group - Issue Order...). That works for unit groups of max 12 units and is like the formation setting next to the minimap ingame. I do not know what the distance between the units it uses there depends on.

edit: When using that group formation feature, the units may also get their spots swapped/reassigned. They do not strictly walk in the exact formation the whole time, only try to shape up at the target location.


I'm really appreciate that you translate step by step for me....but I'm still don't understand it....is it I have to find it in Event , Conditions or Actions?:ogre_hurrhurr:
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Polar Projection is a location function in GUI. Whereever it expects a location, you can state this function. For example in Unit - Create or Unit - Move actions. You can however also assemble locations from coordinates (Conversion - Convert Coordinates To Point) and calculate it like I have shown you above with Arithmetic function and Math - Cos/Sin.

Unit Group - Issue Order... is of course an action.

If you still do not know what to do and throw such general questions, frankly, you lack all the basics and should get a grasp of them before challenging concrete problems they are required for.
 
Status
Not open for further replies.
Top