Mount & Blade II: Bannerlord

Mount & Blade II: Bannerlord

49 valoraciones
Discord Rich Presence
   
Premio
Favoritos
Favorito
Quitar
Tamaño
Publicado el
Actualizado el
20.164 MB
5 DIC 2022 a las 6:24 a. m.
30 JUN 2024 a las 7:36 a. m.
6 notas sobre cambios ( ver )

Suscríbete para descargar
Discord Rich Presence

Descripción
Sources available at GitHub[github.com]!

Adds Discord Rich Presence support for the game! Inspired by one of the first mods on NexusMods, Discord RP for Bannerlord[www.nexusmods.com]!

Full translation support as expected from BUTR mods!
Settings are available via MCM!

You can also enable mod sharing in Options that will add a fancy button on the bottom of your profile, opening it will give you an URL in format `https://modlist.butr.link/d29ee27c-5f08-4a53-b4ae-231a76d5e404` that will contain your game version and the list of enabled mods! The url will be available for 8 hour since the start of your game!
Some commentary about this feature. At the start of the game when the option is enabled or when saving with the enabled option, the module will send to `https://modlist.butr.link` the game version and the mod list and obtain a link that lives 8 hours that will show you the info. This is done this way because Discord has a limit on the URL length and we can't put the info inside the URL via the query params, so we have a quick lived backend server that stores this info.
Because the Module is open-sourced, even if our server dies after some years, we have the backend available[github.com] for anyone to host and setup the module again with the feature!

The game supports basic states:
  • Main Menu
  • Loading
  • Custom Battles
  • Campaign:
  • Traveling near a settlement
  • Conversation with someone
  • At Settlement
  • In Settlement (Mission)
  • In Battle (simulation and not) with troop count. Attacking/Defending. Raid, Siege, Forcing* are all supported

For Modders
Other mods can use this module to set their own presence:
Note that you can use this code even if Bannerlord.DiscordRichPresence is not enabled by user, the actions will be skipped.
ButterLib's DynamicAPI
internal static class DiscordRichPresenceAPI { private static readonly Action<string, DateTime?, DateTime?, bool>? SetPresenceMethod = DynamicAPIProvider.RequestAPIMethod<Action<string, DateTime?, DateTime?, bool>>("Bannerlord.DiscordRichPresence", "SetPresence"); private static readonly Action<bool>? SetPreviousPresenceMethod = DynamicAPIProvider.RequestAPIMethod<Action<bool>>("Bannerlord.DiscordRichPresence", "SetPreviousPresence"); public static void SetPresence(string details, DateTime? start, DateTime? end) { if (SetPresenceMethod != null) { SetPresenceMethod(details, start, end, true); } } public static void SetPreviousPresence() { if (SetPreviousPresenceMethod != null) { SetPreviousPresence(true); } } }
Reflection and Harmony
internal static class DiscordRichPresenceAPI { private static readonly Action<string, DateTime?, DateTime?, bool>? SetPresenceMethod = AccessTools.Method("Bannerlord.DiscordRichPresence:SetPresence") is { } method ? AccessTools.MethodDelegate<Action<string, DateTime?, DateTime?, bool>>(method) : null; private static readonly Action<bool>? SetPreviousPresenceMethod = AccessTools.Method("Bannerlord.DiscordRichPresence:SetPreviousPresence") is { } method ? AccessTools.MethodDelegate<Action<bool>>(method) : null; public static void SetPresence(string details, DateTime? start, DateTime? end) { if (SetPresenceMethod != null) { SetPresenceMethod(details, start, end, true); } } public static void SetPreviousPresence() { if (SetPreviousPresenceMethod != null) { SetPreviousPresence(true); } } }
Discusiones populares Ver todo (1)
3
3 MAR 2023 a las 11:15 a. m.
Discord Rich Presence Ideas
Pinkie Arg
19 comentarios
Oh for Fox Sake 25 FEB a las 6:06 p. m. 
Found the crash! *Delete*
Cyphero7 26 ENE a las 2:19 a. m. 
Update please ... v1.2.12 instant crash at start
Caldery 28 OCT 2024 a las 4:27 p. m. 
@Pinkie Arg Personally not getting crashes (only tested loading and starting campaign since those are the main 2 complaints) so its likely either outdated versions/people not resubbing to mods when they update or a mod conflict that I don't have despite using a moderate mod list
wf1675 3 JUL 2024 a las 11:57 p. m. 
getting crashes :P
BloodSkals 24 DIC 2023 a las 1:49 p. m. 
I confirm this makes the game crash on V1.2.7
Spooky Foosh 11 OCT 2023 a las 3:03 p. m. 
Still causes crashes on current release, no other mods enabled
EdwinVonKalckreuth 24 JUL 2023 a las 10:39 a. m. 
Game crashes whenever I am trying to start a campaign, no other mods enables current lates release
Emrun 4 JUL 2023 a las 1:33 p. m. 
Game version 1.1.5.21456 Game crashes when starting campaign
Pinkie Arg  [autor] 2 JUL 2023 a las 11:44 a. m. 
Again, where does it crash? What game version? Is a crash report available?
soupKitchen 1 JUL 2023 a las 8:54 p. m. 
great idea but sadly it still crashes after update. is there a certain load order you recommend