Does the down_but_not_out_device work for npc's ?

using { /Fortnite.com/AI }
using { /Fortnite.com/Characters }
using { /Verse.org }
using { /Verse.org/Colors }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }

NPC_down := class(creative_device):

    @editable_number(float):
        MinValue:=option{0.0},
        MaxValue:=option{600.0}
    DownTime:float = 20.0

    @editable
    NPCdevice : npc_spawner_device = npc_spawner_device{}

    @editable
    DownDevice : down_but_not_out_device = down_but_not_out_device{}

    OnBegin<override>()<suspends>: void =
        SpawnedAgent := NPCdevice.SpawnedEvent.Await()
        loop:
            DownDevice.AgentDownedEvent.Await()
            spawn{OnAgentDowned(SpawnedAgent)}
            Sleep(0.0)

    OnAgentDowned<private>(Agent: agent)<suspends>: void =
        Sleep(DownTime)
        DownDevice.Revive(Agent)

it doesn’t work in game so does it work with npc’s ?

Hello there @Maquisse!

Checking around the community for information regarding this class, it doesn’t seem to support NPCs, as the states are tied to player characters.

@Maquisse @brs-sebascova It actually IS possible, I was shocked to find out too, but they can be revived from the DBNO state with the DBNO Device.

The code being used is the following

hello_world_device := class(creative_device):

    @editable NPCSpawner : npc_spawner_device = npc_spawner_device{}
    @editable DBNODevice : down_but_not_out_device = down_but_not_out_device{}
    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        NPCSpawner.SpawnedEvent.Subscribe(Testing)


    Testing(Agent:agent):void=spawn. Testing2(Agent)
    Testing2(Agent:agent)<suspends>:void=
        loop:
            Sleep(3.0)
            Print("TESTING")
            DBNODevice.Revive(Agent)
1 Like