Action

Action Action is a special function for change something in a level – in most cases it influence on Actor moved between Control Points.

Every Action has its own specific configuration when you add it to the list.


Default Actions can be divided into three categories:

  • Character – whose name starts with “[Character]…” and should only be used for children of the class “Character” because they use character specific functions and variables.
  • Pure Actor – whose name start with “[Pure Actor]…” can be used on any kind of Actors also on Characters, Pawn, Emitters, Static Meshes, etc. These Actions don’t use specific functions or variables. In most cases you don’t want to use them for characters because they are designes specially for pure Actors.
  • General – whose name don’t have any prefix. These Actions can be used on any Actor. Some of them have special function which don’t affect on Actor who run this Action e.g. “Back to Action”.


There are 42 default Actions

Action 32 [Character] Go Next – Go to the next Control Point.
  Action uses the Character Movement Component to move to the next Control Point selected by the Move Order function.

Action 32 [Character] Go Next and Jump – Go to the next Control Point and jump somewere halfway.
  Action uses the Character Movement Component to move to the next Control Point selected by the Move Order function. After selected time, Character Movement Component is used to jump.

Action 32 [Character] Go Next by Spline – Go to the next Control Point through Spline.
  Action has 3 different moving methods which can be used:
  • Simple – uses Set Actor Location node for moving and manually setup Character animation. Lowest impact on performance but without using NavMesh and without avoiding obstacles.
  • Advance faced natural – movement is handled partially by Movement Component. Rotation, moving target and every tick correction for moving on spline is done with special code. Set temporary destination target in front of the character (counted depends on spline position). Temporary destination point can be outside of the spline. High impact on performance but using Movement Component for most advance movement quality. This method create movement a little more natural but a little less safer (can fall out of spline on very on shap curves).
  • Advance faced to Spline ahead – movement is handled partially by Movement Component. Rotation, moving target and every tick correction for moving on spline is done with special code. Set temporary destination target in front of the character on spline (counted depends on spline position). Temporary destination point is always on the spline. High impact on performance but using Movement Component for most advance movement quality. This method create movement a little more safer (less possibility to fall out of spline) but a little less natural.
  • Advance with Pathfinding – movement is handled partially by Movement Component and NavMesh. Rotation, moving target and every tick correction for moving on spline is done with special code. Especially when any obstacle is on the spline – original code is used to bypass obstacle and return to spline behind obstacle. Not taking into account obstacle avoidance, this version work as Advance faced natural. Highest impact on performance but best movement quality and possibility to avoidance obstacles on spline.

Action 32 [Character] Align to Current Control Point – Align position precisely to current Control Point.
  Actions Go Next… especially when using Character Movement Component for moving – in most cases finish their movement in some sort margin distance. But if is important to stand exactly where destination Control Point is – this Action should be used in destination Control Point as first Action.

Action 32 [Character] Jump – Jump in place.
  Action start jump using Character Movement Component.
  It is worth to note that Action can finish immediately after jump is starting or can wait until Character finish jump.

Action 32 [Character] Rotate – Rotate Character to destination Angle.
  Action rotate Character by selected speed (every axis separately) to destination Angle.

Action 32 [Character] Rotate to Object – Rotate Character in the direction of the Object.
  Action rotate Character by selected speed (every axis separately) towards selected Object on the scene.

Action 32 [Character] Randomize Speed – Set new Max Walking Speed.
  Action set random in range or fixed Max Walking Speed (parameter of Character Movement Component).

Action 32 [Character] Play Anim Sequence – Play Animation Sequence on Character Mesh.
  Action play selected Animation Sequence on Mesh inherited from Character class.
  Special parameter Is Reset Animation Blueprint when Stop gives possibility to reset Animation Blueprint after Animation Sequence finish.
  It is worth to note that Action can finish immediately (then Animation continue playing during next Actions) or can wait until Animation finish.

Action 32 [Character] Stop Anim Sequence – Stop any Animation Sequence on Character Mesh.
  Action stop any existing Animation Sequence playing currently on Mesh inherited from Character class.
  Special parameter Is Reset Animation Blueprint gives possibility to reset Animation Blueprint.

Action 32 [Character] Play Anim Montage – Play Animation Montage on Character Mesh.
  Action play selected Animation Montage on Mesh inherited from Character class.
  It is worth to note that Action can finish immediately (then Montage continue playing during next Actions) or can wait until Montage finish.

Action 32 [Character] Stop Anim Montage – Stop selected Animation Montage on Character Mesh.
  Action stop selected Animation Montage playing currently on Mesh inherited from Character class.

Action 32 [Character] Set Mesh Material – Set Material on Character Skeletal Mesh.
  Action set selected Material on Skeletal Mesh inherited from Character class.

Action 32 [Character] Set Movement Component Parameters  – Set some parameters on Movement Component.
  Action can change some of Character Movement Component parameters.

Action 32 [Character] Setup Rotation Smoothly – Setup smoothly rotation when Character change direction.
  Action change Character Movement Component settings in the way Character start rotating smoothly after change direction.
  Rotation speed is setup separately for every axis.

Action 32 [Pure Actor] Go Next  – Go to the next Control Point.
  Action move Actor to the next Control Point selected by the Move Order function. Action do not use NavMesh.
  During movement Actor can be rotated with selected speed separately for every axis.
  Speed of Actor can be parametrized or left as it was.

Action 32 [Pure Actor] Go Next by Spline – Go to the next Control Point through Spline.
  Action move Actor on the Spline with selected speed which can be parametrized of left as it was.

Action 32 [Pure Actor] Rotate – Rotate Actor to destination Angle.
  Action rotate Actor by selected speed (every axis separately) to destination Angle.

Action 32 [Pure Actor] Rotate Infinitely – Rotate Actor selected amount of time.
  Action Rotate Actor with selected speed (every axis separately) randomized or fixed amount of time.

Action 32 [Pure Actor] Rotate to Object – Rotate Actor in the direction of the Object.
  Action rotate Actor by selected speed (every axis separately) towards selected Object on the scene.

Action 32 Back to Action  – Change index of next Action to selected one.
  Action change internal index of Array Action to selected one, is such a way that the next Action launched will be the one selected.

Action 32 Destroy Actors  – Destroy array of Actors being on the scene.
  Action instantly destroy all Actors referenced as an Action parameters.

Action 32 Destroy Instantly – Destroy current Actor instantly.
  Action instantly destroy Actor who launched this Action.

Action 32 Destroy Related Objects – Destroy all related objects spawned by this Actor through Actions.
  Action destroy instantly all Actors being on the scene, which previously spawned by other Actions (eg. Particles, Actors, Sounds).

Action 32 Destroy when NOT Visible – Destroy current Actor only when not rendering.
  Action destroy Actor who launched this Action only when is not rendering (not visible), or wait until become not rendering (not visible).
  This Action is very usefull when you don’t want objects/characters disappear in the front of player.

Action 32 Modify Trigger – Change settings of selected Trigger.
  Action modify selected Trigger settings which is instanced on the scene.

Action 32 Particle Cascade Spawn – Spawn Cascade Particle System.
  Action spawn selected Cascade Particle with custom settings on the scene.
  Spawning method can align concerned Actor, current Control Point, selected Actor on the scene or the world itself, also with custom offset to source align.
  It is also possible to setup lifespan – which is currently not supported by normal unreal Particle Cascade spawning.

Action 32 Particle Cascade Set Parameters – Change settings of selected Particle Cascade.
  Action modify settings of selected Particle Cascade. Also internal Cascade Parameters and Beam Parameters can be changed.

Action 32 Particle Niagara Spawn – Spawn Niagara Particle System.
  Action spawn selected Niagara Particle with custom settings on the scene.
  Spawning method can align concerned Actor, current Control Point, selected Actor on the scene or the world itself, also with custom offset to source align.
  It is also possible to setup lifespan – which is currently not supported by normal unreal Particle Niagara spawning.

Action 32 Particle Niagara Set Parameters – Change settings of selected Particle Niagara.
  Action modify settins of selected Particle Niagara. Also internal Niagara Parametes can be changed.

Action 32 Player Change Camera – Change Player Camera to new target.
  Action smootly or instantly change player camera to selected target or back to oryginal Player Camera.
  Player can be chosen by Player Index or by Controller ID (useful in multiplayer).

Action 32 Player Enable Input – Enable or Disable Player input.
  Action Enable or Disable Player input. Can be useful eg. when cutscene start/stop.
  Player can be chosen by Player Index or by Controller ID (useful in multiplayer).

Action 32 Print String – Print debug string.
  Action Print debug string to Screen or/and to Log.

Action 32 Play Sound 2D – Play selected sound 2D.
  Action play selected sound 2D with custom parameters and concurrency settings.

Action 32 Spawn Sound 3D – Spawn Sound 3D on the scene.
  Action spawn selected sound 3D with custom parameters and concurrency settings.
  Spawning method can align concerned Actor, current Control Point, selected Actor on the scene or the world itself, also with custom offset to source align.
  It is also possible to setup lifespan – which is currently not supported by normal unreal Sound spawning.

Action 32 Spawn Actor – Spawn Actor of selected class.
  Action spawn Actor on the scene. Action can decide whether Construction Script of newly spawned Actor will be executed or not.
  Spawning method can align concerned Actor, current Control Point, selected Actor on the scene or the world itself, also with custom offset to source align.

Action 32 Set Actor Parametes – Change settings of selected Actor. 
  Action modify some parameters of selected and instanced Actor.

Action 32 Teleport Next – Teleport to the next Control Point.
  Action instantly teleport Actor to the next Control Point selected by the Move Order function. Action do not use NavMesh.
  Actor rotation remains unchanged.

Action 32 Teleport Next when NOT Visible – Teleport to the next Control Point only when Actor is not rendering.
  Action teleport Actor to the next Control Point selected by the Move Order function, only when is not rendering (not visible), or wait until become not rendering (not visible). Action do not use NavMesh.
  Actor rotation remains unchanged.
  This Action is very usefull when you don’t want objects/characters disappear in the front of player.

Action 32 Trigger – Trigger to Start/Stop Advanced Control Points System.
  Action Start or Stop Advanced Control Points System on selected group of Actors (with Advanced Control Points Component) and/or Actors spawned by selected group of Spawn Points .
  Action can also Destroy selected group of Actors (with Advanced Control Points Component) and/or Actors spawned by selected group of Spawn Points.

Action 32 Wait – Actor wait random amount of time.
  Action do nothing for randomized or fixed amount of time.

Action 32 Execute Console Command – Execute a Console Command.
  Action execute Console Command, optionally for specific Player Controller.


Actions order and executions

Actions executing one by one, sequentially waiting for each other.
Exception is when Action code is constructed in the way to continue somewhere else and finish its main code. Eg. Action [Character] Jump can finish its code instantly, lets next Action to run, but Jumping code inside Character Movement Component will continue.
Also sequential order of Actions array can be changed by Action Back to Action. After this Action – internal index of Actions within a given array – will change, and next Action can be one of selected.

When last Action of current Actions array will finish – nothing more happen. So in most cases, as last Action any of …Go Next… or Teleport Next… Actions is preferred. Sometimes also actions Destroy instantly or Destroy when NOT Visible is useful. 

It is important to remember that some Actions can finish chain of executions of Actions. Eg. any …Go Next… Action after finish, start new chain of executions of Actions in new Control Point.
Another example is Action [Pure Actor] Rotate Infinitely with parameter Time set to -1 (forever), so that any further Actions will never be launched.


Parameters

Every particular Action has its unique parameters. But there are some equal for every Actions:

• First ExecutionAction start working after this number of tries. So this Action will be bypassed until this counter reduces to zero.
• Max Executions – Maximum number of executions of this Action. After every successful execution of this Action, this counter reduce by one. When Max Executions is 0 then this Action will be bypassed. 
         Setting up -1 mean, this Action can execute unlimited times.


Event Dispatchers

Every Action has by default 2 Event Dispatchers:

• Action Start – this dispatcher is called automatically, when Action start. Precisely in base class of Action inside event Do Action.
• Action Finish – this dispacher you should call manually when your Action is finished. Sometimes it is instantly after short code in the same frame. Sometimes after a long time.


Concurrent Actions

Besides the normal Actions or Begin Actions – there is possible to run Action in parallel mode. Action launched in parallel mode is called Concurrent Action.

Concurrent Action can be run from Trigger Task called Run Action or manually by running function Run Action Concurrent from selected Advanced Control Points Component.

After Concurrent Action, nothing more will happen. But after normal Action, the internal index of Actions will change and next Action will run.

Using Concurrent Actions is sometimes dangerous. Eg.
• Currently normal Action is “[Character] Go Next…” and new Concurrent Action is “Jump” – then everything will be fine
• Currently normal Action is “[Character] Rotate” and new Concurrent Action is “[Character] Go Next” – then animation glitch of rotation toward destination Control Point and Rotating from normal Action will be mutually problematic

Because of it, you should be very careful when choosing Concurrent Action.

In many cases is more wisely to use Settings Override on Actors to change their Actions.


Actions can be used in 6 places

Advanced Control Point Component Actions can be used as Begin Actions in Advanced Control Points Component. When Advanced Control Points System start – first Action from the array will be launched. Then array of Begin Actions launching one by one, until the end of array.

When launching Actor (owner of the Advanced Control Points Component) will be destroyed (eg. Action Destroy Instantly) – then non of the remaining Begin Actions will be launched.

Also every Action…Go Next…” or “Teleport Next…” – ends the execution of the remaining Begin Actions, because when Actor start occupies first Control Point then its Actions will start to be executed from the first position.

Spawn Point - Actions - 1.8.0

Spawn Point Actions can be used as Begin Actions in Spawn Point. When Spawn Point will spawn Actor, it copy all of Spawn Point parameters to newly spawned Actor‘s Advanced Control Points Component. Then instantly Advanced Control Points System start on freshly spawned Actor – first Action from the array will be launched. Then array of Begin Actions launching one by one, until the end of array.

When freshly spawned Actor will be destroyed (eg. Action Destroy Instantly) – then non of the remaining Begin Actions will be launched.

Also every Action…Go Next…” or “Teleport Next…” – ends the execution of the remaining Begin Actions, because when Actor start occupies first Control Point then its Actions will start to be executed from the first position.

Control Point - Actions - 1.8.0

Control Point Actions can be used in Control Point. When any Actor start occupies Control Point, first Action from the array will be launched. Then array of Actions launching one by one, until the end of array.

When launching Actor (which occupies this Control Point) will be destroyed (eg. Action Destroy Instantly) – then non of the remaining Actions will be launched.

Also every Action…Go Next…” or “Teleport Next…” – ends the execution of the remaining Actions, because when Actor start occupies next Control Point then its Actions will start to be executed from the first position.

Trigger - Action - 1.8.0

Trigger Action can be used in Trigger. When use Trigger Task named Run Action – it is possible to run selected Action.

Action launched from Trigger Task will be running in non usual way – as Concurrent Action. This mean, that Concurrent Action run parallel with currently running Action on desired Actors.
Other difference is that after Concurrent Action, nothing more will happen. But after normal Action, the internal index of Actions will change and next Action will run.

Action will be launched on independent Actors chosen in Actors to Act and on Actors belonging to Spawn Points chosen in Spawn Points to Act.

Using Concurrent Actions is sometimes dangerous. Eg.
• Currently Action is “[Character] Go Next…” and new Concurrent Action is “Jump” – then everything will be fine
• Currently Action is “[Character] Rotate” and new Concurrent Action is “[Character] Go Next” – then animation glitch of rotation toward destination Control Point and Rotating from normal Action will be mutually problematic

Because of it, you should be very careful when choosing Concurrent Action.

Settings Override in Control Points - Actions - 1.8.0

Control Point Action can be used in Settings Override as one of Control Point parameter.

Settings Override completly replace existing Advanced Control Points Component settings. When Actor start occupy this Control Point then before any Actions start, parameter Settings Override is checked. If its fulfilled then the replacement takes place.

Array of Begin Actions will be used for launching Action of freshly replaced Advanced Control Points Component. First Action from the array will be launched. Then array of Begin Actions launching one by one, until the end of array.

When launching Actor (owner of the Advanced Control Points Component) will be destroyed (eg. Action Destroy Instantly) – then non of the remaining Begin Actions will be launched.

Also every Action…Go Next…” or “Teleport Next…” – ends the execution of the remaining Begin Actions, because when Actor start occupies first Control Point then its Actions will start to be executed from the first position.to be executed from the first position.

Settings Override in Trigger Task - Actions - 1.8.0

Trigger Action can be used in Settings Override as one of Trigger Task named Settings Override.

Settings Override with launching Begin Actions will be launched on independent Actors chosen in Actors to Act and on Actors belonging to Spawn Points chosen in Spawn Points to Act.

Settings Override completly replace existing Advanced Control Points Component settings.

Array of Begin Actions will be used for launching Action of freshly replaced Advanced Control Points Component. First Action from the array will be launched. Then array of Begin Actions launching one by one, until the end of array.

When launching Actor (owner of the Advanced Control Points Component) will be destroyed (eg. Action Destroy Instantly) – then non of the remaining Begin Actions will be launched.

Also every Action…Go Next…” or “Teleport Next…” – ends the execution of the remaining Begin Actions, because when Actor start occupies first Control Point then its Actions will start to be executed from the first position.to be executed from the first position.


Create custom Action

Actions are designed to be easly created for your needs. To create new kind of Action which cover your needs, simply create child from CP_Action_Base or duplicate one of existing Action object and modify. Its structure is fairly simple and intuitive.


1.

Firstly create a child by inheriting from the Action base class CP_Action_Base.
Base class file can be found in Plugin Content Directory.

Then name the new Action.

Open new blueprint.

Be aware when you create new object in content browser inherited from CP_Action_Base it will show you automatically on the list of available actions.

Create Action 01

2.

Click to Functions -> Override -> Do Action

This event is fired on Action Start.

Create - Action - 02

3.

Right click on event and choose Add Call to Parent Function.

3b.

Then connect all output to input nodes.

Create - Action - 03b

Create - Action - 03

4.

Create very simple code connected to this event.

Check Conditions to Run This Action – Very important function, which check whether it is possible to run this Action.
If there is necessity, Function can be override to add extra conditions. When function is overriden – also call Parent function should done.

Our Action when start need only enable Ticking by function Set Is Ticking Action.
Normally Actions have disabled Ticking for better performance. Some Actions have small, instant code and don’t need Tick. Sometimes Action code is event based, so don’t need Tick also.

When Conditions of Action don’t let to run it – we simply call Event Dispatcher Action Finish to give a signal for owner Advanced Control Points Component that Action finish with successful false.
After this Event Dispatcher is receive, instantly next Action from Actions array of Advanced Control Points Component will launch.

Create - Action - 04

5.

Click to Functions -> Override – > Do Tick

This event is fired every Advanced Control Points Component Tick.

For Tick working inside Action – function Set Is Ticking Action must be used before.

Create - Action - 05

6.

Create simple code connected to this event.

This simple code move Actor on the circle. After movement Action will finish.

First execution of sequence is code for change degree of circle.

Second execution of sequence:
a. check whether we finish the chosen angle or not.
– if not finish: simply change Actor position to previously updated degree
– if finish:
  > first change our degree to destination degree: because in previously updated degree we increment angle depends on Delta Tick, which can be upredictable
  > second simply change Actor position do finish angle
  > third call Dispatcher Action Finish which disable Action and inform Advanced Control Points Component about end of this Action

This code use following variables:

  • Speed (float) – default value 100,0 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
  • Degree Max (float) – default value 360,0 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
  • Diameter (float) – default value 2,0 (move it to category Configuration, set Instance Editable and Expose as Spawn on true)
  • Degree (float) – default value 0,0

Create - Action - 06 extra

Code of course is very simple, but showing an example of non-instant Action.

7.

Inside Blueprint Editor of new Action. Click Class Settings in top belt.

Then choose Blueprint Display Name and write name you wish to see on Actions list.

Next choose Blueprint Description and write name you wish to see on mouse hover in this list.

Create - Action - 07 (1.8.0) RedBox

8.

Click on selected Control Point on the level.

In Control Point details panel add position to parameter Actions.

Find our new Action in the list – wait a moment with hoover, and check description.

Create - Action - 08

9.

We are ready to parametrize our new Action.

Create - Action - 09 RedBox

10.

Our Action during the action.

Create - Actio - 10 Low Quality

The core of our Action functionality is working. Now is very important to validate our Action‘s code.

11.

Click to Functions -> Override – > Do Validate

This event is fired when user manually validate Advanced Control Points Component or Control Point or Spawn Point which contain this Action. Validation also take place when Advanced Control Points Component start working and variable Is Should Validate is true.

Create - Action - 11

12.

In overriden function Do Validate at first add two new local variables. They will be needed in code later.

Create - Action - 12

13.

The code below in this function first get validation results from parent function and then validate correctness of 3 Action’s parameters.

14.

First is important to call parent function and save its results as Loc is Validated and Errors.

Create - Action - 14

15.

Part of code validating Speed parameter. If value is zero or lower, value Loc is Validated is set to false and error message is added to Errors array.

16.

Part of code validating Degree Max parameter. If value is zero or lower, value Loc is Validated is set to false and error message is added to Errors array.

17.

Part of code validating Diameter parameter. If value is zero or lower, value Loc is Validated is set to false and error message is added to Errors array.

18.

Return function inform whether Action is validated well and error messages.

Create - Action - 18

19.

You can click button Button Validate in any Control Point with new Action in its Actions array. Results of validation is visible is Output Log window.


Available functions/events to override in Action Base Class

• Do Action – An event which run when Action start. You should remember to always call parent function when override this event.
  > Actor Component Control Points: IN reference to Adanced Control Points Component, owner of this Action.
  > Actor Concerned: IN reference to Actor which launch this Action.

• Do Tick – A Tick event is run externally from Advanced Control Points Component which is owner of the Action. This event will don’t work until you first use function Set is Ticking Action with true.
  > Delta Seconds: IN delta time from last frame. Works in the same way as in every Actor.

• Check Conditions to Run This Action – Function for checking conditions to run this Action. Result of checking should be bool add to base class condition and output by Can Run This Action variable in Return node. You should remember to always call parent function when override this function.

• Copy Constructor – Function run everytime this Action is duplicated. Action object copying happen many times during play time. In this function you must copy all variables which keeping references.
  > Source Object: IN reference to oryginal object of this Action from which all reference variables should be copied.

• Do Stop Action – An event used to stop Action immediately. This event can be called in any time during Action work. If the Action is not immediate, this event must be overriden. Long time working Action should release all timers, should back to original state all what should be left in oryginal state. Also asynchronic task should be finished. Sometimes, when after suddenly stoppping of this Action there is no need to release anything, you can simply don’t override this function. You should remember to always call parent function when override this function.

• Do Validate – Function used to validate this Action parameters. This function should be overriden when any of Action parameter can be set as non-valid, eg.: when float parameter should be only higher that 0,0, validation must to check this.
This function is run everytime when button Button Validate is clicked on owner Advanced Control Points Component or on owner Spawn Point or on owner Control Point.
Also in Global Manager when any of buttons Button - Validate all actors on level or Button - Validate all spawn points on level or Button - Validate all control points on level is clicked.
This Function is run also everytime when owner Advanced Control Points Component or Spawn Point starting.
You should remember to always call parent function when override this function. Also take care about output variable Is Validated from parent function. If from parent function or your overriden version of Do Validate any parameter is wrong – this output parameter should be false. So normally Is Validated is true, but when any Action parameter is not-valid, this variable should be output as false.
It is very important to inform what parameter is setup wrong and why. This message you should add to array Errors, which you should be got from parent function and output as Errors variable when function return.

• Finish Action – An event used to finishing Action. Currently only mandatory behavior is to call Action Finish event dispatcher. But this event is used when more things should be done on Action finish.


Available functions/events – which can be used in Action Base Class

There is a list of functions/events you can use in your Action but there is no need to override them.

• Get is Ticking – Function return whether Action Tick is currently enabled.
• Set is Ticking Action – Function turn on/off Action Tick.
• Set is Ticking Occupied Procedure – Function turn on/off Occupied Procedure Tick. Occupied Procedure Ticking is currently used only in “…Go Next…” Actions.
• Set is Ticking Rotation Procedure – Function turn on/of Rotation Procedure Tick. Rotation Procedure Ticking is currently used only during “…Go Next…” Actions.