Von Krieglitz
Squire
I have received countless* PMs about my way to do heraldic armors, and after a quick search in the Forge board, I haven't discovered any tutorial about the way to build heraldic armors.
So I have decided to do this tutorial.
Precision: I'm far to be a good modder, and hang me if I know anything about scripting. But I am of these guys who like share their ignorance.
I understand very few about how it works. In fact this method was elaborated after the reading of the source of the mod "Fire Arrow - turn into an inferno", by Rucchi. Rucchi is a real brilliant mind, all I have done is to try to mimick his code.
So this tutorial will undoubtly better if Rucchi had wroten it (not mentioning my approximating english, as I am french**). But as we say in France, "Faute de grive, on se contente de merles".
Well you will at least have learnt one thing in reading my topic...
It is possible that these data could be greatly enhanced. Remember that I have only copied the script of Rucchi without any understanding of it.
So if you have remarks, suggestions...
And last remarks, all this stuff is working on Mount&Blade 1.011. I think it will work in Warband, but some minor adaptation will perhaps be necessary, by example with the shaders.
Ready?
You will need:
- a brf editor
- a software allowing the editing of dds. Personally I use PaintNet (a freeware)
- the Module System!
First of all, you have to choice the armor you want to become heraldic. In order to facilitate the understanding of the tutorial
We will call "XXX" the name of the original armor (i.e. without heraldic color).
1- Edit the texture.
Make a copy of the texture corresponding to XXX.
If the original armor has a normal_map or a specular map, you don't have to edit them.
The area you want painted with the heraldic armors must be transparent, and the texture must be saved in DXT5 dds format, which allowed the transparency.
This editing can be made with PaintNet (a free software).
If the transparency look too hard for you, you can also deleting the area, but the result will look a little too fancy.
Save it as "heraldic_XXX".
2- Edit the brf.
2a - Add the new texture "heraldic_XXX.dds" in one of the brf file of your mod.
2b - Add the new material "new_heraldic_XXX_banner" in the same brf file.
Properties:
Shader: simple_shader
DiffuseA: heraldic_XXX
DiffuseB: none
Bump: none
Enviro: none
Specular: none
Spec RGB : 0 - 0 - 0
Coef: 0
Flags: Blend
2c - Add the new material "sample_heraldic_XXX_banner" in the same brf file.
Properties:
Shader: specular_shader_skin
DiffuseA: heraldic_XXX
DiffuseB: none
Bump: none
Enviro: none
Specular: the same as original
Spec RGB : the same as original
Coef: the same as original
Flags: Blend, Bled add, Blend Multiply
2d - Add the mesh of the new armor: Insert a copy of the meshe of XXX. Name it "heraldic_XXX".
Set the material as "new_heraldic_XXX_banner"
2e - Add the mesh of the tableau material: Insert a copy of a "tableau_mesh_heraldic_armor". These meshes can be found in the Mount&Blade/CommonRes/heraldic_armors.brf.
Name it tableau_mesh_heraldic_XXX_banner".
Set the material as "new_heraldic_XXX_banner"
2f - Add a second mesh of a tableau material.
Name it tableau_mesh_heraldic_XXX".
As material, use the same material used by the meshe of the original XXX armor (without heraldic color).
3- Python scripting:
3a - Edit module_meshes.py. Find the line
After this line, add these two lines:
3b - Edit module_tableau_materials.py.
Find the chapter beginning by the line:
Go at the end of the chapter, and just after, so before the line:
paste this :
Some explanations :
in the lines " (position_set_x, pos1, 1,
and " (position_set_y, pos1, 170),
the value are the coordinates where the banner meshes will be inserted in the texture of heraldic_XXX.dds
You will undoubtly test some couples of values in order to determine the value which set perfectly with your mesh.
In the line " (cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
the value "113" is the size of the banner mesh. So you can decrease or increase it (in my meshes I use size between 40 and 90).
3c- Edit module_items.py.
Copy the line corresponding to the original armor.
Paste it at the end of your file, before the last ].
This line will look to something as:
Rename the name XXX as you want, and the name of the meshe (in my example "platemail") by the name of the meshes you have added during the step 2d, i.e. heraldic_XXX in my text.
Just before the ] at the end of the line (not the last of the file!), add this:
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_XXX", ":agent_no", ":troop_no")])]
So your last line will look as this :
And after these lines, you must have the last "]" which close the file.
4- Run build_module.
You can now test your armor. I recommand to edit module_troop in order to give one of your new armor to the troop "Player", so you will begin the game with this armor, and can check if the banner is at the good location.
If not, you can save your game, and edit the "position_set_y", "postion_set_x" to modify the location of the banner in your armor, and the "cur_tableau_add_mesh, ":banner_mesh", pos1" in order to resize it.
Run at new Build_module, the change will be save compatible, so you just have to reload your savegame to check if the new location is better.
Good luck!
* countless if you can't count more than one.
** but I am burgundian, one of those who have sold Joan of Arc to the English, which prove that us, we are able to try to get better .
Link to the file I have used in my own mod:
http://www.mbrepository.com/file.php?id=2039
You can use it as a minimod.
Results example:
So I have decided to do this tutorial.
Precision: I'm far to be a good modder, and hang me if I know anything about scripting. But I am of these guys who like share their ignorance.
I understand very few about how it works. In fact this method was elaborated after the reading of the source of the mod "Fire Arrow - turn into an inferno", by Rucchi. Rucchi is a real brilliant mind, all I have done is to try to mimick his code.
So this tutorial will undoubtly better if Rucchi had wroten it (not mentioning my approximating english, as I am french**). But as we say in France, "Faute de grive, on se contente de merles".
Well you will at least have learnt one thing in reading my topic...
It is possible that these data could be greatly enhanced. Remember that I have only copied the script of Rucchi without any understanding of it.
So if you have remarks, suggestions...
And last remarks, all this stuff is working on Mount&Blade 1.011. I think it will work in Warband, but some minor adaptation will perhaps be necessary, by example with the shaders.
Ready?
You will need:
- a brf editor
- a software allowing the editing of dds. Personally I use PaintNet (a freeware)
- the Module System!
First of all, you have to choice the armor you want to become heraldic. In order to facilitate the understanding of the tutorial
We will call "XXX" the name of the original armor (i.e. without heraldic color).
1- Edit the texture.
Make a copy of the texture corresponding to XXX.
If the original armor has a normal_map or a specular map, you don't have to edit them.
The area you want painted with the heraldic armors must be transparent, and the texture must be saved in DXT5 dds format, which allowed the transparency.
This editing can be made with PaintNet (a free software).
If the transparency look too hard for you, you can also deleting the area, but the result will look a little too fancy.
Save it as "heraldic_XXX".
2- Edit the brf.
2a - Add the new texture "heraldic_XXX.dds" in one of the brf file of your mod.
2b - Add the new material "new_heraldic_XXX_banner" in the same brf file.
Properties:
Shader: simple_shader
DiffuseA: heraldic_XXX
DiffuseB: none
Bump: none
Enviro: none
Specular: none
Spec RGB : 0 - 0 - 0
Coef: 0
Flags: Blend
2c - Add the new material "sample_heraldic_XXX_banner" in the same brf file.
Properties:
Shader: specular_shader_skin
DiffuseA: heraldic_XXX
DiffuseB: none
Bump: none
Enviro: none
Specular: the same as original
Spec RGB : the same as original
Coef: the same as original
Flags: Blend, Bled add, Blend Multiply
2d - Add the mesh of the new armor: Insert a copy of the meshe of XXX. Name it "heraldic_XXX".
Set the material as "new_heraldic_XXX_banner"
2e - Add the mesh of the tableau material: Insert a copy of a "tableau_mesh_heraldic_armor". These meshes can be found in the Mount&Blade/CommonRes/heraldic_armors.brf.
Name it tableau_mesh_heraldic_XXX_banner".
Set the material as "new_heraldic_XXX_banner"
2f - Add a second mesh of a tableau material.
Name it tableau_mesh_heraldic_XXX".
As material, use the same material used by the meshe of the original XXX armor (without heraldic color).
3- Python scripting:
3a - Edit module_meshes.py. Find the line
Code:
("tableau_mesh_heraldic_armor_d", 0, "tableau_mesh_heraldic_armor_d", 0, 0, 0, 0, 0, 0, 1, 1, 1),
Code:
("tableau_mesh_heraldic_XXX_banner", 0, "tableau_mesh_heraldic_XXX_banner", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_heraldic_XXX", 0, "tableau_mesh_heraldic_XXX", 0, 0, 0, 0, 0, 0, 1, 1, 1),
3b - Edit module_tableau_materials.py.
Find the chapter beginning by the line:
Code:
("heraldic_armor_d", 0, "sample_heraldic_armor_d", 512, 512, 0, 0, 0, 0,
Code:
("troop_note_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
Code:
("heraldic_XXX", 0, "sample_heraldic_XXX_banner", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(store_sub, ":background_slot", ":banner_mesh", arms_meshes_begin), #banner_meshes_begin),
(troop_get_slot, ":background_color", "trp_banner_background_color_array", ":background_slot"),
(cur_tableau_set_background_color, ":background_color"),
(init_position, pos1),
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color"),
(init_position, pos1),
(position_set_x, pos1, 18),
(position_set_y, pos1, 170),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
(init_position, pos1),
(position_set_z, pos1, 30),
(cur_tableau_add_mesh, "tableau_mesh_heraldic_XXX_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
Some explanations :
in the lines " (position_set_x, pos1, 1,
and " (position_set_y, pos1, 170),
the value are the coordinates where the banner meshes will be inserted in the texture of heraldic_XXX.dds
You will undoubtly test some couples of values in order to determine the value which set perfectly with your mesh.
In the line " (cur_tableau_add_mesh, ":banner_mesh", pos1, 113, 0),
the value "113" is the size of the banner mesh. So you can decrease or increase it (in my meshes I use size between 40 and 90).
3c- Edit module_items.py.
Copy the line corresponding to the original armor.
Paste it at the end of your file, before the last ].
This line will look to something as:
Code:
["XXX", "Mail and Plate Armor", [("platemail",0)], itp_type_body_armor|itp_merchandise|itp_covers_legs ,0,
4500 , weight(25)|abundance(100)|head_armor(0)|body_armor(53)|leg_armor(16)|difficulty(8) ,imodbits_plate , ],
Rename the name XXX as you want, and the name of the meshe (in my example "platemail") by the name of the meshes you have added during the step 2d, i.e. heraldic_XXX in my text.
Just before the ] at the end of the line (not the last of the file!), add this:
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_XXX", ":agent_no", ":troop_no")])]
So your last line will look as this :
Code:
["new_XXX", "Heraldic Mail and Plate Armor", [("heraldic_XXX",0)], itp_type_body_armor|itp_merchandise|itp_covers_legs ,0,
4000 , weight(28)|abundance(100)|head_armor(0)|body_armor(52)|leg_armor(16)|difficulty(8) ,imodbits_plate ,
[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_heraldic_XXX", ":agent_no", ":troop_no")])]],
4- Run build_module.
You can now test your armor. I recommand to edit module_troop in order to give one of your new armor to the troop "Player", so you will begin the game with this armor, and can check if the banner is at the good location.
If not, you can save your game, and edit the "position_set_y", "postion_set_x" to modify the location of the banner in your armor, and the "cur_tableau_add_mesh, ":banner_mesh", pos1" in order to resize it.
Run at new Build_module, the change will be save compatible, so you just have to reload your savegame to check if the new location is better.
Good luck!
* countless if you can't count more than one.
** but I am burgundian, one of those who have sold Joan of Arc to the English, which prove that us, we are able to try to get better .
Link to the file I have used in my own mod:
http://www.mbrepository.com/file.php?id=2039
You can use it as a minimod.
Results example:
CLICK ON THE PICTURES TO ENLARGE
It is possible, and I think a little tutorial will be really useful for many.
Here is my own little work.
I have to thanks Rucchi who have released the source code of his excellent mod Turn in Inferno, his code has allowed me to learn to do these heraldic armors.
Examples :
Here's an example of the corrazina with heraldic colors (click to enlarge) (meshes and original texture by Narf of Picklestink, OSP from the Narf's Transitional Armour Pack ):
and here the same with the transitionnal armor (always Narf's work...)
Milanese from Narf's Plate Armour Pack:
Gothic (Narf always):
Mail and plate: (retextured by Rucchi)
Cuir bouilli:
Brigandine:
Banded Armor:
Light Mail And Plate (also retextured by Rucchi):
And a transitionnal armor of Archangel2k :
It is possible, and I think a little tutorial will be really useful for many.
Here is my own little work.
I have to thanks Rucchi who have released the source code of his excellent mod Turn in Inferno, his code has allowed me to learn to do these heraldic armors.
Examples :
Here's an example of the corrazina with heraldic colors (click to enlarge) (meshes and original texture by Narf of Picklestink, OSP from the Narf's Transitional Armour Pack ):
and here the same with the transitionnal armor (always Narf's work...)
Milanese from Narf's Plate Armour Pack:
Gothic (Narf always):
Mail and plate: (retextured by Rucchi)
Cuir bouilli:
Brigandine:
Banded Armor:
Light Mail And Plate (also retextured by Rucchi):
And a transitionnal armor of Archangel2k :