New Objective device DamageEvent() does not work until a function is called on the device

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

DamageEvent() on the objective device that was just added in the latest patch does not work until a function is called on the device.

Steps to Reproduce

Place objective device, button device, and a custom verse script that subscribes to the objective DamageEvent() and the button interact event. have the button trigger a Heal() on the objective when pressed. have the damagedevent print a string showing the damage value. shoot the objective device (no print), press the button to heal the device, shoot the objective (print displayed)

Expected Result

DamageEvent() should work without having to call a function on the device

Observed Result

DamageEvent() does not work until function called on objective device

Platform(s)

uefn pc

Island Code

3770-3210-2295

Additional Notes

Video: 2024-08-16 04-02-04.mp4 - Google Drive

I’m also seeing this. Here is a simple example, the DamagedEvent never triggers.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

test_objective_events_device := class(creative_device):

    @editable
    Objective : objective_device = objective_device{}

    OnBegin<override>()<suspends>:void=
    {
        Objective.DamagedEvent().Subscribe(OnDamagedEvent)
        Objective.DestroyedEvent.Subscribe(OnDestroyedEvent)
    }

    OnDamagedEvent(Results:damage_result):void=
    {
        Print("hit!")
    }

    OnDestroyedEvent(Player:agent):void=
    {
        Print("destroyed!")
    }

Not only is DamagedEvent() not working, but unsubscribing it using Cancel() also fails to function.

# `DamagedEvent()` Not working.
test_device_1 := class(creative_device):
    
    @editable TestObj_1 : objective_device = objective_device{}

    OnBegin<override>()<suspends>:void=
        TestObj_1.DamagedEvent().Subscribe(OnTowerDamaged) # Not working.

    OnTowerDamaged(DamageResult:damage_result):void=
        gAmount := DamageResult.Amount
        Print ("Tower Damaged Amount = {gAmount}")

# `DamagedEvent()` The code is working.
# But! `.Cancel()` Not working.
test_device_2 := class(creative_device):

    @editable TestButton_1 : button_device = button_device{}
    @editable TestObj_2 : objective_device = objective_device{}

    OnBegin<override>()<suspends>:void=
        TestButton_1.InteractedWithEvent.Subscribe(OnTestButton_1)

        TestObj_2.GetHealth()
        TestObj_2.DamagedEvent().Subscribe(OnTowerDamaged)

    OnTowerDamaged(DamageResult:damage_result):void=
        gAmount := DamageResult.Amount
        Print ("Tower Damaged Amount = {gAmount}")

    OnTestButton_1(Agent:agent):void=
        getSubscription := TestObj_2.DamagedEvent().Subscribe(OnTowerDamaged)
        getSubscription.Cancel()    # Not working.

The status of FORT-812343 incident has been moved from ‘Needs Triage’ to ‘To Do’.

we are seeing this issue as well

is this fixed yet? facing similar issues

I’m experiencing the same issue as described above. Subscribing to DamagedEvent of Objective Device is doing nothing until it is interacted by some other Device, which is making usage of the Objective Device unnecessarily more complicated. UEFN v34.10.

This is still an issue after update to v35.00. Subscribing to DamagedEvent of Objective Device is doing nothing until it is interacted by some other Device or until some other function in Verse is called on it. Please, fix this soon, it already has 12 votes.

Hello Locutus,

I’m also facing the issue.
May I know what kind of function or “other interactions” on the objective device can fix the issue?

Hello, you can for example make a function to heal the objective device with a value of 0 like this: Objective.Heal(0.0)

So it will actually do nothing, but it will “activate” the device to be able to respond to DamageEvent. So after a heal will be executed, you can call different function which will contain something based on DamageEvent and it should work as it is working for me like that. Or you can try something different with Objective Device to do before DamageEvent as a separate function.

But don’t put Heal directly to a function called on a DamageEvent, because it will not work for this purpose (it needs to be “activated” by something before it could be registered).

Indeed, using .Heal() works.
I was using .Show() and .SetInvulnerable() and it wasn’t working.

This is still not normal though and I’ll report it too.

Thank you so much!

Cool. I am happy to hear that :slight_smile: Let’s hope that Epic will fix this soon.