Pics displayed in Factions screen

Users who are viewing this thread

Keedo420

Knight at Arms
OK, I was having an error in my mod where when the player clicked on the 8th faction's name, it crashed the game because it was looking for a pic_onager to display for the faction's pic. I found the source of the error in module_meshes, as shown here:
  ("pic_arms_swadian", 0, "pic_arms_swadian", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("pic_arms_vaegir", 0, "pic_arms_vaegir", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("pic_arms_khergit", 0, "pic_arms_khergit", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("pic_arms_nord", 0, "pic_arms_nord", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("pic_arms_rhodok", 0, "pic_arms_rhodok", 0, 0, 0, 0, 0, 0, 1, 1, 1),

#formation kit start-----------------------------------------------
  ("medium_button", render_order_plus_1, "medium_button", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("medium_button_down", render_order_plus_1, "medium_button_down", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("pic_onager", 0, "pic_onager", 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5),
  ("pic_mangonel", 0, "pic_mangonel", 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5),
  ("pic_trebuchet", 0, "pic_trebuchet", 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5),
#formation kit end-----------------------------------------------
Now, it is clear to me that the first 5 pics are used for the first 5 kingdoms though I cannot find references to those pics anywhere in the module system files. Empire Of The Sands is the eight kingdom in my mod and was using pic_onager, which is the third pic after the 5th one in the code above. If the player clicks on Kingdom Of Morte and Megumi Dynasty (the 6th and 7th kingdoms) in the factions screen, they'll see that those are using the medium_button and medium_button_down pics. So anyway, I removed pic_onager, pic_mangonel, and pic_trebuchet (which I can find no references to anywhere else in the module system files and were never used in my mod...the medium button pics are, however, referenced in module_presentations but not in relation to the factions), and now Empire Of The Sands displays no pic at all. But at least it doesn't crash anymore. I cannot figure out where in the module system the game decides which pic to display for each kingdom in the factions screen though. I have searched through module_game_menus, module_scripts, module_factions, and module_presentations, and can find no references at all to any of those first 5 pics. So I guess that is my question here. How exactly do I change what pic is displayed in the factions screen for each kingdom?
 
I'm not sure if this will help you, but I found this in my "pilgrimage" of the module_ files.

Code:
*:\Documents and Settings\*********\Desktop\M&B Mod Kraam\WWI MS\module_tableau_materials.py (4 hits)
	Line 567:   ("faction_note_mesh_for_menu", 0, "pic_arms_swadian", 1024, 512, 0, 0, 450, 225,
	Line 574:        (store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
	Line 584:   ("faction_note_mesh", 0, "pic_arms_swadian", 1024, 512, 0, 0, 500, 250,
	Line 591:        (store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
 
Interesting. Thanks for pointing that out. I never thought to look in module_tableau_materials, but that looks like it might be it. From looking at the code, it seems that instead of assigning a pic to each kingdom, it starts with pic_swadian for the first kingdom, then moves on to the next kingdom and moves down the list of pics in module_meshes. So by adding new kingdoms, it is moving to whatever entry is after the 5th pic when it gets to the 6th kingdom, and so on.
Code:
  ("faction_note_mesh", 0, "pic_arms_swadian", 1024, 512, 0, 0, 500, 250,
   [
     (store_script_param, ":faction_no", 1),
     (cur_tableau_set_background_color, 0xFFFFFFFF),
     (set_fixed_point_multiplier, 100),
     (try_begin),
       (is_between, ":faction_no", "fac_kingdom_1", kingdoms_end), #Excluding player kingdom
       (store_add, ":banner_mesh", "mesh_pic_arms_swadian", ":faction_no"),
       (val_sub, ":banner_mesh", "fac_kingdom_1"),
       (init_position, pos1),
       (position_set_y, pos1, -5),
       (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
       (cur_tableau_set_camera_parameters, 0, 100, 50, 0, 100000),
     (try_end),
     ]),
So I guess to fix this I could simply make duplicates of some of the first 5 pics. I'll probably have to rename them, but by inserting the duplicates after the 5th pic, it should prevent the code from assigning the "medium_button" entry to one of the kingdoms.

EDIT: Yep, that worked. I just created three new mesh entries that used the same pic resources as the first three, and gave the new entries different mesh IDs. Now kingdoms 6, 7, and 8 use the same pics as kingdoms 1, 2, and 3 respectively. Eventually I'll have to make unique pics for them, but this works for now. Thanks again.
 
Back
Top Bottom