Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Blubby said:
Hey everyone.

Does anyone know how to make town,castle and village names smaller?
I know that the icon size can be changed however the names are way
too big when the icons have been scaled down.

At the beginning of module_parties.py, there are these lines:
Code:
pf_town = pf_is_static|pf_always_visible|pf_show_faction|pf_label_large
pf_castle = pf_is_static|pf_always_visible|pf_show_faction|pf_label_medium
pf_village = pf_is_static|pf_always_visible|pf_hide_defenders|pf_label_small

If you replace the pf_label_small with medium/large, then that could work? I have no idea myself, I just saw this when browsing through the module system last night. This would make text the same size, however. You might be able to edit what pf_label_XXXX means in whatever file is linked to the pf prefix
 
So there is a multi-mesh armor, say,
pretty_armor
pretty_armor.1


Does anyone know a way to make (cur_item_add_mesh, "@{!}pretty_armor"), work without crashing the game (this operation is obviously allergic to any "attachments")?
...and without creating "detached" duplicates of all such armors and their parts...
 
I know about that OSP, but there is nothing useful for me there.
What I need is implementing a "shapeshifting" armor that can become any of pre-existing armors in the game, including quite a few multi-mesh armors.
However cur_item_add_mesh only works with single-mesh armors. When I try to use it to add a part of an "auto-assembling" (base, .1, .2, .3 etc.) multi-mesh armor the game just crashes.
I was wondering if maybe someone found a workaround for this... like maybe some material/mesh flag will somehow prevent it from happening or... I dunno.

UPD. Huh, it seems like "optional" [<lod_begin>], [<lod_end>] are mandatory in this case.
Turning (cur_item_add_mesh, "@{!}knight_armor_tevton_c_cloak"), into (cur_item_add_mesh, "@{!}knight_armor_tevton_c_cloak", 0, 4), seems to prevent crashes.  :???:

So thanks, that thread did help after all.
It reminded me about "optional" lods.  :grin:
_____________________________________________________________

P.S. Does this cur_item_add_mesh not work for boots?
3Zx5rxi.jpg
The mesh is successfully added and displayed on inventory icon but is invisible when actually worn.
(And, yes, it was tested on multiple meshes all of which work fine as part of pre-defined boots).
 
Leonion said:
P.S. Does this cur_item_add_mesh not work for boots?

According to Somebody's tutorial it "did not trigger for horses, gloves and boots".

Maybe the multimesh problem can be bypassed with renaming the parts, and building up the armors on load with this trigger. Then the components can be called one by one.
 
Hi
I added a soldier, everything is fine (The compilation is correct) except that it does not appear in the image of the troop tree.
Can you help me make it appear?
M&B Warband 1172:
The module is Warband enhanced, and I work with "warband-enhanced-module-source-1.1430.6v".

Code:
["hired_lancer","Hired Lancer","Hired Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
   def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_5|knows_power_strike_5|knows_ironflesh_5,mercenary_face_1, mercenary_face_2],

Code:
 upgrade2(troops,"mercenary_swordsman","hired_lancer","hired_blade")





Thank you.
 
lolitablue said:
Hi
I added a soldier, everything is fine (The compilation is correct) except that it does not appear in the image of the troop tree.
Can you help me make it appear?
M&B Warband 1172:
The module is Warband enhanced, and I work with "warband-enhanced-module-source-1.1430.6v".

Code:
["hired_lancer","Hired Lancer","Hired Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
   def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_5|knows_power_strike_5|knows_ironflesh_5,mercenary_face_1, mercenary_face_2],

Code:
 upgrade2(troops,"mercenary_swordsman","hired_lancer","hired_blade")



Thank you.

Did you add the new troop directly behind the other ones of the same faction? Same question for the upgrade path. The Singleplayer developer of our mod has had a similar problem, the placement of the new troop in module_troops seems to be important.
 
[Bcw]Btm_Earendil said:
lolitablue said:
Hi
I added a soldier, everything is fine (The compilation is correct) except that it does not appear in the image of the troop tree.
Can you help me make it appear?
M&B Warband 1172:
The module is Warband enhanced, and I work with "warband-enhanced-module-source-1.1430.6v".

Code:
["hired_lancer","Hired Lancer","Hired Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
   def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_5|knows_power_strike_5|knows_ironflesh_5,mercenary_face_1, mercenary_face_2],

Code:
 upgrade2(troops,"mercenary_swordsman","hired_lancer","hired_blade")



Thank you.

Did you add the new troop directly behind the other ones of the same faction? Same question for the upgrade path. The Singleplayer developer of our mod has had a similar problem, the placement of the new troop in module_troops seems to be important.

Thank to answer me...
I moved the new soldier's tuples at the end of the groups concerned in this case "mercenary", but it's the same problem.

Code:
 ["farmer","Farmer","Farmers",tf_guarantee_armor,no_scene,reserved,fac_commoners,
   [itm_cleaver,itm_knife,itm_pitch_fork,itm_sickle,itm_club,itm_stones,itm_leather_cap,itm_felt_hat,itm_felt_hat,itm_linen_tunic,itm_coarse_tunic,itm_nomad_boots,itm_wrapping_boots],
   def_attrib|level(4),wp(60),knows_common,man_face_middle_1, man_face_old_2],
  ["townsman","Townsman","Townsmen",tf_guarantee_boots|tf_guarantee_armor,no_scene,reserved,fac_commoners,
   [itm_cleaver,itm_knife,itm_club,itm_quarter_staff,itm_dagger,itm_stones,itm_leather_cap,itm_linen_tunic,itm_coarse_tunic,itm_leather_apron,itm_nomad_boots,itm_wrapping_boots],
   def_attrib|level(4),wp(60),knows_common,mercenary_face_1, mercenary_face_2],
  ["watchman","Watchman","Watchmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_hunting_crossbow,itm_light_crossbow,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots],
   def_attrib|level(9),wp(75),knows_common|knows_shield_1,mercenary_face_1, mercenary_face_2],
  ["caravan_guard","Caravan Guard","Caravan Guards",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_horse|tf_guarantee_shield,no_scene,0,fac_commoners,
   [itm_spear,itm_fighting_pick,itm_sword_medieval_a,itm_voulge,itm_tab_shield_round_b,itm_tab_shield_round_c,itm_leather_jerkin,itm_leather_vest,itm_hide_boots,itm_padded_coif,itm_nasal_helmet,itm_footman_helmet,itm_saddle_horse],
   def_attrib|level(14),wp(85),knows_common|knows_riding_2|knows_ironflesh_1|knows_shield_3,mercenary_face_1, mercenary_face_2],
  ["mercenary_swordsman","Mercenary Swordsman","Mercenary Swordsmen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_a,itm_sword_medieval_b,itm_sword_medieval_b_small,itm_tab_shield_heater_c,itm_mail_hauberk,itm_haubergeon,itm_leather_boots,itm_mail_chausses,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet, itm_helmet_with_neckguard],
   def_attrib|level(20),wp(100),knows_common|knows_riding_3|knows_ironflesh_3|knows_shield_3|knows_power_strike_3,mercenary_face_1, mercenary_face_2],
  ["hired_blade","Hired Blade","Hired Blades",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
   def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_5|knows_power_strike_5|knows_ironflesh_5,mercenary_face_1, mercenary_face_2],
 
  ["mercenary_crossbowman","Mercenary Crossbowman","Mercenary Crossbowmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_ranged,no_scene,reserved,fac_commoners,
   [itm_bolts,itm_spiked_club,itm_fighting_pick,itm_sword_medieval_a,itm_boar_spear,itm_crossbow,itm_tab_shield_pavise_a,itm_tab_shield_round_b,itm_padded_cloth,itm_leather_jerkin,itm_leather_cap,itm_padded_coif,itm_footman_helmet,itm_nomad_boots,itm_wrapping_boots],
   def_attrib|level(19),wp_one_handed (90) | wp_two_handed (90) | wp_polearm (90) | wp_archery (90) | wp_crossbow (130) | wp_throwing (90),knows_common|knows_athletics_5|knows_shield_1,mercenary_face_1, mercenary_face_2],
  ["mercenary_horseman","Mercenary Horseman","Mercenary Horsemen",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_mail_shirt,itm_haubergeon,itm_leather_boots,itm_norman_helmet,itm_mail_coif,itm_helmet_with_neckguard,itm_saddle_horse,itm_courser],
   def_attrib|level(20),wp(100),knows_common|knows_riding_4|knows_ironflesh_3|knows_shield_2|knows_power_strike_3,mercenary_face_1, mercenary_face_2],
  ["mercenary_cavalry","Mercenary Cavalry","Mercenary Cavalry",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_horse|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_heavy_lance,itm_bastard_sword_a,itm_sword_medieval_b,itm_tab_shield_heater_c,itm_cuir_bouilli,itm_banded_armor,itm_hide_boots,itm_kettle_hat,itm_mail_coif,itm_flat_topped_helmet,itm_helmet_with_neckguard,itm_warhorse,itm_hunter],
   def_attrib|level(25),wp(130),knows_common|knows_riding_5|knows_ironflesh_4|knows_shield_5|knows_power_strike_4,mercenary_face_1, mercenary_face_2],
   ["hired_lancer","Hired Lancer","Hired Lancers",tf_mounted|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_gloves|tf_guarantee_helmet|tf_guarantee_shield,no_scene,reserved,fac_commoners,
   [itm_bastard_sword_b,itm_sword_medieval_c,itm_tab_shield_heater_cav_a,itm_haubergeon,itm_mail_chausses,itm_iron_greaves,itm_plate_boots,itm_guard_helmet,itm_great_helmet,itm_bascinet, itm_leather_gloves],
   def_attrib|level(25),wp(130),knows_common|knows_riding_3|knows_athletics_5|knows_shield_5|knows_power_strike_5|knows_ironflesh_5,mercenary_face_1, mercenary_face_2],
 
   
  ["mercenaries_end","mercenaries_end","mercenaries_end",0,no_scene,reserved,fac_commoners,
   [],
 
 
lolitablue said:
I moved the new soldier's tuples at the end of the groups concerned in this case "mercenary", but it's the same problem.

did you test the troop? As in, hire the swordsman and see if he can be upgraded to both lancer and blade.

if that is working then your problem is with the presentation of the troops, not the troop itself. Which means you need to find out how the troop tree is draw to figure out if you need to add something in there. Depends on the code, as some OSP are hardcoded (you need to add each troop by code), while others are automatic (it auto generates the tree).
 
kalarhan said:
lolitablue said:
I moved the new soldier's tuples at the end of the groups concerned in this case "mercenary", but it's the same problem.

did you test the troop? As in, hire the swordsman and see if he can be upgraded to both lancer and blade.

Yes, I can upgrade him to Hired Blade or Hired Lancer in the game...

lolitablue said:
if that is working then your problem is with the presentation of the troops, not the troop itself. Which means you need to find out how the troop tree is draw to figure out if you need to add something in there. Depends on the code, as some OSP are hardcoded (you need to add each troop by code), while others are automatic (it auto generates the tree).

I'm afraid this is my problem, "hardcoded".
Thank you.

 
[Bcw]Btm_Earendil said:
This here might help you with your troop tree presentation:

https://forums.taleworlds.com/index.php/topic,340676.0.html

Ok, I looked at the link and here is what I'm trying to do:
Is that enough?

Code:
    (else_try), # mercenaries
          (eq, ":faction_no", "fac_kingdoms_end"),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 0, "trp_farmer", 100, 400),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 1, "trp_watchman", 250, 400),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 2, "trp_caravan_guard", 400, 400),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 3, "trp_mercenary_crossbowman", 400, 200),
		  (call_script, "script_prsnt_upgrade_tree_troop_info", 4, "trp_mercenary_horseman", 550, 400),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 5, "trp_mercenary_swordsman", 550, 200),
          (call_script, "script_prsnt_upgrade_tree_troop_info", 6, "trp_hired_blade", 700, 200),
#(call_script, "script_prsnt_upgrade_tree_troop_info", 7, "trp_hired_lancer", 700, 200),#add lancer troop tree
	  (call_script, "script_prsnt_upgrade_tree_troop_info", 8, "trp_mercenary_cavalry", 700, 400),
		  
		  
		 
          (assign, "$temp_3", 8),
          ## use slot-no above instead of troop-id
          (call_script, "script_prsnt_lines_to_link_two_troops", 0, 1),
          (call_script, "script_prsnt_lines_to_link_two_troops", 1, 2),
          (call_script, "script_prsnt_lines_to_link_two_troops", 1, 3),
          (call_script, "script_prsnt_lines_to_link_two_troops", 2, 4),
          (call_script, "script_prsnt_lines_to_link_two_troops", 2, 5),
		  (call_script, "script_prsnt_lines_to_link_two_troops", 5, 6),
		  (call_script, "script_prsnt_lines_to_link_two_troops", 4, 7),
		 

I just add this line:
Code:
 #(call_script, "script_prsnt_upgrade_tree_troop_info", 7, "trp_hired_lancer", 700, 200),#add lancer troop tree 

between the line 6 and 8...
 
[Bcw]Btm_Earendil said:
How about you just test it and report if it works or not? But I think it looks fine, without the # of course ^^
Look at my first test:


.. It is too high, poorly positioned, I will do another test, it is very interesting ...

Now he is well positioned ... but his level is 4 instead of 25 and he has no boots...

I start a new game and all is right!




Is there a way to change that without starting a new game?
Thank you
 
lolitablue said:
Is there a way to change that without starting a new game?

new entity in the middle of the list (like your new troop) requires a new game.

if you want to update a old entity (savegame compatibility) then some operations are available/some data is not store in the save so its read from the .txt files

for a troop level, as a example, you could give it XP until it reaches a certain level.
 
lolitablue said:
I forgot where I saw it but I know it's possible to add some soldier at the character's party at the begining of the game.

Code:
party_add_members                      = 1610	# (party_add_members,<party_id>,<troop_id>,<number>), 
party_force_add_members                = 1613	# (party_force_add_members,<party_id>,<troop_id>,<number>),

game_start script or a similar place is fine
 
Status
Not open for further replies.
Back
Top Bottom