Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hey,
I am placing my parties on the map, everything seems fine in the map editor (after I copies and pasted the ddited parties from WB to the M&B folder)
But everytime when I press start a new game, It crashes at loading map.

help pls.
 
xPearse said:
Could someone tell me how to make sure guns will be sold in shops.

Increase the abundance value, it is easy to increase if you know where it is. Also make it merchandise or they won't sell it. It is much easier to make it merchandise with morghs editor than with just the txts unless you know how the values change.

94406380.png

There is no way to make sure the item is always in shops though unless you make a ridiculous abundance value but 130 will show up a lot and is way above average for norm games as you can see by looking in the item_kinds1.txt file.

MadVader said:
Cheaters and tweakers, they never give up. :smile:
The problem is with the hardcoded items_end, which you can't change without the module system or if you really know what are you doing in menus.txt (hint: increase two identical numbers in mnu_cheat_find_item).
If you add items at the end of the items file, they won't be in the range of the find item cheat.

Yeah I add my items before the items_end in items_kinds1.

Sweet got it to work  :cool: there were 3  identical numbers though under mno_cheat_find_item, after messing around being a idiot for a hour or so I matched the numbers with another mod and just looked for the differences between the 2 of them that corresponded with the difference in items the mods had, after that it was pretty simple to see what needed to be changed. Thanks for the help though, I knew it had to do with menus.txt just needed the clue on where to look, although it was pretty straight forward. Thanks again.

Tags. # How to add items to cheatmenu find item # cheatmenu finditem #Long live the occult.
 
xPearse said:
Could someone tell me how to make sure guns will be sold in shops.
If you set the flags to itp_pistol or musket you will have to modify the following script:
  # script_refresh_center_weaponsmiths
  ("refresh_center_weaponsmiths",
  [
  (reset_item_probabilities,100),
  (set_merchandise_modifier_quality,150),
    (try_for_range, ":cur_merchant", weapon_merchants_begin, weapon_merchants_end),
  (store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
    (val_add, ":cur_town", towns_begin),
  (troop_clear_inventory, ":cur_merchant"),
    (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 2),  
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"),
      (store_troop_gold, reg6, ":cur_merchant"),
Initially bullets and pistols were not sold now I added them to the merchants list. You can do the same with muskets/firearms following the same logic. Note that it is the Warband script, the Classic M&B one should be similar though.
 
Cozur said:
Is it possible to have a trigger that fires after, say 10 days, and assigns a castle/town from kingdom 1 to kingdom 2 instead.

Say the Sarranid Lord Troy holds Castle Numero Uno.

A trigger fires.

Now the Vaegir Lord Abed holds Castle Numero Uno instead, with Lord Troy holding no castle.
 
Seek n Destroy said:
xPearse said:
Could someone tell me how to make sure guns will be sold in shops.
If you set the flags to itp_pistol or musket you will have to modify the following script:
  # script_refresh_center_weaponsmiths
  ("refresh_center_weaponsmiths",
  [
  (reset_item_probabilities,100),
  (set_merchandise_modifier_quality,150),
    (try_for_range, ":cur_merchant", weapon_merchants_begin, weapon_merchants_end),
  (store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
    (val_add, ":cur_town", towns_begin),
  (troop_clear_inventory, ":cur_merchant"),
    (party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 5),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 2),  
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"),
      (store_troop_gold, reg6, ":cur_merchant"),
Initially bullets and pistols were not sold now I added them to the merchants list. You can do the same with muskets/firearms following the same logic. Note that it is the Warband script, the Classic M&B one should be similar though.

Sorry but I can't seem to find it, searched through module scripts but didn't find anything similar or am I looking in the wrong place.

I added something at this script but don't know if it's right.  ("refresh_village_merchant_inventory",

 
I was wrong, haven't touched the 1.011 module system in a while, the script you modified is the one of the villages. It's ok if you want to buy guns there but the one you are looking for is in module_triggers:
# Refresh Weapon sellers
  (0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,150),
                      (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
                        (troop_add_merchandise,reg(2),itp_type_one_handed_wpn,5),
                        (troop_add_merchandise,reg(2),itp_type_two_handed_wpn,5),
                        (troop_add_merchandise,reg(2),itp_type_polearm,5),
                        (troop_add_merchandise,reg(2),itp_type_shield,6),
                        (troop_add_merchandise,reg(2),itp_type_bow,4),
                        (troop_add_merchandise,reg(2),itp_type_crossbow,3),
                        (troop_add_merchandise,reg(2),itp_type_thrown,5),
                        (troop_add_merchandise,reg(2),itp_type_arrows,2),
                        (troop_add_merchandise,reg(2),itp_type_bolts,2),
                        (troop_add_merchandise,reg(2),itp_type_musket,2),
                        (troop_add_merchandise,reg(2),itp_type_pistol,2),
                        (troop_add_merchandise,reg(2),itp_type_bullets,2),
                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                        (troop_sort_inventory, reg(2)),
                        (store_troop_gold, reg(6),reg(2)),
                        (lt,reg(6),900),
                        (store_random_in_range,":new_gold",200,400),
                      (call_script, "script_troop_add_gold",reg(2),":new_gold"),
                      (end_try,0),
                    ]),
 
Seek n Destroy said:
I was wrong, haven't touched the 1.011 module system in a while, the script you modified is the one of the villages. It's ok if you want to buy guns there but the one you are looking for is in module_triggers:
# Refresh Weapon sellers
  (0.0, 0, 24.0, [], [
                      (reset_item_probabilities,100),
                      (set_merchandise_modifier_quality,150),
                      (try_for_range,reg(2),weapon_merchants_begin,weapon_merchants_end),
                        (troop_add_merchandise,reg(2),itp_type_one_handed_wpn,5),
                        (troop_add_merchandise,reg(2),itp_type_two_handed_wpn,5),
                        (troop_add_merchandise,reg(2),itp_type_polearm,5),
                        (troop_add_merchandise,reg(2),itp_type_shield,6),
                        (troop_add_merchandise,reg(2),itp_type_bow,4),
                        (troop_add_merchandise,reg(2),itp_type_crossbow,3),
                        (troop_add_merchandise,reg(2),itp_type_thrown,5),
                        (troop_add_merchandise,reg(2),itp_type_arrows,2),
                        (troop_add_merchandise,reg(2),itp_type_bolts,2),
                        (troop_add_merchandise,reg(2),itp_type_musket,2),
                        (troop_add_merchandise,reg(2),itp_type_pistol,2),
                        (troop_add_merchandise,reg(2),itp_type_bullets,2),
                        (troop_ensure_inventory_space,reg(2),merchant_inventory_space),
                        (troop_sort_inventory, reg(2)),
                        (store_troop_gold, reg(6),reg(2)),
                        (lt,reg(6),900),
                        (store_random_in_range,":new_gold",200,400),
                      (call_script, "script_troop_add_gold",reg(2),":new_gold"),
                      (end_try,0),
                    ]),

Oh right module triggers, I thought it was in scripts since you said scripts before but that's probably when doing that for warband. Thanks as I added the musket, bullet and so forth so they should be sold in shops so again thanks.
 
Is it ok to remove personality clashes and matches, talking about companions here as I did and got errors. Also can you add people coming with a companion when they join such as random units, I have some added in like this so is it right.

Code:
        (troop_set_slot, "trp_npc2", (party_add_members, "trp_player","trp_shido_school_girl",1),
        (troop_set_slot, "trp_npc2", (party_add_members, "trp_player","trp_shido_school_boy",1),
        (troop_set_slot, "trp_npc2", (party_add_members, "trp_player","trp_caravan_guard",1),
        (troop_set_slot, "trp_npc2", (party_add_members, "trp_player","trp_mercenary_swordsman",1),
        (troop_set_slot, "trp_npc2", (party_add_members, "trp_player","trp_police_officer",1),
 
Go through the coding tutorial ASAP, this is just awful. :smile:
1. Comment out or remove the troop_set_slots for companion love/hates.
2. Adding party members when NPCs join.
The NPCs join at a certain place in the dialogs that's easy to find. Add troops to the party there, like this:
(party_add_members, "p_main_party","trp_shido_school_girl",1),
 
MadVader said:
Go through the coding tutorial ASAP, this is just awful. :smile:
1. Comment out or remove the troop_set_slots for companion love/hates.
2. Adding party members when NPCs join.
The NPCs join at a certain place in the dialogs that's easy to find. Add troops to the party there, like this:
(party_add_members, "p_main_party","trp_shido_school_girl",1),

I didn't ask how to take away the personality match/clash but does the game work find if you remove them and if so are there errors. I already removed them before I posted, I noticed the brackets that stopped it from ending properly and removed them right after posting, just copied it from the game menu's part where you give units upon starting the game. Exported and got no errors but still have to try ingame.
 
I was wondering if someone could tell me what flora_kinds.txt does, I know it controls how much of a certain plant/fauna will spawn in a scene - but iv no idea in what scenes (if it even is scene specific). I'm interested in editing it but iv no idea where to start, is there a tutorial on here or somewhere I can get more info on it?

grass 6442469688324 5
grass_a  0
grass_b  0
grass_c  0
grass_d  0
grass_e  0
grass_bush 42950461452 2
grass_bush_a  0
grass_bush_b  0

Am i correct in saying that words in bold are the defined scene prop/plant names (what would appear in edit mode) and the ones below them the names of the meshes? Say for example that if grass_bush is selected in edit mode it would have a chance of being either the grass_bush_a mesh or  grass_bush_b mesh. Also what do the numbers mean and what controls how much of a plant spawns?

Thanks in advance  :grin:
 
Good luck playing with the .txt file, I find the Flora_kinds.py easier to understand. There was a thread about it if I remember right.
Try and download this file which comes with a copy of the Flora_kinds.py that should be compatible with the latest version:
http://mountandblade.nexusmods.com/mods/3516 in the module data folder, it comes with the skyboxes.py and ground_specs.py too. Can't guarantee anything, haven't touched this so far.
 
hi im trying to add an item that adds stat bonus to yyou from ivnentoy, how do i do this?
i want to have different kinds of items but i want some item stat bonus to overwrite other stat bonus.
the item has ranks and i want rank 1 to add +2 str, and i want rank 2 to add +4 str, but I want it to negate the other item bonus if it is in the same invetory. is this possible? or is it complicated script.
much like books is what i need but it will have tiers that overwrite the other tiers upgrades. i dont want mindless stacking.

so im just looking for the scripts you need or code you need to make sure that when u have multiple kinds of the same items the bonuses do not stack, and id like different kinds of different items to stack.

like inventory item tier 1: +1 str
inventory item tier 2: +4 str renders other item inert if found in invetory

other inventory item tier 1: +2 str, stacks with other inventory item because its completely diff.
other inventory item tier 2: +5 str, stacks with either tier of other item, does not stack with previous item tier.

how do i find all of these values or what script do i need to make it so when an item is in the inventory the items i have designated as its tier upgrades will render the other item inert and the other item will stack and not conflict but only with any items i designate it inerting, or is it all hardcoded? pls help me thx!!
 
Use capitalization and punctuation, this is not a chat.
It is easy to implement skill-modifying items (like the 3 books), see script_game_get_skill_modifier_for_troop.

Changing attributes like STR is more difficult.
You need both to increase STR when the item is equipped or gets in inventory, and remove the STR bonus when it's unequiped or get sold or lost. Nothing too easy about it.

I did something like this in a mod. I defined an item slot to tell me if the item bonus is active or not (0/1). Then wrote a trigger that checked for all such attribute-changing items, if they are equipped or in inventory (depending on the item).
For example, we had a ring that gave you STR+1 when in inventory. The trigger code checks two things:
- if the ring is in inventory and its bonus is not applied (item slot = 0), increase player STR by 1 and set item slot = 1; the ring was just obtained
- if the ring is not in inventory and its bonus is applied (item slot = 1), decrease player STR by 1 and set item slot = 0; the ring was lost

More complicated conditions like dependencies between items are easy to do, it's just few more lines of code.
 
so that's how it works....  I always gave up with that, because I was trying the line of when item equipped (store current value) + add bonus..... / when item unequipped (recall stored value) + 0.
And obviously this penalises the player if they level up while wearing said item.
 
Status
Not open for further replies.
Back
Top Bottom