In my map I want groups of units to patrol together, as in they stick together as a unit on their route and engage enemies together too. It's easy to set a patrol command, but as time passes the units tend to thin out along the line due to basic entropy and the clipping sizes of the units. Any idea how to fix this?
I could put in a wait command so they all bunch back up at each "point" along the patrol route, before moving on, but then they are taking long breaks instead of marching around.
Create an action definition with the Create Thread option checked. Under actions, create a While loop with the conditions being whatever you need to determine if the units are still patrolling. Under the actions of the loop, Pick Each Unit in the patrol group and use an If-Then-Else function, checking if the picked unit is some distance away from the center of the group (you'll need some way to determine the center.) If true (meaning the unit is far away from the center) use the Move Unit (Instantly) function with blending checked to move the unit closer to the center. Add a short wait function (like 0.5 seconds or whatever) to complete the loop. Every time the group begins patrolling, run this action definition.
pick each unit in unit group
if unit is too far from center of unit group
pick each unit in unit group
order unit move to center of unit group (before existing orders)
wait about 0.5 seconds
order unit group to move to original target point
I'm having some trouble assigning units into a unit group or creating a unit group at all. I feel like making global unit groups would be most beneficial, so I could assign units to a group in one trigger and tell them what to do in another, but am unsure how to do this.
action definition: rightclick on the left panel where the triggers are displayed. then click new and select action definition. after that follow basharteg's instructions
I'm having some trouble assigning units into a unit group or creating a unit group at all. I feel like making global unit groups would be most beneficial, so I could assign units to a group in one trigger and tell them what to do in another, but am unsure how to do this.
To create a global variable, right click in the bottom left pane (the one that shows your trigger objects) and select New Variable. The type of variable you want is a Unit Group variable. After your variable is created, you can use an action to define it. The function to do this is Set Variable. Alternatively, you can add units to the Unit Group variable individually by using the Add Unit to Unit Group function.
The other way to handle it is to use a Unit Group Parameter in the action definition I described, but for the sake of keeping things basic I think a global variable would be best for you right now.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
In my map I want groups of units to patrol together, as in they stick together as a unit on their route and engage enemies together too. It's easy to set a patrol command, but as time passes the units tend to thin out along the line due to basic entropy and the clipping sizes of the units. Any idea how to fix this?
I could put in a wait command so they all bunch back up at each "point" along the patrol route, before moving on, but then they are taking long breaks instead of marching around.
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
Create an action definition with the Create Thread option checked. Under actions, create a While loop with the conditions being whatever you need to determine if the units are still patrolling. Under the actions of the loop, Pick Each Unit in the patrol group and use an If-Then-Else function, checking if the picked unit is some distance away from the center of the group (you'll need some way to determine the center.) If true (meaning the unit is far away from the center) use the Move Unit (Instantly) function with blending checked to move the unit closer to the center. Add a short wait function (like 0.5 seconds or whatever) to complete the loop. Every time the group begins patrolling, run this action definition.
@BasharTeg: Go
Yikes you just went a little deep for me. Where is the "create thread" option?
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
It's under options for Action Definitions.
i've done something similar
also used a trigger
pick each unit in unit group
if unit is too far from center of unit group
pick each unit in unit group
order unit move to center of unit group (before existing orders)
wait about 0.5 seconds
order unit group to move to original target point
@BasharTeg: Go
I must be a total idiot because I'm not able to find "Action Definitions" either. I'm staring at the trigger editor... where do I go from here?
@maverck: Go
I'm having some trouble assigning units into a unit group or creating a unit group at all. I feel like making global unit groups would be most beneficial, so I could assign units to a group in one trigger and tell them what to do in another, but am unsure how to do this.
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
action definition: rightclick on the left panel where the triggers are displayed. then click new and select action definition. after that follow basharteg's instructions
To create a global variable, right click in the bottom left pane (the one that shows your trigger objects) and select New Variable. The type of variable you want is a Unit Group variable. After your variable is created, you can use an action to define it. The function to do this is Set Variable. Alternatively, you can add units to the Unit Group variable individually by using the Add Unit to Unit Group function.
The other way to handle it is to use a Unit Group Parameter in the action definition I described, but for the sake of keeping things basic I think a global variable would be best for you right now.