- Joined
- Oct 9, 2015
- Messages
- 721
So I was in need of help doing something point-related. My goal is to store 2 or more points when unit is ordered to patrol: The position of the unit and the position of the issued order. So I stored them in variables, something like this:
PS: I also needed to store more than two points as patrol orders can be queued.
-
FACSYS Order Memory
-
Events
- Unit - A unit Is issued an order targeting a point
- Conditions
-
Actions
- Set FACSYS_TempOrder = (Issued order)
- Set FACSYS_Unit[1] = (Triggering unit)
- Set FACSYS_TempInteger[1] = (Custom value of FACSYS_Unit[1])
- -------- Here we check for Patrol order --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- FACSYS_TempOrder Equal to FACSYS_OrderPatrol
-
Then - Actions
- Set FACSYS_StoredOrder[FACSYS_TempInteger[1]] = FACSYS_TempOrder
- Set FACSYS_Loc[FACSYS_TempInteger[1]] = (Position of FACSYS_Unit[1])
- Set FACSYS_Loc1[FACSYS_TempInteger[1]] = (Target point of issued order)
- Else - Actions
-
If - Conditions
-
Events
-
Untitled Trigger 003
- Events
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- FACSYS_StoredOrder[FACSYS_TempInteger[1]] Equal to FACSYS_OrderPatrol
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between FACSYS_Loc[1] and FACSYS_Loc[FACSYS_TempInteger[1]]) Greater than (Distance between FACSYS_Loc[1] and FACSYS_Loc1[FACSYS_TempInteger[1]])
-
Then - Actions
- Unit - Order FACSYS_Unit[1] to Patrol To FACSYS_Loc[FACSYS_TempInteger[1]]
-
Else - Actions
- Unit - Order FACSYS_Unit[1] to Patrol To FACSYS_Loc1[FACSYS_TempInteger[1]]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
PS: I also needed to store more than two points as patrol orders can be queued.