Move Order is a special function that determines in which order Control Points will be selected.
Move Order function is used as a parameter by Advanced Control Points Component. Every “...Go Next…” or “Teleport Next…” Actions try to select next Control Point for its owner. This selection is made by Move Order function currently chosen as Advanced Control Points Component parameter.
Beside setting Move Order inside Advanced Control Points Component itself, this function can be set indirectly using:
• Spawn Point
• Settings Override
• Trigger Task Settings Override
There are 2 default Move Order
Sequentially – choose next Control Point as next position in Control Points parameter array
• Is Looped – if true and Action “…Go Next…” or “Teleport Next…” try to select Control Point from last index, then first will be chosen. When false then Actor will stay on the last Control Point forever.
• Delay Between Tries – When for some reason Actor cannot go to the next Control Point, eg. is occupied by too many Actors, function will check it’s occupation again for this amount of time.
Also when Bypass parameter is set for bypassing and every existing Control Points in array are completly occupied/targeted, function will check it’s occupation/targeting again for this amount of time.
• Bypass – parameter for decide which Control Point to choose when next one is Occupied or Targeted
> Do Not Bypass: wait until next Control Point become neither Targeted nor Occupied
> Bypass Only Targeted, Wait on Occupied: bypass Targeted Control Points but wait when next Control Point is Occupied or Mixed (Occupied and Targeted)
> Bypass Only Occupied, Wait on Targeted: bypass Occupied Control Points but wait when next Control Point is Targeted or Mixed (Occupied and Targeted)
> Bypass Targeted and Occupied: bypass Targeted and Occupied Control Points, never wait
Randomly – choose random Control Point as next position in Control Points parameter array
• Number of Nearest Control Points under Consideration – random algorithm consider only this number of nearest Control Points.
Distance sorting is made only once on Advanced Control Points Component start.
BEWARE: Less than 3 is not a logical option in most cases because some of Control Points can never be achieved.
• Priority Behaviour – how to treat Priority parameter inside Control Points
> Ignore Priority: completly ignore Priority parameter
> Consider Priority only in Range: consider Priority only in nearest Control Points under consideration
> Always consider Priority: first find highest Priority Control Points from whole array, then from among them only, choose nearest Control Points under consideration
• Bypass – parameter for decide which Control Point to choose when next one is Occupied or Targeted
> Do Not Bypass: wait until next Control Point become neither Targeted nor Occupied
> Bypass Only Targeted, Wait on Occupied: bypass Targeted Control Points but wait when next Control Point is Occupied or Mixed (Occupied and Targeted)
> Bypass Only Occupied, Wait on Targeted: bypass Occupied Control Points but wait when next Control Point is Targeted or Mixed (Occupied and Targeted)
> Bypass Targeted and Occupied: bypass Targeted and Occupied Control Points, never wait
Move Order can be used in 4 places
Move Order is Advanced Control Points Component parameter.
Spawn Point has parameter Move Order which will be used in newly spawn Actors.
Inside Control Point details panel when Settings Override is chosen – inside it new Move Order can be set.
Trigger Task named Settings Override has Move Order parameter, which will be used in new settings of selected Actors by this Trigger Task.
Create custom Move Order
Move Orders are designed to be easly created for your needs. To create new kind of Move Order which cover your needs, simply create child from CP_MoveOrder_Base or duplicate one of existing MoveOrder object and modify. Its structure is fairly simple and intuitive.
1.
Firstly create a child by inheriting from the MoveOrder base class CP_MoveOrder_Base.
Base class file can be found in Plugin Content Directory.
Then name the new MoveOrder.
Open new blueprint.
Be aware when you create new object in content browser inherited from CP_MoveOrder_Base it will show you automatically on the list of available Move Orders.
2.
Code use following variables:
- Is Looped (boolean) – default value true (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
- Bypass (E_ControlPoints_Bypass) – default value Bypass Targeted and Occupied Control Point (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
- Delay Between Tries when Next Point is Occupied (float) – default value 0,5 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
- Steps Front (integer) – default value 3 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
- Steps Back (integer) – default value 1 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
- Steps Direction (boolean) – default value true
- Steps (integer) – default value 0
- Do Change Direction (boolean) – default value true
3.
Click to Macro -> (+)
Named it Check Can Be Occupied ? (Targeted + Occupied).
This is helpful Macro.
4.
Create very simple code for this Macro.
The code check whether selected Control Point can be Occupied and/or Targeted.
5.
Click to Macro -> (+)
Named it Change Direction.
This is helpful Macro.
6.
Create simple code for this Macro.
The code change direction of next choosing Control Point.
7.
Click to Functions -> Override – > Get Next Control Point
This function is fired every time when Move Order must return next Control Point.
8.
The code provide chosen Control Point depends on user parameters. If neither non Occupied nor non Targeted Control Point is found – appropriate information will be returned.
For better view – download below image and zoom.
9.
Click to Functions -> Override – Initialize
Event is fired when Advanced Control Points Component start.
All kinds of starting code for Move Order should be placed here.
10.
Create very simple code connected to this event.
You should remember to always call parent function when override this event.
The code initialize startup parameters and decide whether switch direction will be needed.
11.
Inside Blueprint Editor of new Move Order. Click Class Settings in top belt.
Then choose Blueprint Display Name and write name you wish to see on Move Orders list.
Next choose Blueprint Description and write name you wish to see on mouse hover in this list.
12.
Click on selected Spawn Point or Advanced Control Points Component on the level.
In Spawn Point or Advanced Control Points Component details panel find parameter Move Order.
Find our new Move Order in the list – wait a moment with hoover, and check description.
13.
We are ready to parametrize our new Move Order.
14.
Our Move Order during action.
Available functions/events to override in Move Order Base Class
• Initialize – An event which run when Advanced Control Points Component start. You should remember to always call parent function when override this event.
> Actor Component Control Points: IN reference to Advanced Control Points Component, owner of this Move Order.
• Get Next Control Point – Function which return next Control Point. It’s fired every time when Action or Begin Action of type “…Go Next…” or “Teleport Next…” ask for it.
> Is Found New Control Point: OUT information neither non Occupied nor non Targeted Control Point is found.
> Is Reached Last Possible Control Point: OUT if true then last Control Point is reached and Is Looped parameter is set to false.
> Next Control Point Index: OUT current Control Point index from array parameter in Advanced Control Points Component, chosen by this function and valid only if Is Found New Control Point is true.