Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
KnightV said:
Does anyone know why there isn't musket animation while in battle? troops use pistol animation but i have musket one

check your BRF for animations to see them, then if you are using the correct flags on module_items.py (see header_items.py)
 
kalarhan said:
KnightV said:
Does anyone know why there isn't musket animation while in battle? troops use pistol animation but i have musket one

check your BRF for animations to see them, then if you are using the correct flags on module_items.py (see header_items.py)
Another question - i created 12 castle scenes for different kingdoms. The prison and the interior scenes took from native castle scene. Then i renamed scenes, copied it 12 times and renamed . And than i used the castle native code, pasted it 12 times and renamed. When i enter the lords halls - i apper on the courtyard, when enter the exterior - in the lord's halls. Where i was mistaken?

("castle_49","Rebel_Tanguts_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(44.44, 127.4:cool:,[],260),
("castle_50","Rebel_Orlds_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(54.674896, 139.420120),[],260),
("castle_51","Rebel_Turks_Camp" ,icon_castle_a |pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-32, 159),[],260),
("castle_52","Rebel_Imperials_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-54.174896, 150),[],260),
("castle_53","Rebel_Republicans_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-139, 69),[],260),
("castle_54","Rebel_Desert_Army_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(186.674896, -20.420120),[],260),
("castle_55","Royal_Knights_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-17.674896, -50.420120),[],260),
("castle_56","East_Turks_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-75.674896, -9),[],260),
("castle_57","Green_Turks_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-38.5, 22.:cool:,[],260),
("castle_58","Red_Turks_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(150, 73),[],260),
("castle_59","Valkirias_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(26.1, -53.5),[],260),
("castle_60","Northman_Camp" ,icon_castle_a|pf_castle, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-47, 94),[],260),

("castle_49_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_49_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_49_seneschal"]),
("castle_49_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_50_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_50_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_50_seneschal"]),
("castle_50_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_51_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_51_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_51_seneschal"]),
("castle_51_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_52_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_52_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_52_seneschal"]),
("castle_52_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_53_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_53_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_53_seneschal"]),
("castle_53_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_54_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_54_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_54_seneschal"]),
("castle_54_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_55_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_55_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_55_seneschal"]),
("castle_55_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_56_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_56_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_56_seneschal"]),
("castle_56_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_57_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_57_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_57_seneschal"]),
("castle_57_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_58_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_58ed_interior", sf_indoors, "arabian_interior_keep_b", "bo_arabian_interior_keep_b", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_58_seneschal"]),
("castle_58ed_prison", sf_indoors, "interior_prison_o", "bo_interior_prison_o", (-100, -100), (100, 100), -100, "0",[], []),
("castle_59_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_59_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_59_seneschal"]),
("castle_59_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
("castle_60_exterior", sf_generate|sf_auto_entry_points, "none", "none", (0, 0), (500,500), -5.5, "0x0000000035a0056300084e2300003f7a0000138800000b13",[], [], "forest_wall"),
("castle_60_interior", sf_indoors, "dungeon_entry_a", "bo_dungeon_entry_a", (-100, -100), (100, 100), -100, "0",["exit"], ["castle_60_seneschal"]),
("castle_60_prison", sf_indoors, "interior_prison_a", "bo_interior_prison_a", (-100, -100), (100, 100), -100, "0",[], []),
 
I don't think this is your main problem but you shouldn't be using sf_auto_entry_points for castle exterior scenes.
 
KnightV said:
I don't understand what you mean

how do you setup the game so it knows that scene XYZ belongs to center X as a Y (example: scene 400 is city 50 as tavern) ?

now check if your slots are using the correct IDs, if you have a bug with the process that puts them there, or if you made a error on your list (like you forgot a scene in the list), etc. You can even use a savegame editor for a quick look/check.

a code example from Native that makes the setup on a new game
Code:
# Castles
      (try_for_range, ":castle_no", castles_begin, castles_end),
        (store_sub, ":offset", ":castle_no", castles_begin),
        (val_mul, ":offset", 3),

#        (store_add, ":senechal_troop_no", "trp_castle_1_seneschal", ":offset"),
#        (party_set_slot,":castle_no", slot_town_seneschal, ":senechal_troop_no"),
        (store_add, ":exterior_scene_no", "scn_castle_1_exterior", ":offset"),
        (party_set_slot,":castle_no", slot_castle_exterior, ":exterior_scene_no"),
        (store_add, ":interior_scene_no", "scn_castle_1_interior", ":offset"),
        (party_set_slot,":castle_no", slot_town_castle, ":interior_scene_no"),
        (store_add, ":interior_scene_no", "scn_castle_1_prison", ":offset"),
        (party_set_slot,":castle_no", slot_town_prison, ":interior_scene_no"),
        
        (party_set_slot,":castle_no", slot_town_reinforcement_party_template, "pt_center_reinforcements"),
        (party_set_slot,":castle_no", slot_party_type, spt_castle),
        (party_set_slot,":castle_no", slot_center_is_besieged_by, -1),
      (try_end),
 
Does anyone know a way to increase the chance of horses being crippled/killed when they "die" while ridden by the player in battle?

I haven't been able to find it yet, so I'm beginning to suspect it may be hardcoded.
 
That makes sense, thanks for the suggestion. I haven’t tried modding something like this before, by any chance does anyone know of an open source mod that does something with horse death? Assuming not, but asking just in case.

If I wanted to have, say, 100% horse death rate, any problems with attaching something to the dehorsing and fall damage part of module_missions_templates.py, to check if the player and remove horse from inventory if so?

Also, anyone know how to check if a horse is the player’s original mount? If they switched mid battle, I wouldn’t want it killing off the original.
 
Tingyun said:
That makes sense, thanks for the suggestion. I haven’t tried modding something like this before, by any chance does anyone know of an open source mod that does something with horse death? Assuming not, but asking just in case.

a horse is a agent (just like the player or any NPC in the mission). When a NPC is using a horse they are connected and you can check rider and horse ID with operations.

the horse agent is a instance of the horse item on player`s inventory. You will need to use the agent events for your condition, and the inventory horse for the consequence (reduce quality or death).

see header_triggers.py for mission template events (in this case, the death of a agent, that is also a horse, which happens to be the player`s horse. Note that the horse can die while being used by the player, but also when alone in the scene - dismounted).
 
Thank you for providing such detailed guidance. After reading this I think I understand how it works now, and the steps I need to take. I greatly appreciate the generous help!
 
Hi,
I want to make a item selectable which is equipped by a npc. Codes are these:sad:module_dialogs)
Code:
[anyone|plyr|repeat_for_100, "mtas4", [
      (store_repeat_object, ":item"),

      (assign, ":base", 4),

      (is_between, ":item", all_items_begin, all_items_end),


#      (try_for_range, ":try", 0, 5),

##      (assign, ":continue_devam", 0),

      (try_for_range, ":s2", ek_item_0, ek_head),
      (troop_get_inventory_slot, ":in2", "$g_talk_troop", ":s2"),
      (le, ":in2", 0),
      (val_sub, ":base", 1),
      (try_end),
      (lt, ":item", ":base"),

      
      (try_for_range, ":s", ek_item_0, ek_head),
      (troop_get_inventory_slot, "$in_item", "$g_talk_troop", ":s"),
      (gt, "$in_item", 0),
##      (eq, ":i", ":in"),
      (gt, ":item", 0),
      (assign, ":item", "$in_item"),
##      (assign, ":continue_devam", 1),
####      (eq, ":in", ":s"),
####      (assign, ":cont_111", 1),
      (str_store_item_name, s5, ":item"),
      (try_end),
#      (gt, ":item", 0),
#      (str_store_item_name, s5, ":item"),
##      (assign, "$item_for_tactic", ":item"),
##      (eq, ":continue_devam", 1),
#      (try_end),
      ], "{s5}", "item_choose_ac", [(store_repeat_object, ":item"),
##                                    (gt, ":item", 0),
##                                    (is_between, ":item", all_items_begin, all_items_end),
##                                    (assign, "$inv", "$in_item"),
##                                    (val_add, "$inv", all_items_begin),
                                    (str_clear, s10),
                                    (try_begin),
                                    (eq, "$itemchoic", 1),
                                    (troop_set_slot, "$g_talk_troop", slot_companions_item_against_infantry, ":item"),
                                    (str_store_item_name, s10, ":item"),
                                    (display_message, "@{s10} is for infantries."),
                                    (else_try),
                                    (eq, "$itemchoic", 2),
                                    (troop_set_slot, "$g_talk_troop", slot_companions_item_agains_archer, ":item"),
                                    (str_store_item_name, s10, ":item"),
                                    (display_message, "@{s10} is for archers."),
                                    (else_try),
                                    (eq, "$itemchoic", 3),
                                    (troop_set_slot, "$g_talk_troop", slot_companions_item_against_cavalry, ":item"),
                                    (str_store_item_name, s10, ":item"),
                                    (display_message, "@{s10} is for cavalries."),
                                    (try_end),
                                    ]],

Problem:
When this dialog selected, for first item, game is giving invalid item, then when I select other option, giving spear. What should I do?
 
Is there any way to disable the random variation in stats given to troops at the start of a new game?

In other words, I'd prefer that if a troop is set to 20 str and 8 agi, it doesn't sometimes become 21 str or 9 agi at start of game.

I didn't have any luck finding where this happens, is it hardcoded perhaps?
 
Tingyun said:
That makes sense, thanks for the suggestion. I haven’t tried modding something like this before, by any chance does anyone know of an open source mod that does something with horse death? Assuming not, but asking just in case.

[...]
If I recall correctly in TLD your horse can die.
 
Hello!
Quick question - I want to add handgrenades to my mod, I changed range and max_ammo for Holy Hand Grenade, but I want grenade to explode after some time (like mortar shell), not on impact, but I can't find the script of timed explosion in module_scripts.py, maybe can someone show me it?:smile:

And I have strange bug - a cannon, which appears only in gamemodes (but not in scene editing mode), and when I delete in some gamemode barrel of the cannon (I can't select cannon's wood to delete it too) and restart the map - the cannon appears again.
 
Status
Not open for further replies.
Back
Top Bottom