- Joined
- Jul 25, 2009
- Messages
- 3,091
Alright so, this is kind of awkward to explain, so let me give you a picture.
I've got a bunch of units in my map that are locusted and/or won't hold formation for whatever reason (also won't hold formation when you attack move) and I want them to, instead of clump in a single point, surround the point they were ordered to. This would of course be implemented into my existing squad system.
Here's a snippet of code (copied from Amigurumi's System) for ordering the members of a group to move. What's the easiest way to achieve this kind of relative movement without causing lag?
P.S. I forgot how to do GUI tags on Hive.
Order Squad Leader
Events
Unit - A unit Is issued an order with no target
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Conditions
((Ordered unit) is A structure) Equal to False
GLeader[(Custom value of (Ordered unit))] Equal to (Ordered unit)
(Custom value of (Ordered unit)) Not equal to 0
Actions
Trigger - Turn off (This trigger)
Set GGroup[1] = (Units in (Playable map area) matching (((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit))) and (((Matching unit) is A structure) Equal to False)))
Custom script: call GroupImmediateOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()) )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetUnit() )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetDestructable() )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetItem() )
Set GPoint[1] = (Target point of issued order)
Custom script: call GroupPointOrderLoc( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), udg_GPoint[1] )
Custom script: call RemoveLocation(udg_GPoint[1])
Custom script: call DestroyGroup(udg_GGroup[1])
Trigger - Turn on (This trigger)
I've got a bunch of units in my map that are locusted and/or won't hold formation for whatever reason (also won't hold formation when you attack move) and I want them to, instead of clump in a single point, surround the point they were ordered to. This would of course be implemented into my existing squad system.
Here's a snippet of code (copied from Amigurumi's System) for ordering the members of a group to move. What's the easiest way to achieve this kind of relative movement without causing lag?
P.S. I forgot how to do GUI tags on Hive.
Order Squad Leader
Events
Unit - A unit Is issued an order with no target
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Conditions
((Ordered unit) is A structure) Equal to False
GLeader[(Custom value of (Ordered unit))] Equal to (Ordered unit)
(Custom value of (Ordered unit)) Not equal to 0
Actions
Trigger - Turn off (This trigger)
Set GGroup[1] = (Units in (Playable map area) matching (((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit))) and (((Matching unit) is A structure) Equal to False)))
Custom script: call GroupImmediateOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()) )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetUnit() )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetDestructable() )
Custom script: call GroupTargetOrder( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), GetOrderTargetItem() )
Set GPoint[1] = (Target point of issued order)
Custom script: call GroupPointOrderLoc( udg_GGroup[1], OrderId2String(GetIssuedOrderId()), udg_GPoint[1] )
Custom script: call RemoveLocation(udg_GPoint[1])
Custom script: call DestroyGroup(udg_GGroup[1])
Trigger - Turn on (This trigger)