Battle Brothers
0 of 0

File information

Last updated

Original upload

Created by

bigmap

Uploaded by

bigmap

Virus scan

Safe to use

Tags for this mod

11 comments

  1. blueshark
    blueshark
    • member
    • 1 kudos
    Hi, first of all, great mod! Been using this mod for quite sometimes.

    However in later game, I have this issue. 
    I am running Legends 16.4.3 with MSU 1.2.7 and PTR 2.1.27.

    Please help update this great mod

    Screenshot
  2. Endur1el
    Endur1el
    • premium
    • 31 kudos
    Hi there, amazing mod idea, really think this is a much more comprehensive save system than vanilla or even taro's multiple saves.

    I came here to say that the implementation has some issues that could cause compatibility issues with other mods (and maybe even vanilla, it's hard to say), and I think some these should at least be documented and the rest remedied.

    The mod modifies world_state.nut in the following ways:

    • Adds 2 (imo really badly named) properties to the m table (asn and osn). I think this could easily be fixed by doing something like
    o.m.EnhancedAutosave <- {
    WellNamedProperty1 = 0,
    WellNamedProperty2 = 0
    };

    • Wraps the following functions without returning their return values. This should never be done and you should always be returning the value of the function you're wrapping: instead of just calling 'startCombatFunc()' at the end of your wrapper, you should be doing 'return startCombatFunc()'. THIS CAN AND WILL CAUSE ISSUES FOR NO REASON. This currently affects the following functions
    function startCombat( _pos )
    function saveCampaign ( _campaignFileName, _campaignLabel = null )
    function exitGame()
    function onCombatFinished()

    • Completely overwrites the following functions, some of which can be relatively easily avoided. 
    function autosave() // this one is avoidable imo, do some of the if statements yourself and match the case you wanna handle, let the original function handle the rest
    function showTownScreen() // this one and the one below are obviously a lot more complicated to not overwrite, though possible with some hackery. I'd understand if you wanna keep these as overwrites but this should definitely be documented as changes to these functions in vanilla or legends would require and update from this mod.
    function showCampScreen() [Legends only]

    Finally some miscellaneous notes THAT ARE ALSO IMPORTANT.

    • Your mod version number shouldn't actually be working and I believe is a bug in squirrel. 1.0.1 is simply parsed as 1.0 and the final .1 is thrown away. If you wanna use semantic versioning you should be using MSU and passing "1.0.1", if you're not planning to do then then simply remove the .1 and version with 1.1->1.2 etc
    • The properties you add to the m table aren't serialized, even though they really should be, this means that your counter restarts from 1 every time you reload the save, which isn't great imo. The fix for this isn't super trivial while preserving save compatibility so I'd just mark this as a TODO for when MSU 1.2 releases (at which point it will be very simple and I'll try to update this post)

    1. bigmap
      bigmap
      • member
      • 1 kudos
      Thank you for your reply. I'm a rookie,  function showTownScreen()  function showCampScreen()?how to hook?
    2. Endur1el
      Endur1el
      • premium
      • 31 kudos
      I think the other issues are more important. I also noticed you should switch from mods_hookNewObject to mod_hookExactClass as it is more performant and reliable. Once MSU 1.2.0 releases I'll write up how you can hook showTownScreen and showCampScreen as well as how to fix the issue with your fields not getting serialized.
    3. bigmap
      bigmap
      • member
      • 1 kudos
      Ok! thank you very much! 
  3. LexyBiersack
    LexyBiersack
    • member
    • 0 kudos
    Great mod, never have to manually save the game again.
  4. doorlover1337
    doorlover1337
    • member
    • 0 kudos
    Just want to say thanks to you. Super mod.
  5. Mayhem117
    Mayhem117
    • member
    • 0 kudos
    There is a mod likes this before, created by TaroEld. Why did you need to create another similar mod and work the same?
    1. lujenchia
      lujenchia
      • member
      • 1 kudos
      From the screenshot, it looks like it autosaves on other timing such as leaving town, and name the savefiles according to save timing, guess I will give it a try.
    2. lujenchia
      lujenchia
      • member
      • 1 kudos
      Tried it out, it autosaves at combat start, combat end, exit town and another autosave file just called autosave (I wonder what the timing is?) also make (Legend) tag on saves with Legend mod.
    3. bigmap
      bigmap
      • member
      • 1 kudos
      Thank you for your attention. These are two different MODs.