e1.6.0-v1.2.7 Modding Changes

Users who are viewing this thread

We tested this but couldn't reproduce it on 1.6.1. Could you please provide in what kind of scenario you tried this/more information on how to reproduce it?

I'm using Campaign.Events.OnSessionLaunchedEvent to add new menus and buttons.
Everything was working fine until 1.6.0.
But since 1.6.1, it is working partially.
All the menus called in PlayerTownVisitCampaignBehavior are working fine ("town", "town_backstreet", etc...).
But the menus called in EncounterGameMenuBehavior are not working ("town_outside", castle_outside, etc...).

class FourberieBehavior : CampaignBehaviorBase { public override void RegisterEvents() { CampaignEvents.OnSessionLaunchedEvent.AddNonSerializedListener(this, new Action<CampaignGameStarter>(this.AddGameMenusF));

The following will work (using "town_backstreet")

campaignGameSystemStarter.AddGameMenuOption("town_backstreet", "town_visitfourberie", "{=FoMa01}Fourberie", new GameMenuOption.OnConditionDelegate(FourberieBehavior.PlayerIsNotOwner), delegate (MenuCallbackArgs _) { }, false, 1, false);

But the following will not work (using "town_outside")

campaignGameSystemStarter.AddGameMenuOption("town_outside", "town_visitfourberie", "{=FoMa01}Fourberie", new GameMenuOption.OnConditionDelegate(FourberieBehavior.PlayerIsNotOwner), delegate (MenuCallbackArgs _) { }, false, 1, false);
 
I'm using Campaign.Events.OnSessionLaunchedEvent to add new menus and buttons.
Everything was working fine until 1.6.0.
But since 1.6.1, it is working partially.
All the menus called in PlayerTownVisitCampaignBehavior are working fine ("town", "town_backstreet", etc...).
But the menus called in EncounterGameMenuBehavior are not working ("town_outside", castle_outside, etc...).

class FourberieBehavior : CampaignBehaviorBase { public override void RegisterEvents() { CampaignEvents.OnSessionLaunchedEvent.AddNonSerializedListener(this, new Action<CampaignGameStarter>(this.AddGameMenusF));

The following will work (using "town_backstreet")

campaignGameSystemStarter.AddGameMenuOption("town_backstreet", "town_visitfourberie", "{=FoMa01}Fourberie", new GameMenuOption.OnConditionDelegate(FourberieBehavior.PlayerIsNotOwner), delegate (MenuCallbackArgs _) { }, false, 1, false);

But the following will not work (using "town_outside")

campaignGameSystemStarter.AddGameMenuOption("town_outside", "town_visitfourberie", "{=FoMa01}Fourberie", new GameMenuOption.OnConditionDelegate(FourberieBehavior.PlayerIsNotOwner), delegate (MenuCallbackArgs _) { }, false, 1, false);
We are also adding game menus at OnSessionLaunched. A GameMenuOption can't be added before the GameMenu is added. So that may be the case here, modder's behaviour's events may be called before EncounterGameMenuBehavior gets a chance to create its game menus. A quick workaround would be to add game menu options in a later state (for example by using both new game created and game loaded events).
 
We are also adding game menus at OnSessionLaunched. A GameMenuOption can't be added before the GameMenu is added. So that may be the case here, modder's behaviour's events may be called before EncounterGameMenuBehavior gets a chance to create its game menus. A quick workaround would be to add game menu options in a later state (for example by using both new game created and game loaded events).
Good to see I managed to make myself clear enough to be understood. ?
I think also that may be the case here.
And thanks for taking time to reply and suggest a workaround.
I will give it a try and if it doesn't work, I will find my own alternatives.
Anyway, thank you for the hard work!
1.6.1 is a nice update and I can't wait enough to see how the game will keep getting improved.
 
Unfortunately, by themselves they didn't resolve the spawning underground as Calradia's terrain heights over-rode those of my map. Hopefully, something else resolves that or it's back to using general modding patches.
You have to override a texture called "Main_map_physics_heightmap". You should replace that texture with your own heightmap, the resolution of which should be 1024x1024. You can directly use the heightmap exported from the editor using the "Export heightmap" button in Terrain Inspector. Please note that this is a temporary solution while we work on a system that will save the physics heightmap to the terrain file on "Scene save" automatically. It will likely be released within the next few patches.
 
You have to override a texture called "Main_map_physics_heightmap". You should replace that texture with your own heightmap, the resolution of which should be 1024x1024. You can directly use the heightmap exported from the editor using the "Export heightmap" button in Terrain Inspector. Please note that this is a temporary solution while we work on a system that will save the physics heightmap to the terrain file on "Scene save" automatically. It will likely be released within the next few patches.
Hi Dejan, thanks for the temporary fix. I'll test it next week when I'm back from holiday.
 
You have to override a texture called "Main_map_physics_heightmap". You should replace that texture with your own heightmap, the resolution of which should be 1024x1024. You can directly use the heightmap exported from the editor using the "Export heightmap" button in Terrain Inspector. Please note that this is a temporary solution while we work on a system that will save the physics heightmap to the terrain file on "Scene save" automatically. It will likely be released within the next few patches.
Unless that has been changed replacing that texture crashes the game, I tried that months ago. But to be sure I'll give that a shot when I'm back at my computer in a few hours, I don't recall what resolution I imported the texture as, so it was probably 16k instead of 1k
 
@NPC99 @Dejan It seems that replacing the physics heightmap still crashes. Just to be sure, I made a quick new map in and just replaced the base game map without touching anything else, it worked without the heightmap overridden (though I still was underground), but when I imported and overwrote the base game one it crashed when loading the campaign.
 
Greetings,

As part of the v162 patch, we released a number of modding related adjustments. They’ve been included in the patch notes but we’ll list them here as well.
  • Made adjustments so that custom classes that inherit from LogEntry, Issue, Quest or InformationData should now be much less likely to break a save game when the mod is removed.
    • In response to the discussion on the modding discord. Requested by [BUTR] zijistark.
  • Fixed a problem that caused rebellions in settlements with a custom culture (introduced by a mod) to crash the game.
  • Did preliminary work to allow modders to add to existing banner icon groups and introduce whole new groups with BannerManager.LoadBannerIcons(string xmlPath).
  • MissionGauntletNameMarker (ALT key name markers in settlements etc.) is now more moddable as you’re able to add/remove new agent targets.
  • Added horizontal scrolling to troop trees in the encyclopedia (if it's required).
  • Added <AlwaysLoad/> spritesheet config to indicate that the spritesheet category should be loaded by default.
  • Minor faction hero templates are now added through XML and stored in the Clan object directly. The minor faction hero spawn chance and hero limit values are now also moddable.
  • Troops can now have individual upgrade costs and XP reward for killing.
  • In the editor, progress bars were added to the “Navigation Mesh Auto Generation”, “Navigation Mesh Grid Generation”, “NavMesh Debug Mark Elevation Problem Faces” and “Remove Unreachable Faces” features.

We continue to work on the following issues:
  • Implement a left_hand flag.
    • In response to the animation-related request from @Lucon.
  • Making occupations moddable.
  • Documentation on implementing new flora.
  • Other requests (in earlier stages of development).
We likewise continue to look into the reported world map issues.

Thank you for all your feedback. If you have any questions or would like to make further requests, please discuss them below (or HERE).
 
  • In the editor, progress bars were added to the “Navigation Mesh Auto Generation”, “Navigation Mesh Grid Generation”, “NavMesh Debug Mark Elevation Problem Faces” and “Remove Unreachable Faces” features.
  • Implement a left_hand flag.
    • In response to the animation-related request from @Lucon.
  • Documentation on implementing new flora.

Special thank you for these!

Now, if you want to see some really happy modders, just release custom server files with the next update or give us some kind of possibility to test stuff in MP :!:
 

1.6.3 Changes​

Greetings,

Patch v163 brings a number of modding-related changes as well. They've been included in the patch notes but here's an overview of them as well and some additional information.
  • Heightmap selection dialogue now remembers the last used folder.
  • Added a warning to catch duplicate removals of entities.
  • Animations now support switching the item on the right hand to the left, and back. The appropriate flag for this is "switch_item_between_hands" which can be set in the editor. The addition of "hand_switch_data" to the animation is then also required to be set in the editor.
    • In response to the animation-related request from @Lucon.
    • Preview example of usage:
  • Damage Particles are now moddable. A new GameModel named DamageParticleModel has been added. By creating and using a new model class inherited from DamageParticleModel and overriding needed functions modders can choose damage particles very precisely according to collision properties.
  • banner_icons.xml is now moddable. Modders can include their own banner_icons.xml in their modules under "{MODULE_NAME}/ModuleData/banner_icons.xml". Sigils, backgrounds and colours defined in these XMLs will extend the native banner icons.
  • Added editor visuals that show ranged siege weapon trajectories.
  • Languages are now moddable. Modders can now change options for all languages by providing their own options file. (see Native/ModuleData/Languages/[ID]/[id]_options.xml).
  • Moved occupation field to the Hero class from CharacterObject class, making occupations moddable.
    • In response to a community request made via the modding discord.
  • Made character creation modder friendly.
    • CharacterCreationStages are now moddable. Modders can decide explicitly which stage types should be included and in what order in CharacterCreationContentBase. They can use their own stage types.
    • Fixed a few bugs that could crash the game when new cultures are used in character creation.
    • Exposed CharacterCreation.CharacterCreationMenus to modders.
    • Most functions', fields' enums' protection levels in StoryModeCharacterCreationContent and SandboxCharacterCreationContent have been changed to protected from private.
    • In response to a community request made via the modding discord.
  • Fixed a crash that occurred while sieging settlements with custom cultures.
  • Fixed a crash that occurred if the submodule.xml had a comment in it.

We continue to work on the following issues:
We have also updated the following documentation page as the system has changed a bit with v162 and the addition of the <AlwaysLoad/> spritesheet config: http://docs.modding.bannerlord.com/asset-management/generating_and_loading_ui_sprite_sheets/

We also continue to work on the world-map-related issues that prevent you from using custom maps successfully, thank you for your patience.

Thank you for all your feedback. If you have any questions or would like to make further requests, please discuss them below (or HERE).
 

1.6.3 Changes​

Greetings,

Patch v163 brings a number of modding-related changes as well. They've been included in the patch notes but here's an overview of them as well and some additional information.
  • Heightmap selection dialogue now remembers the last used folder.
  • Added a warning to catch duplicate removals of entities.
  • Animations now support switching the item on the right hand to the left, and back. The appropriate flag for this is "switch_item_between_hands" which can be set in the editor. The addition of "hand_switch_data" to the animation is then also required to be set in the editor.
    • In response to the animation-related request from @Lucon.
    • Preview example of usage:
  • Damage Particles are now moddable. A new GameModel named DamageParticleModel has been added. By creating and using a new model class inherited from DamageParticleModel and overriding needed functions modders can choose damage particles very precisely according to collision properties.
  • banner_icons.xml is now moddable. Modders can include their own banner_icons.xml in their modules under "{MODULE_NAME}/ModuleData/banner_icons.xml". Sigils, backgrounds and colours defined in these XMLs will extend the native banner icons.
  • Added editor visuals that show ranged siege weapon trajectories.
  • Languages are now moddable. Modders can now change options for all languages by providing their own options file. (see Native/ModuleData/Languages/[ID]/[id]_options.xml).
  • Moved occupation field to the Hero class from CharacterObject class, making occupations moddable.
    • In response to a community request made via the modding discord.
  • Made character creation modder friendly.
    • CharacterCreationStages are now moddable. Modders can decide explicitly which stage types should be included and in what order in CharacterCreationContentBase. They can use their own stage types.
    • Fixed a few bugs that could crash the game when new cultures are used in character creation.
    • Exposed CharacterCreation.CharacterCreationMenus to modders.
    • Most functions', fields' enums' protection levels in StoryModeCharacterCreationContent and SandboxCharacterCreationContent have been changed to protected from private.
    • In response to a community request made via the modding discord.
  • Fixed a crash that occurred while sieging settlements with custom cultures.
  • Fixed a crash that occurred if the submodule.xml had a comment in it.

We continue to work on the following issues:
We have also updated the following documentation page as the system has changed a bit with v162 and the addition of the <AlwaysLoad/> spritesheet config: http://docs.modding.bannerlord.com/asset-management/generating_and_loading_ui_sprite_sheets/

We also continue to work on the world-map-related issues that prevent you from using custom maps successfully, thank you for your patience.

Thank you for all your feedback. If you have any questions or would like to make further requests, please discuss them below (or HERE).

Just a question about video.When he holding sword in left hand he is holding it in half. it is made like this by purpose? there is a difference in which hand he holding sword? how this work?
 
Just a question about video.When he holding sword in left hand he is holding it in half. it is made like this by purpose? there is a difference in which hand he holding sword? how this work?
We just made a quick animation to demonstrate how the system works. It allows you to move an item from the right to the left hand and back within a single animation, if that makes sense. The reason he's holding the sword as he is in the left hand is because we made the test animation like that.

This request came from the mods with rifles so that they can use their reload animations (to move the rifle into the left hand while reloading). But there are other applications as well.
 
We just made a quick animation to demonstrate how the system works. It allows you to move an item from the right to the left hand and back within a single animation, if that makes sense. The reason he's holding the sword as he is in the left hand is because we made the test animation like that.

This request came from the mods with rifles so that they can use their reload animations (to move the rifle into the left hand while reloading). But there are other applications as well.
Thanks for the explanation!
 
Back
Top Bottom