For the complete documentation index, see llms.txt. This page is also available as Markdown.

Writing Custom Actions (C++)

Other than using built-in actions, you can write your own via script (C++).


Actions Base Class

When creating a new class, inherit from AActionActorBase defined in "ActionActorBase.h"

UCLASS(Blueprintable)
class ACustomAction : public AActionActorBase { ... }

DoAction Method

Then, all you need to do is overriding the “DoAction” method and write your code inside it.

Remember that actions pause the typewriter until they’re completed (for example, waiting for player input or until time has passed).

void ACustomAction::DoAction_Implementation()
{
    // [...]
    // Use inherited and already initialized variables:
    // FActionMarker ActionMarker
    // UTypewriterCore* TypewriterRef
    
    // At the end always call TypewriterRef->CompleteCurrentAction()
    // to resume the typewriter
}
  • The ActionMarker inherited variable has useful info about your tag, for example the ID or if there are any parameters that come with it (e.g. <playSound=02>).

  • The inherited TypewriterRef references the component that is currently performing the action. It contains all relevant information about the current typing status.

Action Object Base Data Asset

To effectively use your Custom Action you need to create a Data Asset that uses the newly created C++ class.

To do so, go into your Content Browser->Miscellaneous->Data Asset->Action Object Base.

Newly created Custom Action Data Asset
  • Tag ID: is the string you will use inside your "Animated Text Block" to trigger your action.

  • Action Actor Class: is the actual C++ class extending AActionActorBase.

Remember to add this newly created Data Asset to the proper database in your "Content/Plugins/TextAnimatorFebucci/Data" folder


✅Done!

Done! With this simple procedure, you can add any Custom Action you want.