Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
KnightV said:
Why in game all infantries marked as "Archers" division?

check your troops guarantee_XXX flags
Code:
tf_guarantee_horse            = 0x01000000
tf_guarantee_ranged           = 0x04000000

you can also use a operation to control the division (infantry, archer, cav, ...) of troops (thus using a custom configuration)
 
can anyone tell me how to remove lord titles from native, I know I should be editing something in module_scripts but i'm unsure where exactly. I've got "str_faction_title_male" from somewhere but am having trouble finding it.

just to be clear I'm just trying to compile native with the MS but removing all the annoying noyens and other prefixes.

thanks for any help
 
twinsens said:
can anyone tell me how to remove lord titles from native, I know I should be editing something in module_scripts but i'm unsure where exactly. I've got "str_faction_title_male" from somewhere but am having trouble finding it.

just to be clear I'm just trying to compile native with the MS but removing all the annoying noyens and other prefixes.

thanks for any help

Search this code in module_strings.py

Code:
("faction_title_male_player", "Lord {s0}"),
  ("faction_title_male_1", "Count {s0}"),
  ("faction_title_male_2", "Boyar {s0}"),
  ("faction_title_male_3", "{s0} Noyan"),
  ("faction_title_male_4", "Jarl {s0}"),
  ("faction_title_male_5", "Count {s0}"),
  ("faction_title_male_6", "Emir {s0}"),

  ("faction_title_female_player", "Lady {s0}"),
  ("faction_title_female_1", "Countess {s0}"),
  ("faction_title_female_2", "Boyarina {s0}"),
  ("faction_title_female_3", "{s0} Hatun"),
  ("faction_title_female_4", "Grevinne {s0}"),
  ("faction_title_female_5", "Countess {s0}"),
  ("faction_title_female_6", "Sayeda {s0}"),

I think you also need to change the name of the lords in module_troops.



By the way,  anyone knows how to add new titles for new factions? 
 
Hernanxd16 said:
By the way,  anyone knows how to add new titles for new factions?

you already answered that  :mrgreen:, but you can also check the OSP section for dynamic titles code. VC, as a example, has different titles for landless, town/castle owner and king.

twinsens said:
can anyone tell me how to remove lord titles from native
base name comes from module_troops.py. Singular and plural names are used here for heroes (unique troops like nobles).
-> note that some modules may use the names from language folder instead

when a troop switches factions (recruited by the player, faction destroyed, etc) it calls the script and uses those strings. The number "string_name_NUMBER" references the faction. Include more for your new factions and check the script logic.

a suggestion: instead of removing titles you can invert them. Instead of "Lord X", you can have "X (Lord)", "X, Lord", etc. Like "John the Emir", "John (Emir)", etc.
 
kalarhan said:
you already answered that  :mrgreen:, but you can also check the OSP section for dynamic titles code. VC, as a example, has different titles for landless, town/castle owner and king.

I only need to add the string? I was thinking I need to change a script or something xD
 
kalarhan said:
Silverc said:
The main problem I am having is how to make Item kind for each of the items.

copy the code of a item from your mod that matches it. Is it a long sword? A scimitar? A one-handed axe? A heavy chest armor? A heavy helmet? And so on. There are no secrets, just a bunch of flags that define the type, the list of meshes (3d model), the cost (arbitrary value) and the ID (unique).

1) Cool new 3d model for this one-handed sword
2) Copy the code from a one-handed sword on your game
3) Change the mesh to (1)
4) Adjust the values to whatever seems appropriate (damage, speed, etc)
5) Use a unique ID

use module_items.py to see those codes. You can also clone stuff using Morgh's.
ok how do I add the meshes I got everything loading now it can't find the mesh
 
Hi;
I'm making a custom character presentation. Codes are these:sad:%40 done)
Code:
("choose_player_infos", 0, mesh_load_window,
   [
     (ti_on_presentation_load,
      [
        (set_fixed_point_multiplier, 1000),
        (presentation_set_duration, 9999999990),

        (assign, "$choose_nation", -1),
        (assign, "$prsnt_player_class", -1),
        (assign, "$player_job_low", -1),
        (assign, "$player_job_med", -1),
        (assign, "$okay_lets_out", -1),
#        (assign, "$", -1),

        (create_combo_label_overlay, "$choose_nation"),
##      (position_set_x, pos1, 800),
##      (position_set_y, pos1, 800),
##      (overlay_set_size, "$g_presentation_obj_custom_battle_designer_4", pos1),
      (position_set_x, pos1, 130),
      (position_set_y, pos1, 600),
      (overlay_set_position, "$choose_nation", pos1),
        (position_set_x, pos1, 800),#new codes
        (position_set_y, pos1, 800),#new codes
        (overlay_set_size, "$choose_nation", pos1),#new codes
      (try_begin),
        (is_trial_version),
        (str_store_faction_name, s0, npc_kingdoms_begin),
        (overlay_add_item, "$choose_nation", s0),
        (store_add, ":cur_faction", npc_kingdoms_begin, 1),
        (str_store_faction_name, s0, ":cur_faction"),
        (overlay_add_item, "$choose_nation", s0),
      (else_try),
        (try_for_range, ":cur_faction", "fac_calradia", "fac_robber_knights"),
          (str_store_faction_name, s0, ":cur_faction"),
          (overlay_add_item, "$choose_nation", s0),
        (assign, "$prsnt_selected_faction", "fac_calradia"),
        (str_store_string, s1, "str_prsnt_string_faction_calradia"),
        (try_end),
        (str_store_faction_name, s0, "fac_outlaws"),
        (overlay_add_item, "$choose_nation", s0),
      (try_end),
      (try_begin),
        (eq, "$prnst_players_nation", "fac_outlaws"),
        (store_sub, ":overlay_value", npc_kingdoms_end, npc_kingdoms_begin),
        (overlay_set_val, "$choose_nation", ":overlay_value"),
      (else_try),
        (store_sub, ":team_1_faction", "$prnst_players_nation", npc_kingdoms_begin),
        (overlay_set_val, "$choose_nation", ":team_1_faction"),
      (try_end),



        (create_combo_label_overlay, "$prsnt_player_class"),
##      (position_set_x, pos1, 800),
##      (position_set_y, pos1, 800),
##      (overlay_set_size, "$g_presentation_obj_custom_battle_designer_4", pos1),
      (position_set_x, pos1, 130),
      (position_set_y, pos1, 500),
      (overlay_set_position, "$prsnt_player_class", pos1),
        (position_set_x, pos1, 800),#new codes
        (position_set_y, pos1, 800),#new codes
        (overlay_set_size, "$prsnt_player_class", pos1),#new codes
        (overlay_add_item, "$prsnt_player_class", "str_player_calradian_class_low"),
        (overlay_add_item, "$prsnt_player_class", "str_player_calradian_class_medium"),
        (overlay_add_item, "$prsnt_player_class", "str_player_calradian_class_high"),
        (overlay_set_val, "$prsnt_player_class", 0),
        (str_store_string, s2, "str_prsnt_string_medium_wealth"),

         (try_begin),
         (troop_get_slot, ":class", "trp_player", player_class),
        (try_begin),
        (eq, ":class", 0),
         (create_combo_button_overlay, "$player_job_low"),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, "$player_job_low", pos1),
        (position_set_x, pos1, 130),
        (position_set_y, pos1, 400),
        (overlay_set_position, "$player_job_low", pos1),
        (try_for_range, ":i_game_type", 0, num_player_jobs_low),
          (store_add, ":string_index", ":i_game_type", player_jobs_low_begin),
          (str_store_string, s0, ":string_index"),
          (overlay_add_item, "$player_job_low", s0),
        (assign, "$prsnt_selected_job", player_job_blacksmith_calradian),
        (try_end),
#        (overlay_set_val, "$player_job_low", "$g_multiplayer_game_type"),
      (else_try),
        (eq, ":class", 1),
         (create_combo_button_overlay, "$player_job_med"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 500),
        (overlay_set_size, "$player_job_med", pos1),
        (position_set_x, pos1, 130),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$player_job_med", pos1),
        (try_for_range, ":i_game_type", 0, num_player_jobs_medium),
          (store_add, ":string_index", ":i_game_type", player_jobs_med_begin),
          (str_store_string, s0, ":string_index"),
          (overlay_add_item, "$player_job_med", s0),
        (assign, "$prsnt_selected_job", player_job_head_hunter_calradian),
        (str_store_string, s3, "str_prsnt_string_head_hunter"),
        (try_end),
#        (overlay_set_val, "$player_job_med", "$g_multiplayer_game_type"),
      (try_end),
        (try_end),

        (create_text_overlay, "$character_information_kortlcha", "@Information Box:^^{s1}^^{s2}^^{s3}^^Good luck!", tf_scrollable),
      (position_set_x, pos1, 650),
      (position_set_y, pos1, 650),
      (overlay_set_size, "$character_information_kortlcha", pos1),
      (position_set_x, pos1, 600),
      (position_set_y, pos1, 600),
      (overlay_set_position, "$character_information_kortlcha", pos1),
      (position_set_x, pos1, 460),
      (position_set_y, pos1, 300),
      (overlay_set_area_size, "$character_information_kortlcha", pos1),

        (create_in_game_button_overlay, "$okay_lets_out", "str_done", 0),
#      (overlay_set_color, "$okay_lets_out", 0xFFFFFF),
      (position_set_x, pos1, 800),
      (position_set_y, pos1, 50),
      (overlay_set_position, "$okay_lets_out", pos1),


#        (create_slider_overlay, "$prsnt_player_class", 0, 100),
#      (overlay_set_val, "$prsnt_player_class", "$g_presentation_obj_custom_battle_designer_8_last_value"),
#      (position_set_x, pos1, 1000),
#      (position_set_y, pos1, 500),
#      (overlay_set_size, "$prsnt_player_class", pos1),
#      (position_set_x, pos1, 150),
#      (position_set_y, pos1, 500),
#      (overlay_set_position, "$prsnt_player_class", pos1),

        ]),
      (ti_on_presentation_event_state_change,
     [
       (store_trigger_param_1, ":object"),
       (store_trigger_param_2, ":value"),
       (try_begin),
       (eq, ":object", "$okay_lets_out"),
       (presentation_set_duration, 0),
#       (jump_to_menu, "mnu_access_to_map_menu"),
#       (else_try),
#       (eq, ":object", "$player_job_med"),
#       (try_begin),
#       (
       (try_end),
       ]),
     ]),
But overlay doesn't shown and when I change an overlay's position and size, nothing is changing. What shoul I do?
 
I'm trying to change it in codes at ti_on_load. I don't want to change positions after prsnt runs. I'm gonna refresh my module file. Maybe the problem's cause is that. But do you have any idea for not appearing overlays?
 
Kortlcha said:
But do you have any idea for not appearing overlays?

clean up your code
apply proper indentation
show us a screenshot of your presentation. Mark things working and things not working on the screenshot
show the part of the code that is not working

btw, why are you using (is_trial_version)?
 
So, I decided to follow the old tutorial of adding recruit option from castles, however this last piece of code:

(
    "recruit_nobles",0,
    "{s18}",
    "none",
    [(store_faction_of_party, ":cur_faction", "$current_town"),
    (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 40),#40 denars per man
    (assign, ":party_capacity", ":free_capacity"),
    (val_min, ":party_capacity", ":gold_capacity"),
    (try_begin),
      (gt, ":party_capacity", 0),
      (val_min, ":volunteer_amount", ":party_capacity"),
    (try_end),
    (assign, reg5, ":volunteer_amount"),
    (assign, reg7, 0),
    (try_begin),
      (gt, ":volunteer_amount", ":gold_capacity"),
      (assign, reg7, 1), #not enough money
    (try_end),
    (try_begin),
      (eq, ":volunteer_amount", 0),
      (str_store_string, s18, "@No one here seems to be willing to join your party."),
    (else_try),
      (store_mul, reg6, ":volunteer_amount", 40),#40 denars per man
      (str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
      (try_begin),
        (eq, reg5, 1),
        (str_store_string, s18, "@One {s3} volunteers to follow you."),
      (else_try),
        (str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
      (try_end),
      (set_background_mesh, "mesh_pic_recruits"),
    (try_end),
    ],
    [
      ("continue_not_enough_gold",
      [
        (eq, reg7, 1),
      ],
      "I don't have enough money...",
      [
  (jump_to_menu, "mnu_town"),
      ]),
     
      ("continue",
      [
        (eq, reg7, 0),
        (eq, reg5, 0),
      ], #noone willing to join                 
      "Continue...",
      [
        (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
  (jump_to_menu, "mnu_town"),
      ]),
     
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_town_recruit_nobles_recruit"),
                       
  (jump_to_menu, "mnu_town"),
      ]),
     
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
  (jump_to_menu, "mnu_town"),
      ]),
    ],
  ),

Gave me this error:

Checking module syntax... FAILED.
MODULE `game_menus` ERROR:
failed to parse element #265
  cannot convert value [(541, '$current_town', 0, 2), (31, '$sneaked_into_town', 0), (2319, 1), 4, (2204, ':center_faction', '$current_town'), (542, ':center_faction', 4, 6), (542, ':center_faction', 5, '$current_town'), (2320, 1, 'str__join_the_feast'), 3] to integer


COMPILATION FAILED,

So... anyone know what went wrong? You might need to spell it out (sorry I'm a slow learner).
 
After tonns of changes i get interesting bug.....kingdom of sarranids has not troops...castles and towns, lords parties are empty and parties of deserters has in army only my character :wink: firstly i saw it after i moved all sarranid's fiefs in another place(i have increased calradia map size ....please help anyone, if yoy don't its solution - simply give me advise what should i do now or say what codes i need to check to get solution of my problem, thanks in advance
 
The Easy nine said:
Checking module syntax... FAILED.
MODULE `game_menus` ERROR:
failed to parse element #265
syntax error, not related to the code posted. You made a mistake somewhere, so go back to your backup (working copy), and start over. Learn how tuples work on Python and how MBScript syntax is suppose to be used on each file (see comments on the start of a module_XXX.py file) to understand the basic structure.

baby steps. Do small changes, compile, test, do some other changes, compile, test....
 
Hi,
When I add these codes:sad:scripts)
Code:
("refresh_butcher_inventory", [
      (store_script_param, ":party", 1),
      (party_get_slot, ":merchant", ":party", slot_town_butcher),
(party_get_slot, ":sheep", ":party", slot_region_sheep),
(party_get_slot, ":cow", ":party", slot_region_cattle),
(party_get_slot, ":cattle", ":party", slot_region_cow),
      (troop_clear_inventory, ":merchant"),
      (str_store_party_name, s10, ":party"),
      (str_store_troop_name, s11, ":merchant"),
      (display_message, "@refresh_butcher_inventory script's first block completed.{s10} in {s11}."),
(try_begin),
#(gt, ":sheep", 0),
(store_div, ":total_dried_meat", ":sheep", 1000),
(val_mul, ":total_dried_meat", 4),
(val_div, ":total_dried_meat", 3),
(troop_add_items, ":merchant", "itm_dried_meat", ":total_dried_meat"),
(troop_add_items, ":merchant", "itm_dried_meat_5", ":total_dried_meat"),
(store_troop_gold, ":g", ":merchant"),
      (display_message, "@2nd block completed."),
(try_begin),
      (display_message, "@3rd block completed."),
(lt, ":g", 500),
(troop_add_gold, ":merchant", 500),
(try_end),
(try_end),
]),
The money is being added but items not. I want to add dired meats to trader's inventory. What shuold I do?
 
But:
Code:
("butcher_initiation", [
      (try_for_parties, ":p"),
       (party_slot_eq, ":p", slot_party_type, spt_town),
       (party_get_current_terrain, ":t", ":p"),
       (try_begin),
       (eq, ":t", rt_steppe),
       (store_random_in_range, ":cow", 25000, 60000),
       (store_random_in_range, ":sheep", 25000, 60000),
       (store_random_in_range, ":cattle", 25000, 60000),
       (else_try),
       (eq, ":t", rt_plain),
       (store_random_in_range, ":cow", 15000, 25000),
       (store_random_in_range, ":sheep", 15000, 35000),
       (store_random_in_range, ":cattle", 15000, 30000),
       (else_try),
       (eq, ":t", rt_snow),
       (store_random_in_range, ":cow", 5000, 10000),
       (store_random_in_range, ":sheep", 22000, 45000),
       (store_random_in_range, ":cattle", 14000, 32000),
       (else_try),
       (eq, ":t", rt_desert),
       (store_random_in_range, ":cow", 9084, 12308),
       (store_random_in_range, ":sheep", 5007, 8000),
       (store_random_in_range, ":cattle", 11000, 15000),
       (else_try),
       (eq, ":t", rt_mountain_forest),
       (store_random_in_range, ":cow", 23000, 4000),
       (store_random_in_range, ":sheep", 20000, 25000),
       (store_random_in_range, ":cattle", 15000, 20000),
       (else_try),
       (eq, ":t", rt_steppe_forest),
       (store_random_in_range, ":cow", 30000, 40000),
       (store_random_in_range, ":sheep", 2000, 40000),
       (store_random_in_range, ":cattle", 10000, 40000),
       (else_try),
       (eq, ":t", rt_forest),
       (store_random_in_range, ":cow", 10000, 20000),
       (store_random_in_range, ":sheep", 10000, 20000),
       (store_random_in_range, ":cattle", 10000, 2000),
       (else_try),
       (eq, ":t", rt_snow_forest),
       (store_random_in_range, ":cow", 10000, 20000),
       (store_random_in_range, ":sheep", 20000, 40000),
       (store_random_in_range, ":cattle", 15000, 27500),
       (else_try),
       (eq, ":t", rt_desert_forest),
       (store_random_in_range, ":cow", 5000, 10000),
       (store_random_in_range, ":sheep", 15000, 25000),
       (store_random_in_range, ":cattle", 20000, 35000),
       (try_end),
       (party_set_slot, ":p", slot_region_cow, ":cow"),
       (party_set_slot, ":p", slot_region_cattle, ":cattle"),
       (party_set_slot, ":p", slot_region_sheep, ":sheep"),
       (assign, reg30, ":sheep"),
       (display_message, "@{reg30} sheeps set."),
       (try_end),
      ]),
Codes that setting slots are these. When I look vanilla's codes, en example, seeing ":100_mul_div_10" like codes. Having least slots in cities are at least have 1000+ number. 1000:1000 = 1, x4= 4, :3 = 1.xxxx. At least, it must be 1. But nothing is being added. What is the problem here?
 
Kortlcha said:
Having least slots in cities are at least have 1000+ number

did you check it? I don`t see a logging message displaying the quantity.

Don't assume something works. Check it.

Then move to the next problem, until the cause is found and the problem is fixed.
 
Status
Not open for further replies.
Back
Top Bottom