Event bindings in a folder on the player template aren't returned by GetAllBindings

Describe the bug:

If you have a setup like

Player

  • ScriptFolder
    • someScript

And you add ScriptFolder -> someScript -> someFn to an event, the event will not be returned via self.properties.theEvent:GetAllBindings()

How do you cause this bug?

  • Clone the “Bindings Bug” game from user Cereal (it’s not published)

Take a look at the events on the entity in the world tree - there’s several variations that work. The second event registered does not work.

Please note: I tried to package this as a package, however the game crashed when I tried, so I’m leaving it as an unpublished game. Pretty sure you guys can clone that anyway.

Your Crayta username: Cereal

Game seen in (including “Hub” or “Editor for XYZ”):

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): Easily recreated

Time + date seen: December 16 2021

Version number (found in Help tab in Settings): 0.e3.63.114111

1 Like

Hey @Cereal! :sun_with_face:

Thank you for bringing this to our attention, I have submitted a ticket for our internal team to investigate this issue further. :slight_smile:

Hi Cereal,

This looks like it’s working as intended, as GetAllBindings matches the behaviour you would get when you Send the event.

I added prints to each of the three event functions used in the game, and sent each event in turn:

[Server] 1	0	1	1
[Server] onTest:
[Server] militaryAirdropSupplies1.BindingBugScript:HandleTest()
[Server] onTest2:
[Server] onTest3:
[Server] militaryAirdropSupplies1.BindingBugScriptFolderScript:Test()
[Server] onTest4:
[Server] militaryAirdropSupplies1.BindingBugScript:HandleTest2()

Each event printed the correct number of statements to match the results of GetAllBindings.

I note that you specifically refer to the player template. The test was performed in the Init() of a world entity script. The player will not have spawned at that point, so there is nothing for the second event (which has a binding declared against the player template (onTest2) to do. If you delay the test by 1 second so that the player has had chance to spawn, you get a different result:

[Server] onTest:
[Server] militaryAirdropSupplies1.BindingBugScript:HandleTest()
[Server] onTest2:
[Server] playerDynamic50703.BindingBugScriptFolderScript:Test()
[Server] onTest3:
[Server] militaryAirdropSupplies1.BindingBugScriptFolderScript:Test()
[Server] onTest4:
[Server] militaryAirdropSupplies1.BindingBugScript:HandleTest2()

Let me know if I’ve misunderstood something, but I don’t think there’s an issue here :slight_smile:

1 Like

Thanks for the explanation.

This specifically popped up in a different game, but it was long after the player had spawned. I’m going to have to dig into it more and get back to you. I must be barking up the wrong tree.

1 Like