Recent content by clivictr

  1. Saving mod data/settings - Thoughts

    Thanks for sharing. I've been using System.IO.File.WriteAllText() for saving some basic data for my mod (strings, integers, etc.). It may be simpler to implement compared to your solution, which I believe would work nicely too.

    C#:
    public static void WriteConfig(string mode)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("//Lines started with // are comments.");
                sb.AppendLine(Environment.NewLine);
             
                sb.AppendLine("//Mode: (Available options: A, B)");
                sb.AppendLine($"Mode={mode}");
                File.WriteAllText(ConfigPath, sb.ToString());
    
            }

    C#:
     public static void ReadConfig()
            {
                // Directories
                if (!Directory.Exists(FilesPath))
                {
                    Directory.CreateDirectory(FilesPath);
                }
                if (!Directory.Exists(SavePath))
                {
                    Directory.CreateDirectory(SavePath);
                }
    
                string filename = ConfigPath;
                if (!File.Exists(filename))
                {
                    WriteConfig(Config.RWMode.A.ToString());
                }
    
                string mode = null;
                foreach (var keyValuePair in ReadFile(filename))
                {
                    var key = keyValuePair.Key;
                    var value = keyValuePair.Value;
    
                    if (key.Equals("Mode"))
                    {
                        mode = value;
                    }
                }
    
                // Read
                bool success = Config.SetMode(mode);
                if (!success)
                {
                    if(mode == null)
                        ShowAndLog($"\"Mode\" entry not found. Please check {ConfigPath}, or delete the parent folder, switch back to the game.");
                    else
                        Log($"Invalid mode \"{mode}\".");
                }
            }
  2. New game from Visual Studio 2019 causes crash, even with no mods enabled

    For anyone having a similar issue, I think I just found the fix. Your base modules must be in the same order as shown on the launcher in the Visual Studio command line arguments. So "/singleplayer _MODULES_*Native*SandBoxCore*CustomBattle*SandBox*StoryMode*_MODULES_", with any mods at the end before _MODULES_.
    Life saver I luv you! My mod's having the exact issue: crash upon launching. Now it's fixed!

    And mostly, the order in your launcher should be
    /singleplayer _MODULES_*Native*SandBoxCore*CustomBattle*SandBox*StoryMode*_MODULES_

    Because you can't change the order in the launcher for the default modules, I assume every player has this same order.
  3. Documentation Coding Community Modding Documentation

    Thanks a lot for doing this, Ster! Great to see the Bannerlord modding community collaborating like that and sharing the knowledge :smile:

    These might be of interest for mod authors who upload to Nexus Mods:
    Thanks for sharing this information.
  4. Tutorial XML Editing Coding Glorified's Bannerlord Modding Tutorial Video Series

    Can I ask where you find information about Bannerlord modding in general? Like no where on this OFFICIAL forum I can see link to documentation you posted under video. Like wtf.

    Yep it was hard to find. But the link to documentation is the pinned post of this forum section "The Smithy - Mod Development".
  5. Is there an example of a "finished" mod or of a sandbox for Bannerlord?

    Harmony is actually suggested to be used "when absolutely needed" for this game:
  6. [Fixed] Mods won't work because namespace doesn't match the project name.

    UPDATE: It's not the patches fault. It was because the namespace of the scripts doesn't match the project name. Changed the namespaces and it worked.. I followed the documentation and built a test module. Crashes upon launch. Then I also used this template and built a module. Crashed too. And...
  7. How did they make mods before the official modding tools are released?

    As per the source code of this mod, You need to create a class library in visual studio, and reference Taleworld's libraries. So it seems they had access to these libraries that we don't have public access to yet...

    You didn't have the beta? You just unpak the files within the folder structure. It's not hard.

    No, I followed the documentation, and added reference to these dlls under bin\Win64_Shipping_Client
  8. How did they make mods before the official modding tools are released?

    the libs are in everyones game folder, everyone has access

    have a good day
    Yep. Saw that in the documentation. That was solved.
  9. Documentation Coding Community Modding Documentation

    Thanks so much! I've spent 3 hours looking for this documentation!
  10. How did they make mods before the official modding tools are released?

    There are already a bunch of mods available in Nexus, mostly script fixes. Bascially it's a submodule,with a dll in a bin folder, and an xml file. How did they know the modding structure, code it in C# and make it into a dll it BEFORE any official modding tools are released? Could anyone reveal...
Back
Top Bottom