Mod: Attackable peasants

Users who are viewing this thread

Vinz Klortho

Recruit
First off, note that this is an early stab at doing this. There's probably a few bugs,and it currently only works for the Peasant faction. That is, the group must be titled "Peasants" not farmers, refugees, or escaped prisoners. It can however, contain those people. I strongly suggest you backup your data files before you go mucking around.

I will tell you what to modify, then attempt to explain why I think it works the way it does. I have figured other parts of the file formats too, and hope to do a decent write up some time before I get too lazy to get around to it.

All insertions are on a new single line, unless noted otherwise

The file of interest is Mount&BladeModsNativeconversation.txt.
Change the first line from 871 to 874.

Go to line 168, should read:
196614 124 1 2 33554721 0 Greetings_to_you_too. 6 0

Insert this after that:
196614 124 1 2 33554721 0 Yer_money_or_yer_life. 6 9 20029 33554686 0 20048 16777219 -15 20090 8 0 20020 16777216 16777219 10270 1 0 10270 4 0 10270 8 0 10270 9 0 10302 0 0

The next line down should already include:
I_have_been_charged_with_hunting_down_outlaws_in_this_area...

After that line, insert:
196614 124 2 1 33554721 0 1 33554516 0 Yer_money_or_yer_life. 6 9 20029 33554686 0 20048 16777219 -15 20090 8 0 20020 16777216 16777219 10270 1 0 10270 4 0 10270 8 0 10270 9 0 10302 0 0

A few lines down, you should see : I_was_just_going_to_ask_if_you_saw_any_outlaws_around_here

After that line, insert:
196614 127 0 Liar_it_is_time_you_were_brought_to_justice. 6 9 20029 33554686 0 20048 16777219 -15 20090 8 0 20020 16777216 16777219 10270 1 0 10270 4 0 10270 8 0 10270 9 0 10302 0 0
 
Here's what I figure is going on in conversations.txt

Most of the mod files seem to be space delimited tables. Conversations has a little of that, but it also has a number of of its own conventions and sets of three numbers.

The top number in the fileis the number of rows in the file.

The first number in a row seems to refer to the speaker id. This appears to be the same anytime an NPC is talking, but I have not heavily checked. Unfortunately, the player's id is different for each conversation. It does, however, remain the same for a particular conversation. In the attackable peasants conversation, the player id is 196614 and the peasant id is 131078. The variability of the player id is what's keeping me from shoehorning attack sequences into the other 'common man' types of classes.

The second number is the conversation index. Setting it to 1 denotes the beginning of a conversation. The next number denotes how many triples are to follow before the actual dialog text. It seems armagan uses magic numbers to denote actions such as checking/setting variables, giving gold, etc. I'm a little shaky on what the particulars of some of these are. The sequence "2 33554721 0" on line 168 seems to mean "if the value of variable 33554721 is equal to 2." A few lines down, this tuple is repeated as a check for 1. Checking for that variable number and looking at dialog options seems to confirm this. If all the triples before a dialog text are satisfied for a dialog id, then that line is displayed.

It appears that if there is nothing to say, the dialog sequence ends. If there is one thing to say, it does that camera swing, if there is >1 thing, you get UI buttons.

The next column is the actual dialog text. Note that spaces are converted to underscores.

The following column is the next dialog id to go to after this line finishes. 6 seems to be a special number, indicating end of dialog.

The next number indicates the number of ending triples to be read. This seem to be mostly concerned with assigning actions to a dialog choice.

For example, "10270 1 0" seems to mean "assign the given reputation change from faction 1" The given morale change is -15 , I haven't fully figured out what the triples around it and containing it does. Faction 1 is the commoners faction. The number is is a 0-based index. You can figure out a faction's index by looking at the line they appear on in factions.txt and subtracting 1. (Db goons can think of this as a foreign key, indeed much of the mod stuff seems Db-like)

An easier example is the triple "10061 50 0", which means that the player gives(10061) 50(50) gold. I don't know what's up with the trailing zeros, it may be reserved room for expansion.

"10302 0 0" seems to mean "begin a fight after the conversation"

Other command values include:
10060 amt 0 - player receives amt in gold
10062 amt 0 - player receives amt in experience
10316 0 0 - display the "tell me about yourself" stats screen
10190 id 0 - player receives item id. The id is determined from Mount&BladeDataitem_kinds.txt. 155, for example, gives you the wooden shield.

20029 variableid value - seems to assign variableid a value
"20029 33554721 1" would make 33554721 return 1 when queried. I may be mistaken, but 2, for some reason, seems to be the default value for a variable. This variable, btw, represents that you've undertaken the river pirate extermination quest.

Please use the info for whatever you want, but do give M&B a stab without cheating. It is a difficult game, but it is also a very nice feeling when you do master it. My main intention is to help get modding started so that there's more community content, not to walk around in adamantium plate, throwing lighsabres at daemonic illuminati.
 
[quote="Vinz Klortho]My main intention is to help get modding started so that there's more community content, not to walk around in adamantium plate, throwing lighsabres at daemonic illuminati.[/quote]

Man, you gave away my idea. Not cool.

I think I'll give your mod a shot when I get home, though. I like the idea of being a bandit. Maybe you could just post the file instead of making us edit it ourselves, though? I think a lot of people may get confused or just frightened off by all the scary numbers.
 
Tiedye said:
Maybe you could just post the file instead of making us edit it ourselves, though? I think a lot of people may get confused or just frightened off by all the scary numbers.

It's a bit large to paste in here, and I don't have any way to host the file. If a solution to either presents itself, I will do so.
 
I've been looking through the files and noted that they were space delimited tables, but have not the zeal to go through and figure out what is what. Vinz Klortho, I think I'll muck around and try to look into making a quest at Dhorak Keep that allows you to become a bandit and be able to attack peasants. Any ideas on how you would use a dialog option to change the requisite peasant-dialog to allow fighting?
 
n00854180t said:
I can host the file if you like, just email it to n00854180t AT earthlink DOT net.

Thanks, it's been sent.

I'd probably use towns.txt to set up a meeting at Dhorak keep with one of the unused NPCs. (custom rooms and npc's are beyond my ken, so far) I would then alter their dialog to something appropriate, and give it the side affect of setting a variable to some number. I would then alter the peasant attack lines so that they do not appear unless the variable has been set to the correct value. See how the game handles the river pirate quest for an example of that.

I will also be replying with the other tidbits I've found out, the section on towns.txt should help with the first part of your idea.
 
Unless noted otherwise, if the first line of a file is just a number, it can be assumed that the number refers to the number of rows of data contained in the file.

Factions.txt
I've experimented very little with this. This first column is, of course, the faction name. You can use this to figure out the numerical id for a faction, as explained above. The second column is undetermined. Columns n-2 to n may reflect how that row's faction feels about faction #n-2. Alternatively, it may reflect how that faction is felt about faction #n-2. Since this file is unmodified, yet reputations go up and down, it is assumed that this is only used when initializing a new game. Repuation data is probably persisted in the save game file. (This is also why I haven't tested it much.)

Party_templates.txt
This is an interesting file to me, when I get off my current obsession with towns and dialogue, I'll probably be experimenting here.

The first column is the party type. The second column is undermined. The third column corresponds to the faction key. The rest have not been experimented with but most likely determine party sizing, composition, and possible equipment and loot.

sites.txt
The first column is the text id of an area. The third column details what manifold text to use as reference, the fourth tells what part of the manifold data is relevant? This is followe by what appears to be sizing data and then other data. It seems that any line which ends in 100000 denotes an area which exits to the overworld. A quick experiment could confirm this. It is possible to get the numeric areaid from this file. Take the line # the area description begins on, the id is the #/2 - 1. This is important for towns.txt.

strings.txt
This maps strings to various twd_ keys. When you enter Velcua, the programs uses twd_Veluca to determine what text to display. If you create a town in towns.txt and do not create a corresponding twd_ entry, you will get an error string on that screen, but will not BSoD.

towns.txt
Column 1 may be the text key for the town, while column 2 is the string used for display. Column 3 is intriguing. Especially when all 'normal' towns are 0, while Zendar, the Inn, and the Salt Mine are 16. Column 4 is the town faction, -1 makes it no faction (distinct from neutral). This doesn't appear to affect your how the markets receive you or whom you can recruit. Column 5 and 6 are the towns' locations on a (probably) 200 by 200 grid ranging from -100 to 100 with the origin somewhere near the start of zendar's river. 0.5 units seems to be about 1/2 a city width. Decreasing column 6 moves you away from the shore and towards the long mountains. Increasing column 5 moves you right (shore at the top of the screen). The next few columns are unexplored. If a town has options it presents when clicked upon, these are the last columns uses. They follow the format:
n id1 string1 id2 string1
Where n is the number of pairs to follow, and id# refers to the area to teleport to if the user chooses string#. (this is a fun way to explore abandoned areas)



----
Here's things I've not confirmed really haven't dealt with.
Manifold texts: seems to be 3d coordinated, note that there appear to be multiple objects in some of them.

Parties.txt: May be and older template system for parties. I don't know if it's actually used.

Quests.txt: Possibly text used in quest log, line#-2 is the quest index used by command 10280 in conversations.txt

Site_objects.dat: Seems to be a binary file which actually says what objects are in each area. This most likely has to be figured out before we can make totally new inns, rather than modifiying what people in existing inns say.

Site_lightings.dat: Very big, haven't looked at. Assume that it contains light info.

triggers.txt: Haven't poked it yet.

troops.txt: Stats for various characters in the game. Should be veeeery interesting to muck about with. One wonders if arma is Armagan 's vanity hero character.

Note that in all these files, Armagan seems to be using $sreg1$, $him/her$, etc as variables for text substitution.

There's also a bevy of modifiable config files in Mount&BladeData
 
Vinz Klortho said:
n00854180t said:
I can host the file if you like, just email it to n00854180t AT earthlink DOT net.

Thanks, it's been sent.

I'd probably use towns.txt to set up a meeting at Dhorak keep with one of the unused NPCs. (custom rooms and npc's are beyond my ken, so far) I would then alter their dialog to something appropriate, and give it the side affect of setting a variable to some number. I would then alter the peasant attack lines so that they do not appear unless the variable has been set to the correct value. See how the game handles the river pirate quest for an example of that.

I will also be replying with the other tidbits I've found out, the section on towns.txt should help with the first part of your idea.

Yeah, I was thinking of editing the dialog of the guy in Dhorak Keep. Will try to mess with that when I get home.
 
Wow.. that would make for a pretty cool mod. It would be almost like letting you join a bandit faction. Talk to the guy, join the bandits, now you can attack peasants.

It looks like you're also already figured out how to change reputations. Maybe you could make the bandits like you when you join, but both Swadians and Vaegirs hostile?

Sorry, getting a little carried away. I just hadn't expected to see such modding so soon.
 
Tiedye said:
I just hadn't expected to see such modding so soon.

If we wait till Armagan releases devkits, we won't have the fun of reverse engineering the files. <- My personal reason

Plus, if we work on that sort of thing, it helps lighten the load for Aramagan and Ipek, and we get More Good Things Faster. <- Everybody's reason
 
Probably could do that by checking what's changed when you talk to Vaegirs/Swadians. I'm going to do some heavy mucking when I get home. If I make any progress I'll host it on my site.

Can one/both of you guys test that file out? I'm not sure what sort of newlines M&B is after, so if it ended up putting in Linux n instead of Windows nr it might cause problems, but I don't know. I'm also unsure of whether it word wrapped or not, considering I had to copy and paste since my email doesn't like to let me save text attachments directly.
 
I'm stuck at school until 10PM tonight (Eastern), but I'll give it a spin when I get home.

This is my punishment for registering two days into the semester. Stuck here for 8 hours, with 5 hours between two classes :cry:

But yeah, I'll definitely give it a spin when I get home.
 
So, which faction of bandits should become friendly? We have sea raiders, river pirates, Black Khergit Raiders, Dark Knights, forest bandits (or raiders, I can't remember).
 
I like how now there are some easy targets for those who really want to be an evil slaver. I mean, it's one thing to sell captured bandits into slavery. It's so much more gratifying to pawn off a horde of innocent farmers. :twisted:
 
Back
Top Bottom