SF
STS Forge

Functions & Structure

Function and class structure verbs: add-function, remove-function, add-interface, reparent, and more.

Part of the BAA AI Reference. Covers function graphs, event dispatchers, interfaces, and class hierarchy (15 verbs).

All verbs return JSON. On success: "success": true. On failure: "success": false with "error", "errorCode", "suggestion", and "details" fields.

Global optional flags: -compile, -save, -timing.


Table of Contents#

  1. add-function: Create a function graph
  2. remove-function: Remove a function graph
  3. rename-function: Rename a function graph
  4. set-function-flags: Set access, const, RPC, category, description
  5. add-function-param: Add input/output parameter
  6. remove-function-param: Remove a function parameter
  7. add-local-var: Add a local variable to a function
  8. remove-local-var: Remove a local variable
  9. add-event-dispatcher: Create an event dispatcher
  10. remove-event-dispatcher: Remove an event dispatcher
  11. rename-event-dispatcher: Rename an event dispatcher
  12. add-event-param: Add a parameter to a custom event
  13. add-interface: Implement an interface
  14. remove-interface: Remove an implemented interface
  15. reparent: Change Blueprint parent class

add-function#

Create a new function graph on a Blueprint.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path (e.g., /Game/BP/BP_Player)
-name= Yes Function name
-ispure No Flag (presence-only): mark as pure function (no exec pins)

Examples:

-verb=add-function -asset=/Game/BP/BP_Player -name=CalculateDamage
-verb=add-function -asset=/Game/BP/BP_Player -name=GetHealthPercent -ispure
-verb=add-function -asset=/Game/BP/BP_Player -name=ComputeScore -ispure -compile -save

Output:

{
    "success": true,
    "data": {
        "functionName": "CalculateDamage"
    }
}

Batch $N resolves to: Function name.


remove-function#

Remove a function graph from a Blueprint. Idempotent: succeeds silently if the function does not exist.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-name= Yes Function name to remove

Examples:

-verb=remove-function -asset=/Game/BP/BP_Player -name=OldHelper -compile -save

rename-function#

Rename a function graph. Idempotent: if the function already has the new name, succeeds without changes.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-name= Yes Current function name
-newname= Yes New function name

Examples:

-verb=rename-function -asset=/Game/BP/BP_Player -name=CalcDmg -newname=CalculateDamage -compile -save

set-function-flags#

Set metadata and flags on a function graph: access level, const, RPC type, category, and description.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-function= Yes Function graph name
-access= No Access level: Public, Protected, Private
-isconst No Flag (presence-only): mark as const
-rpc= No RPC type: Server, Client, Multicast, None
-isreliable No Flag (presence-only): mark RPC as reliable
-iscallineditor No Flag (presence-only): allow calling in editor
-category= No Function category string (for Blueprint palette grouping)
-description= No Function tooltip/description

Examples:

-verb=set-function-flags -asset=/Game/BP/BP_Player -function=CalculateDamage -access=Public -isconst -category=Combat
-verb=set-function-flags -asset=/Game/BP/BP_Player -function=ServerFireWeapon -rpc=Server -isreliable
-verb=set-function-flags -asset=/Game/BP/BP_Player -function=DebugDraw -iscallineditor -description="Draw debug shapes in editor"

Notes:

  • RPC flags (-rpc, -isreliable) correspond to UFUNCTION specifiers (Server, Client, NetMulticast, Reliable).
  • Setting -rpc=None clears any existing RPC designation.

add-function-param#

Add a parameter to a function graph. Supports the full variable type system.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-function= Yes Function graph name
-name= Yes Parameter name
-direction= Yes input (or in) / output (or out)
-type= Yes Pin type: bool, float, int, int64, byte, String, Name, Text, Vector, Rotator, Transform, LinearColor, Object, Class, SoftObject, Enum, Struct
-subtype= No Object/struct/enum class (e.g., Actor, FHitResult, EDamageType)
-container= No Container wrapper: array, set, map
-keytype= No Map key type (same options as -type)
-keysubtype= No Map key class (same as -subtype)

Examples:

-verb=add-function-param -asset=/Game/BP/BP_Player -function=CalculateDamage -name=BaseDamage -direction=input -type=float
-verb=add-function-param -asset=/Game/BP/BP_Player -function=CalculateDamage -name=Result -direction=output -type=float
-verb=add-function-param -asset=/Game/BP/BP_Player -function=FindEnemies -name=OutActors -direction=output -type=Object -subtype=Actor -container=array
-verb=add-function-param -asset=/Game/BP/BP_Player -function=GetStats -name=StatMap -direction=output -type=String -container=map -keytype=Name

remove-function-param#

Remove a parameter from a function. Idempotent: succeeds silently if the parameter does not exist.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-function= Yes Function graph name
-name= Yes Parameter name to remove

Examples:

-verb=remove-function-param -asset=/Game/BP/BP_Player -function=CalculateDamage -name=OldParam -compile -save

add-local-var#

Add a local variable to a function graph. Local variables are scoped to the function and not visible to other graphs. Supports the full variable type system.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-function= Yes Function graph scope
-name= Yes Local variable name
-type= Yes Pin type (same options as add-function-param)
-subtype= No Object/struct/enum class
-container= No Container wrapper: array, set, map
-keytype= No Map key type
-keysubtype= No Map key class

Examples:

-verb=add-local-var -asset=/Game/BP/BP_Player -function=CalculateDamage -name=Multiplier -type=float
-verb=add-local-var -asset=/Game/BP/BP_Player -function=FindEnemies -name=TempArray -type=Object -subtype=Actor -container=array

remove-local-var#

Remove a local variable from a function. Idempotent: succeeds silently if the variable does not exist.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-function= Yes Function graph name
-name= Yes Local variable name to remove

Examples:

-verb=remove-local-var -asset=/Game/BP/BP_Player -function=CalculateDamage -name=TempValue -compile -save

add-event-dispatcher#

Create an event dispatcher (multicast delegate) on a Blueprint.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-name= Yes Event dispatcher name

Examples:

-verb=add-event-dispatcher -asset=/Game/BP/BP_Player -name=OnHealthChanged -compile -save

Notes:

  • After creating the dispatcher, use add-function-param with -function=<dispatcher_name> to add signature parameters, or use add-event-param for parameters on custom event nodes.

remove-event-dispatcher#

Remove an event dispatcher from a Blueprint. Idempotent: succeeds silently if the dispatcher does not exist.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-name= Yes Event dispatcher name to remove

Examples:

-verb=remove-event-dispatcher -asset=/Game/BP/BP_Player -name=OnOldEvent -compile -save

rename-event-dispatcher#

Rename an event dispatcher. Idempotent: if the dispatcher already has the new name, succeeds without changes.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-name= Yes Current dispatcher name
-newname= Yes New dispatcher name

Examples:

-verb=rename-event-dispatcher -asset=/Game/BP/BP_Player -name=OnHPChanged -newname=OnHealthChanged -compile -save

add-event-param#

Add a parameter to a custom event node. Supports the full variable type system.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-event= Yes Custom event name
-name= Yes Parameter name
-graph= No Graph name (defaults to EventGraph)
-type= Yes Pin type (same options as add-function-param)
-subtype= No Object/struct/enum class
-container= No Container wrapper: array, set, map
-keytype= No Map key type
-keysubtype= No Map key class

Examples:

-verb=add-event-param -asset=/Game/BP/BP_Player -event=OnDamaged -name=DamageAmount -type=float
-verb=add-event-param -asset=/Game/BP/BP_Player -event=OnDamaged -name=Instigator -type=Object -subtype=Actor
-verb=add-event-param -asset=/Game/BP/BP_Player -event=OnRespawn -name=SpawnLocation -type=Vector -graph=EventGraph

add-interface#

Implement an interface on a Blueprint.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-interface= Yes Interface class name or full asset path

Examples:

-verb=add-interface -asset=/Game/BP/BP_Player -interface=Damageable -compile -save
-verb=add-interface -asset=/Game/BP/BP_Enemy -interface=/Game/Interfaces/BPI_Interactable -compile -save

Notes:

  • After adding the interface, the Blueprint gains function stubs for each interface function. Use read-graph to inspect them, and add-node / connect to implement the logic.

remove-interface#

Remove an implemented interface from a Blueprint. Idempotent: succeeds silently if the interface is not implemented.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-interface= Yes Interface class name or full asset path

Examples:

-verb=remove-interface -asset=/Game/BP/BP_Player -interface=Damageable -compile -save

reparent#

Change a Blueprint's parent class. Idempotent: if the Blueprint already inherits from the specified parent, succeeds without changes.

Category: Functions & Structure

Args:

Arg Required Description
-asset= Yes Blueprint asset path
-parent= Yes New parent class name or full asset path

Examples:

-verb=reparent -asset=/Game/BP/BP_Enemy -parent=Character -compile -save
-verb=reparent -asset=/Game/BP/BP_Turret -parent=/Game/BP/BP_BaseActor -compile -save

Notes:

  • Reparenting may invalidate existing nodes if the new parent does not expose the same functions/variables. Run validate after reparenting to check for issues.

Example: Batch workflow#

Create a function with parameters, set flags, and add a local variable, all in a single commandlet invocation.

Batch JSON (save as create-function.json):

{
    "defaultAsset": "/Game/BP/BP_Player",
    "operations": [
        {"verb": "add-function", "name": "CalculateDamage"},
        {"verb": "set-function-flags", "function": "CalculateDamage", "access": "Public", "isconst": true, "category": "Combat", "description": "Calculate final damage after armor and resistances"},
        {"verb": "add-function-param", "function": "CalculateDamage", "name": "BaseDamage", "direction": "input", "type": "float"},
        {"verb": "add-function-param", "function": "CalculateDamage", "name": "DamageType", "direction": "input", "type": "Object", "subtype": "DamageType"},
        {"verb": "add-function-param", "function": "CalculateDamage", "name": "FinalDamage", "direction": "output", "type": "float"},
        {"verb": "add-local-var", "function": "CalculateDamage", "name": "ArmorReduction", "type": "float"},
        {"verb": "add-local-var", "function": "CalculateDamage", "name": "ResistanceMultiplier", "type": "float"},
        {"verb": "compile"},
        {"verb": "save"}
    ]
}

Run:

-verb=batch -input=C:/Temp/create-function.json

HTTP equivalent:

curl -X POST http://localhost:7850/baa/v1/batch \
  -H "Content-Type: application/json" \
  -d @create-function.json

Result: A compiled and saved CalculateDamage function on BP_Player with:

  • Two input pins (BaseDamage: float, DamageType: UDamageType*)
  • One output pin (FinalDamage: float)
  • Two local variables (ArmorReduction, ResistanceMultiplier)
  • Public access, const, categorized under "Combat"