FCBP_CPAI

AI configuration of a pawn / character. Passed with .ai(...).

Setters

Setter Effect
team(uint8) Team id. Same team → Friendly, different team → Hostile. 0 is a real team, not neutral (only team id 255 / no-team is neutral toward everyone). The AI only targets actors it sees as Hostile.
aiClass(TSubclassOf<ACAIController>) AI controller class. If left null, defaults to ACAIController.
behaviorTree(UBehaviorTree*) Behavior tree run on possession. If null, the AI runs no tree (warning logged).
automations(TArray<FCBP_Automation>) Scripted AI command loop → FCBP_Automation.
sightPerception(FCBP_SightPerception) Sight tuning → FCBP_SightPerception.

Example

FCBP_CPAI ai = FCBP_CPAI()
    .team(1)
    .aiClass(ACAIController::StaticClass())
    .behaviorTree(retrieveAsset<UBehaviorTree>("ENEMY_BT"))
    .automations({         // runs in a loop; see FCBP_Automation
        FCBP_Automation()
            .command(ECAutomationCommandName::LOCATION)
            .value("AM"),              // go to room corner A, then center M
        FCBP_Automation()
            .command(ECAutomationCommandName::WAIT)
            .value("3.0"),             // wait 3 seconds
        FCBP_Automation()
            .command(ECAutomationCommandName::LOCATION)
            .value("C"),               // go to far corner C
    })
    .sightPerception(FCBP_SightPerception()
        .enableSight(true)
        .sightDistanceMeter(30.0f)
        .viewingAngleDegree(66.0f));