Users who are viewing this thread

Hey legends! I'm desperately seeking further information or resources regarding the implementation of a custom Battering Ram asset that I have created.


i1gjqW1.png


ULkCzck.jpg


kn6S3Pi.jpg


s67xUTr.png


coqv728.png

I have rigged and animated the model inside of Blender, and have exported the mesh, armature and animation according to the Taleworlds documentation, but so far I'm at a loss about how to replace the Native battering ram with mine. I have LODs and a collision model also.

I am particularly at a loss when it comes to the coding side of things as I am not very handy with C#.

Any tips or advice are greatly appreciated. Thanks!
 
Hey legends! I'm desperately seeking further information or resources regarding the implementation of a custom Battering Ram asset that I have created.


i1gjqW1.png


ULkCzck.jpg


kn6S3Pi.jpg


s67xUTr.png


coqv728.png

I have rigged and animated the model inside of Blender, and have exported the mesh, armature and animation according to the Taleworlds documentation, but so far I'm at a loss about how to replace the Native battering ram with mine. I have LODs and a collision model also.

I am particularly at a loss when it comes to the coding side of things as I am not very handy with C#.

Any tips or advice are greatly appreciated. Thanks!
Looks great. IDK much about siege scenes. Battering rams are placed in scenes using a prefab as noted in the documentation https://moddocs.bannerlord.com/authoring-mission-scenes/sieges/ using a batteringram_a_spawner prefab and associating it with a path. In the scene editor you can only inspect/change the variables of the BatteringRamSpawner script. So, I think you need to look at props_siege_batteringrams.xml in ...\Mount & Blade II Bannerlord\Modules\Native\Prefabs\ which seems to contain all of the destructible components. However, I've not attempted to make any substitutions and expect you would need to create a new prefab in your mod's prefab folder if you only wanted your battering ram to appear in certain scenes.

PS here's an old TW Dev comment "...all 4 wheels of the siegetower/ram "snap" to the terrain. They dont go through objects. So keep that in mind when designing the paths, that there shouldn't be any tree, bigger stone or objects on / ~5m to each side of it." or "it will get wonky and try to balance out" which suggests their scripts may be designed for 4 wheels as opposed to your 6.
 
Last edited:
Upvote 0
Looks great. IDK much about siege scenes. Battering rams are placed in scenes using a prefab as noted in the documentation https://moddocs.bannerlord.com/authoring-mission-scenes/sieges/ using a batteringram_a_spawner prefab and associating it with a path. In the scene editor you can only inspect/change the variables of the BatteringRamSpawner script. So, I think you need to look at props_siege_batteringrams.xml in ...\Mount & Blade II Bannerlord\Modules\Native\Prefabs\ which seems to contain all of the destructible components. However, I've not attempted to make any substitutions and expect you would need to create a new prefab in your mod's prefab folder if you only wanted your battering ram to appear in certain scenes.

PS here's an old TW Dev comment "...all 4 wheels of the siegetower/ram "snap" to the terrain. They dont go through objects. So keep that in mind when designing the paths, that there shouldn't be any tree, bigger stone or objects on / ~5m to each side of it." or "it will get wonky and try to balance out" which suggests their scripts may be designed for 4 wheels as opposed to your 6.
Thanks for getting back to me, how would I go about creating a new prefab? Also so far, whenever I try to create a new animation inside the editor according to the Official documentation, the editor crashes to desktop every time.
 
Upvote 0
Thanks for getting back to me, how would I go about creating a new prefab? Also so far, whenever I try to create a new animation inside the editor according to the Official documentation, the editor crashes to desktop every time.
IDK the correct approach. I'd try copying props_siege_batteringrams.xml as it's a prefab xml that contains a single prefab: batteringram_a
Hopefully, if it's like other xmls, changing the entity name to something else and editing its components should provide a new prefab that's loaded in addition to the vanilla one. I presume you'd need to copy your edited version of props_siege_batteringrams.xml (keeping the filename unchanged) to an appropriate folder in your mod: ...\Mount & Blade II Bannerlord\Modules\Yourmod\Prefabs\ I expect you'll need a reference to load this new XmlNode in your mods SubModule.xml (id="prefabs" and path= "C:\Program Files (x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\Modules\Yourmod\Prefabs\props_siege_batteringrams"). I'm not sure about the path as it's normally just a filename or subfolder of your mod's ModuleData folder, which it can't be in this case. All you can do is experiment and ask for better advice on the bl-coding channel of the Mount & Blade Modding discord.
In the unlikely event this works, you'd then need to edit the scene you want it to appear in so the new prefab is referenced etc.

PS the fact that the prefab xml is not inside ModuleData may mean it wasn't intended to be loaded via SubModule.xml or project.mbproj. However, that's beyond my knowledge as it would require some C# coding to load.
 
Last edited:
Upvote 0
Back
Top Bottom