Pop-Up Dialog Buttons 1-6 use 0-Based Indexing but Buttons 7-12 use 1-Based Indexing.

Summary

When using a Pop-Up Dialog Device in Verse, the RespondingButtonEvent returns an agent and index. Buttons 1-6 use zero-based indexing and buttons 7-12 use one-based indexing, which is weird and inconsistent, but is best left unpatched and made clear that the bug exists so existing code doesn’t break.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Create a new project.

Add a Pop-Up Dialog Device with 12 buttons, a Button Device whose Interact Event is linked to the Pop-Up Dialog’s Show function, and a Verse device.

Paste the following code into the Verse device:

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

popup_dialog_watcher := class(creative_device):

    @editable Popup : popup_dialog_device = popup_dialog_device{}

    OnBegin<override>()<suspends>:void=
        Popup.RespondingButtonEvent.Subscribe(PrintPopup)
    
    PrintPopup(Agent : agent, Index : int) : void =
        Print("{Index}")

Reference the Pop-Up Dialog in the Verse device and start the game while connected to a session.

Expected Result

When the player in the game client presses a button, the zero-based index of that button should be printed on screen:

Button Pressed Index Passed Through RespondingButtonEvent
Button 1 0
Button 2 1
Button 3 2
Button 4 3
Button 5 4
Button 6 5
Button 7 6
Button 8 7
Button 9 8
Button 10 9
Button 11 10
Button 12 11

Observed Result

When the player in the game client presses a button 7-12, the one-based index of that button is printed on screen.

Button Pressed Index Passed Through RespondingButtonEvent
Button 1 0
Button 2 1
Button 3 2
Button 4 3
Button 5 4
Button 6 5
Button 7 7
Button 8 8
Button 9 9
Button 10 10
Button 11 11
Button 12 12

Platform(s)

I assume this affects all Platforms, but I was using PC (UEFN), Switch 2 (Game Client)

Video

Additional Notes

This bug is probably best left unpatched, but rather acknowledged instead to avoid breaking existing islands.

FORT-956397 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.

1 Like