Mod: Attackable peasants

Users who are viewing this thread

Tell me if you see anything wrong with these lines:

196614 124 1 2 33554721 0 Yer_money_or_yer_life. 6 10 20029 324554689 1 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

131106 1 2 11 33554686 0 1 324554689 0 You_will_not_survive_this! 6 4 20090 8 0 20002 0 1 10270
8 0 10302 0 0
 
Is it not working? What unit type is 131106?

There are two likely problems. One is that we don't fully understand how the query section prior to the text works. The other is that the modified yer_money line is one of three different occasions when you attack a peasant. If the person has already taken the river pirate quest, the new variable won't be set.

The other yer_money and the liar_it_is_time lines must also include that variable assignment.

It is also possible that the long number are actually addresses into memory, not just variable handles. In which case we will have a hard time creating new variabls and it wouldn't be healthy to create new numbers willy-nilly.

edit: I just tried the variable assignment. I got an rlg_error Invalid assignment. That's not a good thing. I'm going to avoid mucking with new variables until we have a better grip of what's going on with them.

Unfortunately, this rather hamstrings a lot of plans.

Fortunately, there is a lot that is still possible (especially if you co-opt lesser used, not-always-used, or unused variables), and still a whole lot of the data format to explore.
 
I just tried the first half using variable 33554528 (seems to keep track of your introduction to Xerina).

This time no error occured. That may be the beginning of a workaround.

Right now, I'm being gently reminded that it's 99 cent taco night and happy hour at one of our favorite restaurants, so I will wish you all a good evening (or whatever it is at your local time).

Note that my previous message has a lengthy edit attached to it.
 
Guys, I modded the entire Towns/Partys/Units into an European setting, the Saxon vs Frankish war with Charles the Great featuring Arabs (Khergit) Partys and Visigoths.

I haven't changed the /dat files yet but I mean to, also, I have not changed the dialogues - just names for things.
Nothing fancy, but if someone wants to play in this setting, I would need hosting. It is easy to do for yourself, of course, but why bother?
We should create an Mod Index or something.
Here's my intro text.

From 772 onwards, Charles the Great tried to conquer and defeat the Saxons. This campaign expanded the practice of non-Roman Christian rulers undertaking the conversion of their neighbors by armed force; Frankish Catholic missionaries, along with others from Ireland and Anglo-Saxon England, had entered Saxon lands since the mid-8th century, resulting in increasing conflict with the Saxons, who resisted the missionary efforts and parallel military incursions.

Widukind, Charles biggest adversary among the Saxons fights a fierce battle against the Frankish invaders for he knows that only the Roman Empire tried to cross the Rhine into the area of Germanic tribes before, loosing 30,000 men and beeing repelled after days.

As the pagan Saxons begin to meet the Christian Franks in open battlefield, a full scale war errupts in the region, leaving you as a neutral mercenary to choose sides or act as a neutral merchant.


Someday I will have changed textures and weapons and so on. Not yet though ;(
 
Zwaps, good luck.

n00854180t, I will be trying out your mod shortly.

I think I've figured out what the player's id is in the conversation.txt file is. It appears to be an offset from whomever $he/she$ is talking to. PcId = 65536 + npcId. This doesn't always seem to be the case, but it works often enough to extend this mod so that we can use it to attack refugee and farmer factions.
 
Looking at the Borcha conversation where he actually initiates the dialog (right after you free him and start moving about the world map) Has been interesting. The variable being used, 33554481, does indeed show up in triggers.txt and the relevant lines do contain 117, which has been used as Borcha's id.
 
Random speculation concerning triggers.txt backed up with examination.

It seems to be a 3 columns of floating point numbers (timing, location info?) followed by:

m m-triples n n-triples

That is, if m were 2 and n were 1, it would look like this

0.00 0.00 0.00 2 0 0 0 0 0 0 1 0 0 0

I've just realized (and quickly glanced at the file as a sanity check), that the first set of triples seems to be condition checking, while the second set is the response. This is much like the format of conversation.txt, but without the dialog string in between. I wouldn't be surprised at all if the magic numbers here are the same as the magic numbers in conversation.txt.
 
:smile: The three numbers govern the timing. First is the check interval: how much time passes between each check; second is delay interval - how much time between the trigger is activated and the conditions are applied; the third is rearm interval - how much time passes until the trigger can be activated again.
 
Instead of spamming the boards, I'm going down through conversation.txt and keeping a log of what I find, to be posted later.

These op codes are looking a lot like assembly...
 
Vinz Klortho said:
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.

Recent findings:

10314 0 0 - seems to be the code for the "sell prisoners" dialog
10315 0 0 - Seems to be the code used to bring up the recruitment dialog
 
zwaps said:
Guys, I modded the entire Towns/Partys/Units into an European setting, the Saxon vs Frankish war with Charles the Great featuring Arabs (Khergit) Partys and Visigoths.

I haven't changed the /dat files yet but I mean to, also, I have not changed the dialogues - just names for things.
Nothing fancy, but if someone wants to play in this setting, I would need hosting. It is easy to do for yourself, of course, but why bother?
We should create an Mod Index or something.
Here's my intro text.

From 772 onwards, Charles the Great tried to conquer and defeat the Saxons. This campaign expanded the practice of non-Roman Christian rulers undertaking the conversion of their neighbors by armed force; Frankish Catholic missionaries, along with others from Ireland and Anglo-Saxon England, had entered Saxon lands since the mid-8th century, resulting in increasing conflict with the Saxons, who resisted the missionary efforts and parallel military incursions.

Widukind, Charles biggest adversary among the Saxons fights a fierce battle against the Frankish invaders for he knows that only the Roman Empire tried to cross the Rhine into the area of Germanic tribes before, loosing 30,000 men and beeing repelled after days.

As the pagan Saxons begin to meet the Christian Franks in open battlefield, a full scale war errupts in the region, leaving you as a neutral mercenary to choose sides or act as a neutral merchant.


Someday I will have changed textures and weapons and so on. Not yet though ;(

Just noticed you said you needed hosting. Email a .zip of your files to n00854180t AT earthlink DOT net and I'll go ahead and put them up.
 
This is suggestive.
-2147483538 personId 0 queries if the person is not in your party.
110 personId 0 queries if the person is in your party.

If you look at -2147483538 in binary, negate it again, and strip the padded 1's from the left, you get 110.
 
Here's a bunch of info to share with y'all.

Here is a list of things I've pulled out of conversation.txt. I've decided to be methodical and work from the top down, I'm currently at line 166 of the native file. This excludes only some of the trickier arena and trainer op codes. These are my next priority because they control how fights spawn, but they'll take a little extra effort to figure out. (Don't worry about being on only 166 of 870ish, it's going by exponentially or so.)

I've included "Certainty levels" for how sure I am something is what I think it is. Any number not defined on this list can be thought of as somewhere in-between the closest defined numbers.
  1. Just a guess from inspection, very iffy it if really works
  2. A guess from inspection, but I feel very sure about it
  3. I've confirmed a couple ways in-game, but which only has my say-so
  4. Many people have confirmed
  5. Many people have confirmed with in-game trials over a long time, or Armagan spilled the beans
Code:
Queries
------------------------------------------------
-2147483638 b c:  is b <= c, confidence 2
10                b c:  is b >= c, confidence 5
11                b c:  is b == c, confidence 5

Commands (b=c=0, unless used)
------------------------------------------------
2029   b c: assign value of c to value of b,  con = 5
10280 b c: assign player quest b (id from quests.txt),  con = 5
10190 b c: give player item, con = 5
10203 b c: assign troopid b to party (from troops.txt), con  = 7
10251 b c: assign troopid b to party faction, con = 4
20352 b c: load number of parties of type c(party_templates.txt) I have
                 beaten (possibly battled with rather than beaten) into register 
                 address b*
20017 b c: multiply b and c, con = 7
20020 b c: store the lower of c or the value in register address b at 
                register address b, con = 7
20016 b c: subtract c from the value in reg. address b, store in reg at 
                addressb (ie:  b -= c;), con = 7
10316 b c: display the "tell me about yourself" screen, con = 9
20059 b c: load the number of prisoners in party into reg. addr. b If b 
                is 0, use $reg0$  This may be common behavior in similar
                operations, con 7
10314 b c: show sell prisoners screen, con 9
10062 b c: give player amt b exp, con 5
10060 b c: give player amt b gold, con 5
10061 b c: player loses amt b gold, con 5
20018 b c: divide b by c (probably integer division), con 5
20013 b c: increment by 1 (b++), con 4
20014 b c: decrement by 1 (b--), con 4
20030 b c: load value of variable into register number (not address!), 
                 con 2
20050 b c: load string associated with troopid c into string register b 
                ($sregb$), con 2
10193 b c: take item b (item_kinds1.txt) from player inventory, con 5
10194 b c: give troopid c itemid b, con 5
-2147483538 b c: return 1 if troopid b is not in party, con 7
-2147483547 b c: return 1 if there's no room for more people in party
                          (may be more general), con = 4
110 b c: return 1 if troop id b is in your party, con 7

Variables
----------
33554527	harreck has done his opening announcement 
                      re: river pirates
33554721	player has been assigned river pirate quest
33554464	type of arena tournament?i
33554458	amount you've bet in the arena
33554720	constable has given you initial speech on the success of                  
                      river pirate quest
33554831	amount of river pirates killed as of last time you got 
                      reward from constable
33554719	some internal variable?, river pirates quest accomplished?
33554524	first chat with Marnid
33554526	conditions for Marnid to be in your party have been met
33554514	initial chat with Ramun
33554525	Marnid answered question about fighting for padded cloth
33554492	PC has not been told how to take someone as prisoner
33554456	Tournamentmaster has explained tournaments
33554455	Zendar arena fight has been started, but not followed up 
                      on with tournament master
33554460	1 if watched arena fight, 0 if actually fought in fight
33554462	1 if won arena fight
33554466	most likely number of successful training 'stages'         
                      completed in zendar
33554513	possibly denotes if player has had conversation with 
                      tournament master about training
33554464	type of next arena fight
33554458	arena bet amount
33554461	1 =player bet on blue, if didn't actually fight in arena, 0 if 
                      player bet on self
33554523	has had arena zooming explained to him
33554465	has been introduced to trainer of zendar
33554467	number of fights left to go till next training stage in zendar
33554468	opponent type in training stages at zendar
33554518	training tiers explained to pc
33554470	training stage fight was 1 if 1
33554469	set after a training stage fight starts, apparently unset 
                      before talking to trainer again
33554528	introduced to Xerina
33554529	introduced to Kradus


* registers are referred to in the file as $reg0$, $reg1$, etc.  Those are not the addresses.  The address is 16777216 + registerNum.  The upper limit is currently undetermined.
 
I've found that the player's ID or the conversation ID is realated to the NPC that the player is speaking to..

for example,

65629 is used to speak to NPC number 93 (the person who gives you the river pirate quest)
65632 is used to speak to NPC number 96 (Dranton)

in binary 65629 is 1 0000 0000 0101 1101
which is 1 0 93.
 
I've been trying to make Draton a recruitable hero...

1) You have to add these lines below to conversation.txt. Change the content of the dialogue if you desire.

I'd recommend that you insert at line 2 to make life easier..

2) Change the counter at the top of the file. Increment by 6(edited)

here is the code:sad:I gave him a padded cloth..... hope you don't mind :p)

96 0 0 Hello,_can_I_join_you? 1 0
96 1 0 Please? 2 0
65632 2 0 I_want_you_to_join_me. 3 0
65632 2 0 Not_right_now. 6 0
96 3 1 -2147483547 0 0 You_don't_have_any_room_for_me_in_your_party 6 0
96 3 0 Okay._You're_the_Boss. 6 3 10192 65 96 10203 96 0 10251 96 0
 
Back
Top Bottom