PAYDAY-2-BeardLib icon indicating copy to clipboard operation
PAYDAY-2-BeardLib copied to clipboard

Custom Narratives setup outside of the `Maps` folder do not correctly setup the Lobby.

Open connieprice opened this issue 1 year ago • 9 comments

Seems to be related to GetMapByJobId only existing within MapFramework only allowing it to "see" narratives added via the Map folder.

connieprice avatar Apr 05 '23 21:04 connieprice

+1 to this issue. Overhaul mods like Crackdown, HEAT, ResMod, all use this feature, by loading custom narratives (and more) through a submods folder within the mod folder.

Additionally, I use this functionality in the mod seen here: https://modworkshop.net/mod/41851

Would love to see this issue fixed. Other than this issue, levels loaded in this way function totally fine.

SOMNUSNOVUS avatar Apr 05 '23 21:04 SOMNUSNOVUS

What actually IS the issue? Like, what isn't set up correctly?

segabl avatar Apr 05 '23 21:04 segabl

Maps loaded from outside the 'maps' folder aren't correctly added to the narratives table in a way where they can be sync'd to other users from the lobby (IE: you can't see people hosting these levels on crimenet, and you're unable to join an active lobby/game if it's on one of these levels).

As said in the initial issue comment, it seems the logic for this only exists within MapFramework, so it doesn't get initialized for maps loaded outside of the 'maps' folder.

SOMNUSNOVUS avatar Apr 05 '23 22:04 SOMNUSNOVUS

What actually IS the issue? Like, what isn't set up correctly?

Within Hooks/Network/NetworkMatchmakingSteam.lua there is a check that relies on BeardLib.Frameworks.Map:GetMapByJobId. This check is the gatekeeper for assigning custom narrative information to a lobby. This check is only properly setup for mods in the Maps folder, as dictated by MapFramework.lua

As this check fails, the custom_map flag is never set, causing the receiving end contained within a _call_callback hook in the same file to never correctly view this lobby as using a custom heist, because of this and because vanilla just dumps any levels it doesn't recognise, any custom levels defined outside of the Maps folder will never correctly be returned from lobby searches.

connieprice avatar Apr 06 '23 04:04 connieprice

Ah so it doesn't show custom map lobbies even if the user has them?

segabl avatar Apr 06 '23 09:04 segabl

Ah so it doesn't show custom map lobbies even if the user has them?

Yes, specifically for narratives defined in non Maps folder mods.

connieprice avatar Apr 06 '23 09:04 connieprice

Checking in. Crackdown has been released and uses the same submods system as MapAdd, thus none of its levels get added to the narrative table (as stated in above comments), would still like to see this issue addressed. Thanks!

SOMNUSNOVUS avatar May 02 '23 22:05 SOMNUSNOVUS

@Luffyyy is this something you checked while working on BeardLib 5?

segabl avatar Aug 12 '23 10:08 segabl

@Luffyyy is this something you checked while working on BeardLib 5?

I think so. I added the function to some utility class and changed the network code to check that there.

Luffyyy avatar Aug 12 '23 13:08 Luffyyy

BeardLib 5.0 merged the frameworks so this issue should be fixed.

Luffyyy avatar Jul 19 '24 18:07 Luffyyy