[Guide] In-editor placement randomization
Posted: Thu Jul 24, 2014 11:52 am
Intro:
Randomizing the location of units and groups is fairly straightforward and easy to do without any scripting. However, it might not be too obvious if you're not used to the editor and as I'm not aware of an up-to-date guide for this I figured it might be best to make one. Hope it helps.
Randomization of groups and units:
1. Semi-randomization: Marker-method
This is a great method to add a random element while avoiding the pitfalls of full randomization. Simply place any type of marker ("empty" recommended) and use the grouping tool (F2) to link a group leader or vehicle with one or more markers. At mission start the unit will either be at it's default location or at one of the markers. Note: If the unit is a group leader it's group members will only be moved if they are set to be "in formation".
2. Full randomization: Placement radius
This is very straightforward: Simply increase the value for "placement radius" in the unit window in the editor. For a group it's enough to set the group leader's value as all members will be moved as well, as long as their "Special" field ist set to be "In Formation". The game will do it's best to avoid placing units in buildings or other "bad" spots.
Tip:
You can combine these two: If you group a unit with placement radius > 0 to several markers, they will first be placed at one of those markers, then the placement radius will be applied second.
Combining Waypoints and Unit randomization:
Problem: Spatial waypoints won't work
The majority of waypoints people know and use are probably the "spatial waypoints", i.e. waypoints placed somewhere in the open terrain:
Image taken from BIKI
These are obviously of no use for unit randomization, as they'll always be placed at their in-editor location and not adjust dynamically.
Solution: Attached waypoints
Less commonly used but very useful for unit randomization are attached waypoints. To attach a waypoint, simply select the waypoint tool (F4) and double-click on a unit or object. You'll see a little red square for a waypoint attached to an object and on dragging the unit around the waypoint will move with it.
What's useful for us is that the waypoint is initialized after the unit has been placed, thus wherever it ends up after randomization. If for example you attach a sentry waypoint to the leader of a randomly placed group they'll act as a sentry where-ever they'll end up.
Tip:
You can also combine this with functions that are commonly called from Waypoint Activiation fields (e.g. BIS_fnc_taskPatrol or ws_fnc_taskDefend) for further functionality.
Random Patrol Module
Found under Modules>Site>Random Patrol this module allows semi-randomization of groups with better control over waypoints.. It's a useful replacement to the above methods if you have very specific paths in mind.
One of the NATO groups will be put in either the patrol pattern (left) or at the hold marker (right). Everything else will be deleted.
Randomizing the location of units and groups is fairly straightforward and easy to do without any scripting. However, it might not be too obvious if you're not used to the editor and as I'm not aware of an up-to-date guide for this I figured it might be best to make one. Hope it helps.
Randomization of groups and units:
1. Semi-randomization: Marker-method
This is a great method to add a random element while avoiding the pitfalls of full randomization. Simply place any type of marker ("empty" recommended) and use the grouping tool (F2) to link a group leader or vehicle with one or more markers. At mission start the unit will either be at it's default location or at one of the markers. Note: If the unit is a group leader it's group members will only be moved if they are set to be "in formation".
2. Full randomization: Placement radius
This is very straightforward: Simply increase the value for "placement radius" in the unit window in the editor. For a group it's enough to set the group leader's value as all members will be moved as well, as long as their "Special" field ist set to be "In Formation". The game will do it's best to avoid placing units in buildings or other "bad" spots.
Tip:
You can combine these two: If you group a unit with placement radius > 0 to several markers, they will first be placed at one of those markers, then the placement radius will be applied second.
Combining Waypoints and Unit randomization:
Problem: Spatial waypoints won't work
The majority of waypoints people know and use are probably the "spatial waypoints", i.e. waypoints placed somewhere in the open terrain:
Image taken from BIKI
These are obviously of no use for unit randomization, as they'll always be placed at their in-editor location and not adjust dynamically.
Solution: Attached waypoints
Less commonly used but very useful for unit randomization are attached waypoints. To attach a waypoint, simply select the waypoint tool (F4) and double-click on a unit or object. You'll see a little red square for a waypoint attached to an object and on dragging the unit around the waypoint will move with it.
What's useful for us is that the waypoint is initialized after the unit has been placed, thus wherever it ends up after randomization. If for example you attach a sentry waypoint to the leader of a randomly placed group they'll act as a sentry where-ever they'll end up.
Tip:
You can also combine this with functions that are commonly called from Waypoint Activiation fields (e.g. BIS_fnc_taskPatrol or ws_fnc_taskDefend) for further functionality.
Random Patrol Module
Found under Modules>Site>Random Patrol this module allows semi-randomization of groups with better control over waypoints.. It's a useful replacement to the above methods if you have very specific paths in mind.
One of the NATO groups will be put in either the patrol pattern (left) or at the hold marker (right). Everything else will be deleted.