I’m having an issue with the DownButNotOut Creative Device and it’s events.
I’m trying to incorporate the AgentDowned event into my script, I’ve posted a snippet below:
var DownButNotOut : down_but_not_out_device = down_but_not_out_device{}
OnBegin<overrides>():void=
DownButNotOut.AgentDowned.Subscribe(PlayerDowned)
PlayerDowned(InPlayer : agent):void=
Print("This should fire, but it doesn't.")
However this does not seem to fire for whatever reason. I have tried using the .Await() function within OnBegin<overrides>()<suspend>:void=, and it does not pass the .Await() check.
I’m not sure if I’m doing it wrong or if the event itself is broken.
Verse scripts cannot currently instantiate creative devices. To use the creative device you would specify it in the script like this:
@editable
DownButNotOut:down_but_not_out_device = down_but_not_out_device{}
OnBegin<overrides>():void=
DownButNotOut.AgentDowned.Subscribe(PlayerDowned)
PlayerDowned(InPlayer : agent):void=
Print("This should now fire.")
Then in the UEFN you would add a Device_DBNO_V2 device and assign it to your script. To assign the device to your script, select your Verse script device. Under Details you should see the setting to assign the placed Device_DBNO_V2 device to your script.
Apologies if I didn’t make myself clear; I retracted a lot of my source code including the @editable flag I was supposed to have to specify the DBNO Device - the Down But Not Out device does exist in my level, and I have it selected under my variables like you have in your code snippet.
However at this present time, this does in fact, not fire when a player is downed.
observe this does not work (no print) when first Player get’s downed via either downing him through DbnO device hooked to PlayerSpawnPad player spawned event OR when calling Down() on same DbnO device from code. Both methods fail to call AgentDowned for me
I havent tested if I’d shoot at somebody
3. same with AgentDowned.Await(), never pushes evaluation past it after Event gets supposedly fired` via methods mentioned above
I might add that adding Sleep(0.0) or more before calling Down() on agent does not resolve issue
I can confirm that this indeed does not work. I thought maye the device needs to be enabled first? But calling
DownButNotOut.Enable()
Prior has no effect.
[Edit] I know this is not really a solution to the problem, but I did find a work around. You can place a trigger_device and in the details pane set the Trigger event to the down_but_not_out_device and then in verse Subscribe the TriggeredEvent like so:
From prior experience it appears certain devices require and/or send specific data through events such as instigator, damage, teams, ect… Triggers seem to be the most compatible intermediary if devices cannot talk directly so I’d imagine that Verse events have similar undocumented quirks.