Ideas

StFUReaper's avatar
StFUReaper
Seasoned Novice
5 months ago

mod.AISetUnspawnOnDead not working.

Maybe I'm doing something wrong, but for me the function AISetUnspawnOnDead() is not working at all. AI Soldiers are spawned via SpawnAIFromAISpawner() but despite setting unspawn on dead to false, as soon as they die, just leave the game. Is there any other settings which needs to set to prevent the AI from leaving the game? Thanks in advance.

The definition of the mentioned functions :

// Use this on a spawner to determine if AI soldiers spawned will leave the game after they are killed.
export function AISetUnspawnOnDead(spawner: Spawner, enableUnspawnOnDead: boolean): void;

 // Spawn one AI soldier from a specific AI Spawner.
export function SpawnAIFromAISpawner(spawner: Spawner, team: Team): void;

2 Comments

  • nikgodda's avatar
    nikgodda
    Seasoned Newcomer
    4 months ago

    did some research and this is what I found out:

    • AISetUnspawnOnDead works as intended. but with a nuance
    • if you set AISetUnspawnOnDead to true, spawn bot and kill it, bot will be unspawned from the server immediately
    • if you set AISetUnspawnOnDead to false (default) bot will not be unspawned immediately after death but after delay set in SetUnspawnDelayInSeconds (default ~10s, max value 300s). 

    that means currently custom bot can not stay on the server longer than 300s after death

  • nikgodda's avatar
    nikgodda
    Seasoned Newcomer
    4 months ago

    but still i don't understand the reason for this limitation. if you need permanent bot you have to respawn it every time game unspawns it and build a system to pass stats like kills, deaths, name etc to newly spawned bot

Featured Places

Node avatar for Battlefield 6 Bug Reports

Battlefield 6 Bug Reports

Report bugs and see what the Battlefield 6 community is saying on this forum.Latest Activity: 18 minutes ago
9,594 Posts