Okay, so. I figured I'd make a new thread for this since the other one wasn't quite about this system but was more for trying to figure out how SC2 triggers work which I think I got it down now. (Maybe xD!)
So, the problem I'm having is that using this system I made you cannot queue orders via Shift Click. This is the trigger:
MagixBoxTriggerEventsUnit-AnyUnitisissuedanordertoAnyAbilityCommandLocalVariablesP_Center=NoPoint<Point>P_Target=NoPoint<Point>P_UnitPoint=NoPoint<Point>P_OrderAngle=0.0<Real>P_Distance=0.0<Real>P_XofUnit=0.0<Real>P_XResult=0.0<Real>P_YofUnit=0.0<Real>P_YResult=0.0<Real>P_Count=0<Integer>P_Int=0<Integer>P_UnitsOrdered=0<Integer>P_InitialOrder=NoAbilityCommand<AbilityCommand>P_OrderUnit=NoUnit<Unit>P_Group=(Emptyunitgroup)<UnitGroup>Conditions(Targettypefor(Triggeringorder))==PointActionsGeneral-ForeachintegerP_Intfrom1to16withincrement1,do(Actions)ActionsVariable-SetP_Target=(Targetpointfor(Triggeringorder))General-If(Conditions)thendo(Actions)elsedo(Actions)IfOrConditions(Triggeringorder)==(((Move,0))targetingP_Target)(Triggeringorder)==(((Move,1))targetingP_Target)(Triggeringorder)==(((Move,3))targetingP_Target)ThenVariable-SetP_InitialOrder=(Abilitycommandfor(Triggeringorder))ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If((Triggeringunit)isinP_Group[P_Int]) == True
Then
Unit Group - Pick each unit in P_Group[P_Int] and do (Actions)
Actions
Variable - Set P_XofUnit = (X of (Position of (Picked unit)))
Variable - Set P_YofUnit = (Y of (Position of (Picked unit)))
Variable - Set P_XResult = (P_XResult + P_XofUnit)
Variable - Set P_YResult = (P_YResult + P_YofUnit)
Variable - Set P_Count = (P_Count + 1)
Variable - Set P_Center = (Point((P_XResult / P_Count), (P_YResult / P_Count)))
Variable - Set P_OrderAngle = (Angle from P_Center to P_Target)
Variable - Set P_Distance = (Distance between P_Center and P_Target)
Variable - Set P_XofUnit = 0.0
Variable - Set P_YofUnit = 0.0
Variable - Set P_XResult = 0.0
Variable - Set P_YResult = 0.0
Variable - Set P_Count = 0
Unit Group - Pick each unit in P_Group[P_Int] and do (Actions)
Actions
Variable - Set P_OrderUnit = (Picked unit)
Variable - Set P_UnitPoint = (Position of (Picked unit))
Trigger - Turn (Current trigger) Off
General - If (Conditions) then do (Actions) else do (Actions)
If
(Distance between P_UnitPoint and P_Center) > 10.0
Then
Unit - Order (Picked unit) to (P_InitialOrder targeting P_Target) (Replace Existing Orders)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Distance between P_Target and P_Center) < 1.0ThenUnit-Order(Pickedunit)to(P_InitialOrdertargetingP_Target)(ReplaceExistingOrders)ElseUnit-Order(Pickedunit)to(P_InitialOrdertargeting((Positionof(Pickedunit))offsetbyP_DistancetowardsP_OrderAngledegrees))(ReplaceExistingOrders)Trigger-Turn(Currenttrigger)OnElse
I have tried setting the (Replace Existing Orders) with (Before/After Existing Orders) but that does not remove the initial order, which is crucial for this to work. The actual order via the normal order buttons (Move/Patrol/Etc) needs to be removed entirely, but the orders via trigger still need to be queueable. Any ideas?
Okay, I'm not quite sure what you're talking about there. =p
Can you provide an example?
SC2Mapster Unofficial Discord! - https://discord.gg/DXENztk
Okay, so. I figured I'd make a new thread for this since the other one wasn't quite about this system but was more for trying to figure out how SC2 triggers work which I think I got it down now. (Maybe xD!)
So, the problem I'm having is that using this system I made you cannot queue orders via Shift Click. This is the trigger:
I have tried setting the (Replace Existing Orders) with (Before/After Existing Orders) but that does not remove the initial order, which is crucial for this to work. The actual order via the normal order buttons (Move/Patrol/Etc) needs to be removed entirely, but the orders via trigger still need to be queueable. Any ideas?
SC2Mapster Unofficial Discord! - https://discord.gg/DXENztk