Documentation icon indicating copy to clipboard operation
Documentation copied to clipboard

Some tutorial suggestions

Open olejsc opened this issue 4 years ago • 5 comments

Here's some tutorial suggestions, which would be rather beneficial:

Elementary things most, if not all mods do:

  • Save/Load mod settings from XML file.
  • Usage of Bannerlord's built in save-system with mod data, and how it works with loading and saving games.
  • How to make a simple gamemenu to show mod-settings (in main menu) (checkbox, slider, inputfield etc. and apply-button).
  • Nested submodules (mods inside mods!)
  • Mod dependencies to other mods.

General

  • Tips and tricks for good debugging while modding ( Using developer console, using MBDebug.Print etc., getting stacktrace from errors ), aswell as general tips on how to explore the assemblies from the game and browse the source code.
  • Overriding existing XML files (allready covered I think).
  • General gameloop cycle of the api explained :
    • Campaign's Events: OnHourlyTick, OnDailtyTick, OnWeeklyTick etc., OnTick, OnCampaignStart etc.
    • Mission Events : OnAgentHit, OnAgentRemoved, OnAgentBuild, OnAgentBlow, OnAgentCreated, OnMissionTick, OnMissionCreated, OnMissionEnded, OnMissionStart OnMissionLoad etc.
    • MissionHandlers, AgentComponents, Agents,

Common Gameplay changes:

GameModels

  • Modifying a GameModel (by extending a class), for example CombatTroopXPModel or something similar, very easy.
  • Adding new gamemoddel (not extending an existing game model, but adding completely new model). For example "UnitsFlyBehaviour"

MissionBehaviours

  • Modifying a MissionBehaviour (extending/overriding part of its behaviour)
  • Adding completely new mission
  • Targetting missionbehaviour at correct missions (you dont want your awesome vampire bloodsucking mod to work for all units in Arenamatch, only during a battle for example)

UserInterface

  • Tutorial how to add new UI elements to an existing UI element (more buttons in a panel for example) in campaign mode (town screen/ main campaign view/ scoreboard in a battle etc.)
  • More suggestions needed for more ideas here (?)

Networking

  • Setting up a simple modded, dedicated server
  • Persist server data across sessions and restarts

While i realize this list is quite long, and rather unrealistic at this point, with so limited documentation - if the goal of this repo is bannedlord modding documentation, and if we assume the modding scene of this game last equally as long (and gets as big) as Mount and Blade Warband, I believe It's safe to say that all of these tutorials are nescesarry and will be nescesarry.

What do you think?

olejsc avatar Apr 11 '20 21:04 olejsc

I think it is a great idea to have a lot of tutorials in one-place.

For me, writing tutorial / doc. is a bit hard, but (for me personally) it gets easier, when there is a concrete need for something as i like to help people. So I think we should prioritize which tutorials are the most useful for the most modders.

Another problem might be that not every contributor has full knowledge of every aspect of modding in Bannerlord. For example, I know a bit about the GameMenus because I played with them a bit, but I have no clue about the multiplayer stuff. It would be cool, to have a "dropbin" where people, who have experience with a section, could drop stuff in a raw from (just paragraphes, keywords) and we could then turn this into tutorials / doc. Could be the forums? A wiki? Just Direct-Messages on Discord? Own channel? I don't know if this is a good idea, but maybe it could work Thoughts? @Ster-Z.

highstreeto avatar Apr 12 '20 11:04 highstreeto

Very nice list of suggestions!

Unfortunately, I've been very busy with migrating the docs to VuePress and haven't had much time to work on these things lately. If you are interested in working on any of these, feel free to do so! Otherwise, I can write a few tutorials after I finish migrating the docs.

strlngd avatar Apr 12 '20 18:04 strlngd

Going back to the list of elemetary things, I feel that it wouldn't make sense for every mod to have its own settings button in the main menu. I have around 10 mods installed, but I already have 3 separate mod settings buttons (AutoTrader, BannerlordTweaks, and Community Patch). I don't think this is sustainable, so we should probably recommend some form of a settings gamemenu library (for example, ModLib which BannerlordTweaks uses). Of course, we could still have a tutorial detailing how to add one, but we shouldn't recommend using a custom implementation unless absolutely necessary.

MajikalExplosions avatar Apr 14 '20 16:04 MajikalExplosions

-> General ->Debugging Already covered by tutorials. dnSpy pretty useful.

I think something like channel in discord will be conveniently for discussing.

Anakael avatar Apr 19 '20 03:04 Anakael

Hello, Is anyone working on a tutorial on how to create new weapons in bannerlord? I would be very interested in that tutorial.

jak6jak avatar May 17 '20 02:05 jak6jak