Hi, guys.
Has anyone of you tried making armors just like heraldic ones but without the heraldry showing on it, just the background color specific for each banner?
Well I did and I found out some interesting things that I would like to share with you guys. The original idea to make these kinds of armors came from a friend of mine, JethroKirby, while working on his Warband Improved mod. He used the code lines from existing heraldic meshes and materials to make the colored armors.
I assume that you've already used or read Von Krieglitz's great tutorial for making heraldic items. This topic should be some kind of an extension to his work.
Only thing that needs to be adjusted to show bg color(and not the heraldry) is the position of the banner in tableau_materials.py. Well... almost.
Here's an example of heraldic armor tableau material code(module_tableau_materials.py):
The marked lines are banner position settings.
I figured out how the coordinates work... this is the pattern(a rough sketch):
The blue and the red are the x and y axis, when you set coordinates in module_tableau_materials.py you can do this following the pattern.
The y axis is always a positive number, x can go negative. In my "coat of plates" example I wanted the banner to show on the marked rectangle(alpha), so I set the coordinates to values T(21, 27) - this is the center spot of the banner, to be shown on my texture.
And this was the result(if you want heraldry to be shown):
If you want the bg color only, just delete the lines:
...or set the coordinates to some invalid values(x=300, y=300). And you will get this:
You will notice that the colored part is low detailed(very few curves, shaded parts)... it looks too fabricated. Well, after some thinking I managed to find a solution for this. Pay attention on the marked line and the underlined mesh:
The underlined mesh is a plain piece of cloth mesh that serves as a special layer for all(native) heraldic armors. It gives the heraldic area depth, shadows, curves. The problem is that this default mesh is low-res and to poor in detail. So, I decided to make some other meshes and corresponding textures/materials that would be more detailed and unique for every colored armor.
This is the result I had with the coat of plates after adding it's unique bg mesh:
Don't forget to change the bg mesh name in the marked line of tableau material. And one more thing in that specific line...
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color")
...you will want to change the marked value to 100. From what I've figured the "200" and "100" values define the size ratio of the bg mesh to the original heraldic mesh. So if you want to keep the ratio to 1:1, I recommend keeping both values the same.
Here are the settings for .brf files...
You need to make a new mesh, material and texture and add the corresponding lines to module_tableau_materials.py, module_meshes.py, module_items.py.
Example:
Here are some previews so you can easily notice the difference after adding unique bg meshes.
(BEFORE AND AFTER)
Some other(out of many) armors I've applied this system to:
You can apply this to shields as well, the procedure is almost identical...
This way you can make much more variety among heraldic armors and armors in general.
I hope this little tutorial helps some of you people. Good luck.
Has anyone of you tried making armors just like heraldic ones but without the heraldry showing on it, just the background color specific for each banner?
Well I did and I found out some interesting things that I would like to share with you guys. The original idea to make these kinds of armors came from a friend of mine, JethroKirby, while working on his Warband Improved mod. He used the code lines from existing heraldic meshes and materials to make the colored armors.
I assume that you've already used or read Von Krieglitz's great tutorial for making heraldic items. This topic should be some kind of an extension to his work.
Only thing that needs to be adjusted to show bg color(and not the heraldry) is the position of the banner in tableau_materials.py. Well... almost.
Here's an example of heraldic armor tableau material code(module_tableau_materials.py):
("heraldic_coat_of_plates_steel", 0, "heraldic_coat_of_plates_steel_sample", 1024, 1024, 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, 21),
(position_set_y, pos1, 27),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 70, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
[
(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, 21),
(position_set_y, pos1, 27),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 70, 0),
(init_position, pos1),
(position_set_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_heraldic_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
The marked lines are banner position settings.
I figured out how the coordinates work... this is the pattern(a rough sketch):
The blue and the red are the x and y axis, when you set coordinates in module_tableau_materials.py you can do this following the pattern.
The y axis is always a positive number, x can go negative. In my "coat of plates" example I wanted the banner to show on the marked rectangle(alpha), so I set the coordinates to values T(21, 27) - this is the center spot of the banner, to be shown on my texture.
And this was the result(if you want heraldry to be shown):
If you want the bg color only, just delete the lines:
(init_position, pos1),
(position_set_x, pos1, 21),
(position_set_y, pos1, 27),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 70, 0),
(position_set_x, pos1, 21),
(position_set_y, pos1, 27),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 70, 0),
You will notice that the colored part is low detailed(very few curves, shaded parts)... it looks too fabricated. Well, after some thinking I managed to find a solution for this. Pay attention on the marked line and the underlined mesh:
("colored_coat_of_plates_steel", 0, "colored_coat_of_plates_steel_sample", 1024, 1024, 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_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_colored_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
[
(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_z, pos1, 100),
(cur_tableau_add_mesh, "mesh_tableau_mesh_colored_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
The underlined mesh is a plain piece of cloth mesh that serves as a special layer for all(native) heraldic armors. It gives the heraldic area depth, shadows, curves. The problem is that this default mesh is low-res and to poor in detail. So, I decided to make some other meshes and corresponding textures/materials that would be more detailed and unique for every colored armor.
This is the result I had with the coat of plates after adding it's unique bg mesh:
Don't forget to change the bg mesh name in the marked line of tableau material. And one more thing in that specific line...
(cur_tableau_add_mesh_with_vertex_color, "mesh_heraldic_armor_bg", pos1, 200, 100, ":background_color")
...you will want to change the marked value to 100. From what I've figured the "200" and "100" values define the size ratio of the bg mesh to the original heraldic mesh. So if you want to keep the ratio to 1:1, I recommend keeping both values the same.
Here are the settings for .brf files...
material:
texture should be somewhat similar to specular(if you make the colored area too dark... your bg color will show up too dark in-game):
Texture should be generated in dxt1(1bit alpha) without mipmaps.
texture should be somewhat similar to specular(if you make the colored area too dark... your bg color will show up too dark in-game):
Texture should be generated in dxt1(1bit alpha) without mipmaps.
You need to make a new mesh, material and texture and add the corresponding lines to module_tableau_materials.py, module_meshes.py, module_items.py.
Example:
module_tableau_materials.py
("colored_coat_of_plates_steel", 0, "colored_coat_of_plates_steel_sample", 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_coat_of_plates_steel_bg", pos1, 100, 100, ":background_color"),
(init_position, pos1),
(position_set_z, pos1, 1),
(cur_tableau_add_mesh, "mesh_tableau_mesh_colored_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
module_meshes.py
("tableau_mesh_colored_coat_of_plates_steel", 0, "tableau_mesh_colored_coat_of_plates_steel", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_colored_coat_of_plates_steel_banner", 0, "tableau_mesh_colored_coat_of_plates_steel_banner", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("coat_of_plates_steel_bg", 0, "coat_of_plates_steel_bg", 0, 0, 0, 0, 0, 0, 1, 1, 1),
module_items.py
["colored_coat_of_plates_steel", "Colored Steel Coat Of Plates", [("colored_coat_of_plates_steel",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3828 , weight(25)|abundance(100)|head_armor(0)|body_armor(54)|leg_armor(16)|difficulty( ,imodbits_armor , [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_colored_coat_of_plates_steel", ":agent_no", ":troop_no")])]],
("colored_coat_of_plates_steel", 0, "colored_coat_of_plates_steel_sample", 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_coat_of_plates_steel_bg", pos1, 100, 100, ":background_color"),
(init_position, pos1),
(position_set_z, pos1, 1),
(cur_tableau_add_mesh, "mesh_tableau_mesh_colored_coat_of_plates_steel_banner", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
module_meshes.py
("tableau_mesh_colored_coat_of_plates_steel", 0, "tableau_mesh_colored_coat_of_plates_steel", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("tableau_mesh_colored_coat_of_plates_steel_banner", 0, "tableau_mesh_colored_coat_of_plates_steel_banner", 0, 0, 0, 0, 0, 0, 1, 1, 1),
("coat_of_plates_steel_bg", 0, "coat_of_plates_steel_bg", 0, 0, 0, 0, 0, 0, 1, 1, 1),
module_items.py
["colored_coat_of_plates_steel", "Colored Steel Coat Of Plates", [("colored_coat_of_plates_steel",0)], itp_merchandise| itp_type_body_armor |itp_covers_legs ,0, 3828 , weight(25)|abundance(100)|head_armor(0)|body_armor(54)|leg_armor(16)|difficulty( ,imodbits_armor , [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_colored_coat_of_plates_steel", ":agent_no", ":troop_no")])]],
Here are some previews so you can easily notice the difference after adding unique bg meshes.
(BEFORE AND AFTER)
Some other(out of many) armors I've applied this system to:
You can apply this to shields as well, the procedure is almost identical...
This way you can make much more variety among heraldic armors and armors in general.
I hope this little tutorial helps some of you people. Good luck.