B Tutorial 3D Tutorial for heraldic armors, and mini-mod for testing some of them

Users who are viewing this thread

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
Code:
("tableau_mesh_heraldic_armor_d", 0, "tableau_mesh_heraldic_armor_d",  0, 0, 0, 0, 0, 0, 1, 1, 1),
After this line, add these two lines:
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,
Go at the end of the chapter, and just after, so before the line:
Code:
  ("troop_note_alpha_mask", 0, "mat_troop_portrait_mask", 1024, 1024, 0, 0, 400, 400,
paste this :
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:cool:,
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")])]],
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:
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 :
 
I have used the two for doing heraldic armors, the two are ok, but now I use mainly openBRF.
openBRF have the default to not always recognize the dds format, and crash when I delete too many meshes at the same times. But it has more functions and have better ergonomy in my taste.
 
Make sure to use the Right Click > Remove function with openBRF, it results in less crashes than using the Delete button.
 
I had same prob with old openBrf when I remove too many things or when I remove last mesh/tex/mat from list, but this one:
http://forums.taleworlds.com/index.php/topic,72279.0.html
crashed twice in three monts and it was not related with removing stuffs.
 
It works, awesome. Unfortunately, the bannered piece seems quite a bit too bright. :???: Would copying the brown-bluish bits in the native heraldic items help? How would it read those pieces as heraldic, then? :???:
 
Great tutorial. I don't really like working with scripts, I'm more interested in texturing but I'm going to give this a try. Love the look of Narf's transitional armors in heraldic form.  :smile:
 
FrisianDude said:
It works, awesome. Unfortunately, the bannered piece seems quite a bit too bright. :???: Would copying the brown-bluish bits in the native heraldic items help? How would it read those pieces as heraldic, then? :???:

Dunnow, honestly, I have only a little understanding of how the material files work.
What do you mean by brown-bluish bits?
But in my case, in order to have less bright bannered piece, I reduce the transparency of the texture.
If you want better example, perhaps want you to test the mod I have released (Border Princes 2522). It only in alpha, but I can give you the code, so you can test my work in game.
Don't hesitate to post your results, also.
 

Here is some of what I did. And I also found out why some things were too bright, I simply went about making it transparent the wrong way because the .dds file looked odd. :razz: I selected the bits, coloured them, and then made them transparent, but that looks like crap. :lol:

Yeah, they're one colour now, that probably has to do with the numbers which I don't entirely understand, but for simple garments this is pretty cool, too. Though, could you explain those position and size numbers a bit more? I could experiment, but it takes approximately five minutes each time to start a new game, so I have to fix that first. :<
 
The position 0 for x and y correspond to the center of the texture
Z corresponding to the size.
I will try to make a pack with module source of my mod, brf of the heraldic armors I have made, and textures.
So you will be able to have better indications.
Edit :
I have uploaded my module source here:
http://www.mbrepository.com/file.php?id=2039
 
Some explanation about the material I have uploaded here:
http://www.mbrepository.com/file.php?id=2039

You will have:
- a minimod, a native almost unmodified but with heraldic armors added in itemskind. So they were in the shops, but no units will use them.
- the source of the minimod, with the precious data of the "module_tableau_material.py" and less precious of "module_items.py" and "module_meshes.py"

This is not intended to be a playable mod, it's a modding resource, an help for my tutorial.
You are free to use my work BUT the meshes and original textures were not from me.
The original creators of the meshes and texture of these armors:
- mail armors, and mail and plate armors: meshes and textures from the mod "Britain at War", thanks to Rath0s and to Archangel2k
- corrazina, early transitionnal armor, milanese and gothic plate: meshes and textures from Narf of Picklestink armor's packs
- banded armor, cuir bouilli and brigandine from Warband, thanks to Armagan
- all the other were models from Native Mount&Blade, thanks to Armagan, and the editing of the texture were made by Rucchi in the mod "Fire Arrow, Turn in Inferno".

But you can freely use any of the tableau I have made for the heraldic armor, if you have the permission of the original creator.
 
Rucchi had shared his source, Narf had shared his beautiful armors, Armagan is the genius creator of Mount&Blade, and Archangel is unfortunately banned, so I think the last one who can give his permission, for the mail and plate armors created by Archangel2k for his mod "Britain at War" is Rath0s...
 
I saw some items are from vanilla, some from wb, some are osp things, and all items are great, but I was asking more about cor_heralda and transitional_herald from this brf I downloaded earlier today. I never saw this stuffs before and I do not know who are creators, but that would be just what I need right now. So who should I ask?

EDIT: I just readed your post above. I shall ask them.
 
Back
Top Bottom