Modding helpme

Users who are viewing this thread

Hello ladies and gentlemen, I introduce myself, my name is EWolfUY and it will be a pleasure to be with you from now on. I have started with the modding of mount and blade warband native and I have some questions: --first: I have created a unit and a new companion and I want them to appear on the map as a band as if it were a bandit lord and attack you . I have already managed to get the units to appear on the map and be banned. But when I add the companion to the group of bandits and I want to fight them, the dialogue skips as if I were in a tavern and wanted to hire him, how do I solve it?. --second: in another mod I have tried to create a new faction with its city, castle, villages, a nobleman and a king, but when I enter the mod I get an error that tells me: SCRIPT ERROR ON CODE 1677: invalid map id: 201 line no 25.

AT THE SCRIPT: create_kingdom_ hero_party

AT THE SCRIPT: create_kingdom_ hero_party

AT THE SCRIPT: create_kingdom_ hero_party

AT THE SCRIPT: create_kingdom_ hero_party

and the other error is:

SCRIPT ERROR ON CODE 1677: invalid map id:202 line no 78.

AT THE SCRIPT:give_center_to_the_lord

AT THE SCRIPT:give_center_to_the_lord

AT THE SCRIPT:give_center_to_the_lord

AT THE SCRIPT:give_center_to_the_lord

How do I solve it? --third: how do I make a unit I create be mercenary (that is in the taverns and can hire them). That would be all for now, I have to say that I use module system for the mods that I have created. I look forward to your response, thank you very much in advance.
 
Hi EWolfUY.
You asked 3 kind of large, unrelated questions and each needs an explanation as to why you see what you see and what you needed to understand when you made the change.

Perhaps the easiest to solve is where you mentioned you added a faction with its own town, castle, and villages.
Be aware the lines for adding town, castle, and villages at module_parties.py have specific requirements for the order in which you add these.
This comes from defines at module_constants.py
towns_begin = "p_town_1"
castles_begin = "p_castle_1"
villages_begin = "p_village_1"

towns_end = castles_begin
castles_end = villages_begin
villages_end = "p_salt_mine"

walled_centers_begin = towns_begin
walled_centers_end = castles_end

centers_begin = towns_begin
centers_end = villages_end
Anything in the module_parties.py file after centers_end will not behave as expected for a town/castle/village.
Merchants for example will not refresh their inventories.

If you add a faction, or add towns, you also are going to have side effects if you do not adjust the values defined at module_constants.py
for party slot definitions to allow for bigger arrays at these definitions:
(party)
slot_center_last_reconnoitered_by_faction_friend_strength, center_last_reconnoitered_by_faction_cached_state
(faction)
slot_faction_truce_days_with_factions_begin, slot_faction_provocation_days_with_factions_begin
slot_faction_war_damage_inflicted_on_factions_begin, slot_faction_sum_advice_about_factions_begin

So if you add 1 faction, add one extra empty slot between EACH of these at their definitions in module_constants.py
The invalid map ID 202 error implies the walled center ID is outside the range for walled_centers_begin and walled_centers_end.

The other question for a companion who you wanted to behave as a bandit also depends on where in the module_troops.py file the troop was defined. If it is with the "companions" as defined in module_constants.py
companions_begin = "trp_npc1"
companions_end = kings_begin
then you will have dialog options for companions.

You probably want some sort of bandit knight dialog for this specific troop but dialogs can be very complicated or very simple.
I would suggest if you don't plan for this troop to actually join your party sometime to instead make them a named troop like the tournament champions and add them inside the module_constants.py defined ranges
soldiers_begin = "trp_farmer"
soldiers_end = "trp_town_walker_1"

You can make a troop recruit able at taverns by putting them within this range
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"
 
Last edited:
Hi EWolfUY.
You asked 3 kind of large, unrelated questions and each needs an explanation as to why you see what you see and what you needed to understand when you made the change.

Perhaps the easiest to solve is where you mentioned you added a faction with its own town, castle, and villages.
Be aware the lines for adding town, castle, and villages at module_parties.py have specific requirements for the order in which you add these.
This comes from defines at module_constants.py
towns_begin = "p_town_1"
castles_begin = "p_castle_1"
villages_begin = "p_village_1"

towns_end = castles_begin
castles_end = villages_begin
villages_end = "p_salt_mine"

walled_centers_begin = towns_begin
walled_centers_end = castles_end

centers_begin = towns_begin
centers_end = villages_end
Anything in the module_parties.py file after centers_end will not behave as expected for a town/castle/village.
Merchants for example will not refresh their inventories.

If you add a faction, or add towns, you also are going to have side effects if you do not adjust the values defined at module_constants.py
for party slot definitions to allow for bigger arrays at these definitions:
(party)
slot_center_last_reconnoitered_by_faction_friend_strength, center_last_reconnoitered_by_faction_cached_state
(faction)
slot_faction_truce_days_with_factions_begin, slot_faction_provocation_days_with_factions_begin
slot_faction_war_damage_inflicted_on_factions_begin, slot_faction_sum_advice_about_factions_begin

So if you add 1 faction, add one extra empty slot between EACH of these at their definitions in module_constants.py
The invalid map ID 202 error implies the walled center ID is outside the range for walled_centers_begin and walled_centers_end.

The other question for a companion who you wanted to behave as a bandit also depends on where in the module_troops.py file the troop was defined. If it is with the "companions" as defined in module_constants.py
companions_begin = "trp_npc1"
companions_end = kings_begin
then you will have dialog options for companions.

You probably want some sort of bandit knight dialog for this specific troop but dialogs can be very complicated or very simple.
I would suggest if you don't plan for this troop to actually join your party sometime to instead make them a named troop like the tournament champions and add them inside the module_constants.py defined ranges
soldiers_begin = "trp_farmer"
soldiers_end = "trp_town_walker_1"

You can make a troop recruit able at taverns by putting them within this range
mercenary_troops_begin = "trp_watchman"
mercenary_troops_end = "trp_mercenaries_end"
Hello, You have answered my questions, when I try it I will tell you what happens, since it is very late here (night), thank you. Edit: What do you mean, with that it is out of range, for example, my city has ID: 100 as much as my castle. Do you mean that?
and with the first spoiler. How to add an empty slot between these?
 
Last edited:
Hello, You have answered my questions, when I try it I will tell you what happens, since it is very late here (night), thank you. Edit: What do you mean, with that it is out of range, for example, my city has ID: 100 as much as my castle. Do you mean that?
and with the first spoiler. How to add an empty slot between these?
"How to add an empty slot between these?"

I'll "spoiler" this reply to not annoy anyone with too much text:
(party)
slot_center_last_reconnoitered_by_faction_friend_strength
center_last_reconnoitered_by_faction_cached_state ADD 1 to the value here
(faction)
slot_faction_truce_days_with_factions_begin, ADD 2 to this value
slot_faction_provocation_days_with_factions_begin ADD 3 to this value
slot_faction_war_damage_inflicted_on_factions_begin, ADD 4 to this value
slot_faction_sum_advice_about_factions_begin ADD 5 to this value

So if you add 1 faction, add one extra empty slot between EACH of these at their definitions in module_constants.py
The idea is the number of reserved slots between each of these has increased by 1, pushing the start of the next one down.

After adding many factions in Perisno and later Phantasy Calradia and after that Warsword Conquest it became so complicated
I made a spreadsheet to track if I had enough slots reserved for each faction related array. My Phantasy source is now available, but it is overkill for your problem.
 
"How to add an empty slot between these?"

I'll "spoiler" this reply to not annoy anyone with too much text:
(party)
slot_center_last_reconnoitered_by_faction_friend_strength
center_last_reconnoitered_by_faction_cached_state ADD 1 to the value here
(faction)
slot_faction_truce_days_with_factions_begin, ADD 2 to this value
slot_faction_provocation_days_with_factions_begin ADD 3 to this value
slot_faction_war_damage_inflicted_on_factions_begin, ADD 4 to this value
slot_faction_sum_advice_about_factions_begin ADD 5 to this value

So if you add 1 faction, add one extra empty slot between EACH of these at their definitions in module_constants.py
The idea is the number of reserved slots between each of these has increased by 1, pushing the start of the next one down.

After adding many factions in Perisno and later Phantasy Calradia and after that Warsword Conquest it became so complicated
I made a spreadsheet to track if I had enough slots reserved for each faction related array. My Phantasy source is now available, but it is overkill for your problem.
Oh, The other thing that happens to me is when I put, for example: town 10 and I name it Montevideo, the name that appears in the game is warsaw, polska. or something similar. Why is this happening?
 
Last edited:
Oh, The other thing that happens to me is when I put, for example: city 10 and I name it Montevideo, the name that appears in the game is warsaw, polska. or something similar. Why is this happening?
Not sure. Write the name exactly as it appeared and in your source search module_parties.py for that name. See if you are off by 1 or some specific number, something like this when you display the name of the current city. I won't do it for you, at least as long as my own mod needs work.

Also if you are writing a name in a display_message() line, you could str_clear that s register to be certain it does not contain some old value.
 
Not sure. Write the name exactly as it appeared and in your source search module_parties.py for that name. See if you are off by 1 or some specific number, something like this when you display the name of the current city. I won't do it for you, at least as long as my own mod needs work.

Also if you are writing a name in a display_message() line, you could str_clear that s register to be certain it does not contain some old value.
I just put town100 and the name of the town and works, but I'm going to try what you said
 
Oh, The other thing that happens to me is when I put, for example: town 10 and I name it Montevideo, the name that appears in the game is warsaw, polska. or something similar. Why is this happening?
If you want to rename a town, it's often not enough to edit TXT files. Look into languages folder of your mod and find parties.csv - this also needs to be edited.
 
Back
Top Bottom