Mod: Attackable peasants

Users who are viewing this thread

Man, since I've installed the mod I haven't run into a single group of peasants in hours of playing. Has anyone else had this happen, or am I just experiencing some bad luck?
 
I had some minor sucess at adding new NPC to the tavern in zendar, just by mild modification of troops.txt. Here is what I've found so far..



marnid Marnid Marnid 528(unknown) 262164(location) 0(unknown) 1(unknown)
60 0 42 0 99 0 37 0 40 0 (<-items) -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0 -1 0(<-empty item slots?)
5 5 4 4 6(str, agil, int, cha, level)
69 74 61 66 65 64 (<-weapon proficiencies)
9007199288295427(skills?) 2097152(unknown) 0 (unknown)
1(hair and beard info) 89069327868562(face shape) 0 0(<-unknown)




1)The location number, 262164 in binary is..
100 0000 0000 0001 0100
Interpreting this as 8 bit parts gives the following.
4 0 20
Everyone(Marnid, Dranton, Kradus, Xerina) in the tavern has that 20 value, regardless of their position within the tavern. I've found that even slightest modification of that 20 result in missing character. I also found that the_happy_boar tavern is the 21st element in the sites.txt. Counting from 0, it is exatcly entry number 20. Coincidence? I think not.



2) I'am guessing that at the beginning of a new game, the game has to initialize every NPC's attributes skills etc.

For Marnid, 5 5 4 4 are the base attribute, but the game will further add some more points to them according to the level(6). His attriubutes at the beginning of a game is 7 7 6 6.

The "skill value" can be separted in to 14 4 bit parts and there are 14 skills total.
9007199288295427
10 0000 0000 0000 0000 0000 0000 0010 0000 0000 0000 0000 0000 0011
2 0 0 0 0 0 0 2 0 0 0 0 3

His actual skill levels in the game are;
Athletics 1, Riding 3, Inventory 2, Wound 1, Surgery 1, Trade 3

I need to test some more to be sure on this though..


3) Editing Hair value is very tricky, since it result in crash if a wrong value is in there. I will need to test more...


4)A question. I've been trying to add "Tell me about yourself" feature in my hero conversation.


226 0 0 What_do_you_want? 2 0
65762 2 0 You_look_like_a_sturdy_warrior,_would_you_like_to_join_me? 3 0
65762 2 0 errr,_I'll_be_going_now. 6 0
65762 2 0 Tell_me_about_yourself. 4 0
65762 4 0 Ok_then_listen_to_this... 11 1 10316 0 0
65762 11 0 What_else? 2 0
226 3 1 -2147483547 0 0 You_don't_have_any_room_for_me_in_your_party 6 0
226 3 0 Let's_go_kick_some_ASS!. 6 2 10203 226 0 10251 226 0


The conversation flows fine, but the "information screen" doesn't show up.
Anyone can figure this out? Thanks in advance.
 
Hmm, i found a problem with the mod. When you talk to the guy beside Marnid, the game does not give you an option to finish the conversation and you end in an endles loop of seeing his stats........

Just wanted to let you guys know..... :smile:
 
I've figured out some things. Here's a mod to show them off. Kradus, champion of the arena, will join you. BUT only if you can best him at single combat. I'll post the required changes here, explain them in bit, and see about hosting.

in Datamission_templates.txt:
change the first number from 7 to 8.

Add this to bottom of the file:



kradus_recruiting_fight 1
-1
_You_will_fight_a_match_in_the_arena._The_fighter_to_score_9_points_first_wins.
4 0 65552 1114303 16 1 1 65568 262335 16 1 2 65584 262335 16 1 3 65600 131263 16 1
0 2
0.000000 0.000000 100000000.000000 1 1006 0 0 2 11010 20 0 20029 33554529 3
0.000000 3.000000 100000000.000000 2 1005 1 0 -2147482642 0 0 4 20029 33554529 4 10203 97 0 10251 97 0 11010 20 0
[/quote]

Now, in conversation.txt, change the top number to 886 and replace the Kradus dialog (lines 152-156) with:


65633 0 1 2 33554529 0 Hello._You_must_be_of_the_fighters_in_the_games. 112 1 20029 33554529 1
97 112 0 One_of_the_fighters?_I_am_Kradus._Don't_tell_me_you_don't_know_my_name. 113 0
65633 113 0 Have_you_been_fighting_in_the_tournaments_for_long? 114 0
97 114 0 Long?_I_was_a_champion_when_the_arena_was_nothing_more_than_a_ring_of_dirt,_and_your_only_spectators_were_the_sorry-looking_horses_waiting_their_turn. 115 0
65633 115 0 Could_you_give_me_a_few_hints_about_fighting? 116 0
97 116 0 I_suppose_there_would_be_no_harm_in_that._After_all,_what_is_a_champion_when_there_are_no_decent_challengers?_My_favourite_weapon_is_the_lance._Give_me_a_lance_and_the_match_is_over_before_it_starts._Want_to_know_why? 117 0
65633 117 0 Sure. 118 0
97 118 0 The_lance_is_a_purely_offensive_weapon._You_can’t_use_it_for_blocking_enemy_attacks,_but_in_the_right_hands,_they_won’t_have_a_chance_to_swing_anyway,_as_it_has_a_longer_reach_than_any_other_weapon._The_best_way_to_use_the_lance_though_is_couching_it_under_your_arm_while_charging_on_horse_back._Once_your_horse_gains_speed_in_this_state,_its_full_power_concentrates_on_the_tip_of_the_lance._Nothing_will_stand_before_the_destructive_power_of_the_couched_lance._It_will_pierce_and_shatter_shields_and_deliver_great_damage_to_anyone_unfortunate_enough_to_be_on_its_way. 119 0
65633 119 0 Sounds_powerful_indeed._What_if_you_are_on_the_receiving_end_of_the_couched_lance?_What_would_you_do_to_defend_yourself? 120 0
97 120 0 You_can_not_block_it_obviously,_neither_with_a_sword_nor_a_shield._The_best_defense_is_to_stand_at_a_spot_where_your_opponent's_horse_can_not_come_to_you_at_a_full_gallop,_like_the_top_of_a_hill_or_behind_a_thick_tree._If_you_are_out_on_the_open,_the_best_defensive_strategy_is_to_run_sideways_hoping_that_your_opponent_can_not_maneuver_to_hit_you. 121 0
65633 121 0 Well_thanks_a_lot._That_was_really_helpful. 122 0
65633 121 1 -2147483638 33554529 2 Do_you_really_want_to_face_decent_challengers?. 502 1 20029 33554529 3
97 122 0 Good_luck_at_the_tournament_ground. 6 0
97 502 0 Aye_$lad/lass$,_I_do._Without_a_challenge,_how_can_a_man_truly_know_what_he_is_made_of? 503 0
65633 503 0 You_have_mastered_the_arena._Perhaps_your_challenge_lies_outside_the_city... 504 0
97 504 0 It_just_may,_but_I_won't_journey_under_some_captain_who_cannot_best_me. 505 0
65633 505 0 I_see._May_you_find_such_a_captain_some_day. 6 0
65633 505 2 20029 16777225 97 20034 4 0 Perhaps_you_would_like_to_try_my_mettle. 506 0
97 0 1 -2147483638 33554529 4 Hello_$playername$._I_hope_you_are_doing_well. 123 0
97 1 0 Do_you_want_me_to_rejoin_you? 123 0
97 0 1 11 33554529 4 Do_you_want_me_to_rejoin_you? 123 0
65633 123 1 10 33554529 2 Can_you_tell_me_about_the_couced_lance_again? 118 0
65633 123 1 -2147483638 33554529 2 Do_you_really_want_to_face_decent_challengers?. 502 1 20029 33554529 3
65633 123 3 11 33554529 3 20029 16777225 97 20034 4 0 Perhaps_you_would_like_to_try_my_mettle. 506 0
65633 123 2 -2147483538 97 0 11 33554529 4 Come,_rejoin_me. 507 0
97 506 1 -2147483547 0 0 Aye,_I_would,_and_I_would_join_you_if_you_bested_me._But_you've_no_room_in_your_party. 6 0
97 506 0 Aye,_I_would,_and_I_would_join_you_if_you_bested_me. 6 6 10261 20 0 10262 0 0 10263 16777216 0 10263 16777217 16777225 11011 7 0 11010 20 0
97 507 1 -2147483547 0 0 I_would_like_to_meet_more_challenges,_but_you_do_not_have_room_for_me. 6 0
97 507 0 I_would_like_to_meet_more_challenges! 6 2 10203 97 0 10251 97 0
65633 123 0 Thanks_Kradus._I'll_see_you_later. 6 0



The fact that Kradus's image doesn't dissapear from the overworld or the 4-ways inn after you have him rejoin you is a known issue. That may or may not be just a matter of mucking about with dialog stuff, and is non-critical. I figured it was more important to get out a working example of fight stuff today, rather than a perfected mod a week from now.
 
Hey Vinz, i just tried your mod and it works great, the only thing i found right now that doesnt work after changing the text, is when you try to sell something to the weapons guy in Zendar, you cant leave the conversation with him.
After i enter to buy something (For Kradus) I try to leave and i dont get any option to leave the conversation. Maybe it has something to do with the inserting of extra lines in the text and some of the numbers tell you where to go after an option in the text.
With the moving of the lines these texts now dont work anymore.....

Ah, im just rambling cause i dont understan much of this stuff, but maybe my input can help to find the errors! :smile:
 
Blade said:
Ah, im just rambling cause i dont understan much of this stuff, but maybe my input can help to find the errors! :smile:

Don't sell that aspect of it short. Having people look for bugs the original creator wouldn't think to look for is very important.

I'll be looking into why that stuff happens when I get a free moment.
 
Marnids and Borchas skills are randomized at the beginning of the game I think (they are always different). The stats seem to change less with Borcha but Marnids do change. The skills fluctuate wildly but Marnid always has trade and Borcha always has pathfinding, tracking and spotting (at random levels).

Just fyi
 
l33t haxors :wink: Im very impressed by your determination to reverse-engineer M&B! Hats off to you!
As for me ill just wait for some sort of editor =)
 
Excellent!

It won't be long now until we can recruit and train blunt-weapon troops for our, errm, 'human resources' project.
 
I little more info on troops.txt. Let's look at the first line for the caravan guard:

Code:
caravan_guard caravan_guard caravan_guard 184550400 0 224 8

The first number designates the upgrade path as well as a few other things. (0 bit is rightmost)

bit 0 = female (on for female, off for male)
bit 4 = npc or something. All the people in towns have this set as well as the kidnapped girl.
bit 9 = recruitable? Marnid and Borcha have this set.
bit 10 = mounted (on for mounted unit)
bit 11 = ranged (on for ranged attack)
bit 24-31 = 1st upgrade option
bit 15-23 = 2nd upgrade option

So converting our guard to hex gives you 0B 00 04 00, 0B = 11 which is the 0 based index in the file of the upgrade. If you look at the 12th unit listed in the file it is mercenary which is what the guard can be upgraded to. Also notice that bit 10 is set which means it is a mounted unit.

Looking at something like the swadian footman:

Code:
swadian_footman Swadian_footman Swadian_footman 353370112 0 96 8

353370112 = 15 10 00 00

15 hex = 21 dec and the 22nd unit is swadian man at arms
10 hex = 16 dec and the 17th unit is swadian infantry

And to add a little to what B wrote.

Code:
swadian_infantry Swadian_infantry Swadian_infantry 285212672 0 112 8
  146 0 141 0 108 ...
  5 5 4 4 20
 119 114 108 107 119 113
2417851652740057265078546 562949956567040 131072 
  1 1099645849737 4659 267976833957887

As B mentioned, the second line is items. They are the 0 based index in Dataitem_kinds1.txt.

147th item = pike
142nd = spear
109th = fighting_pick


He also mentioned that the location value (the second number) contains the 0 based index within sites.txt. Bit assignments:

0-7: index in sites.txt
8-15: ? (always 0 at the moment)
16-23: index of character in the same location

Code:
marnid Marnid Marnid 528 262164 0 1

262164 = 40014

The 4 just seems to be a unique number in the location. For example:

10014 = tavernkeeper
20014 = dranton
30014 = kradus
40014 = marnid
50014 = xerina
 
And some info on party_templates.txt

Code:
dark_hunters 2 5 139 71 4 42 0 72 13 25 0 -1 -1 -1 -1

dark_hunters = name of group
2 = ?
5 = faction (index in factions.txt)
139 = ?
71 = index in troops.txt of unit (72nd unit is dark_knight)
4 = minimum number in group
42 = maximum number in group
0 = delimiter it seems, there is always a 0 after a unit def
72 = next unit (73rd unit is dark_hunter)
13 = min
25 = max
etc...
 
Some initial info on item_kinds1.txt. I'll update this as I figure out more:

Code:
hand_axe hatchet 541073410 9223388529554358286 15 6 242 30198988800 25540427798 2580

hand_axe = name
hatchet = model
541073410 = info1
9223388529554358286 = ?
15 = equipment slot
6 = type
242 = base cost
30198988800 = info2
25540427798 = info3
2580 = modifiers

Equipment slot is a bit mask. Bit assignments (0 based from lsb):
0-3: the 4 "weapon" slots
4: helmet
5: chest
6: boots
7: horse
20: ? All merchandice including food have this set. Initially I thought this was for the food slot, but I'm not sure what it is

Type seems to be an enum for the general type of item:
3 = horse
4 = chest armor
6 = weapon
7 = boots
8 = shield
9 = helm
10 = xbow
11 = bow
12 = ammo
13 = goods

info1 = ? The only thing I've figured out is that if bit 4 (0 based from lsb) is set it looks like it will not be sold in stores.

info2 bit assignments (0 based from lsb):
0-7: head armor
8-15: armor (horse armor, chest)
16-23: leg armor
24-31: weight in quarter units (divide by 4 to get weight)
32-39: strength req

info3 bit assignments if its a weapon:
0-7: swing damage
8-15: other damage (thrust, bow, arrow, thrown)
16-17: swing damage type
18-19: damage type (thrust, bow, thrown)
20-27: reach / 2 (multiply by 2 to get the actual reach)
28-35: speed
36-43: ? (only set on ranged weapons)
44-51: quantity (food, ammo, etc)

damage types are 0 = cutting, 1 = piercing, 2 = blunt.

info3 when the item is a shield is just the shield durability

info3 bit assignments if its a horse:
0-7: riding req
8-15: speed
16-23: maneuver
24-31: charge

modifiers is a bit mask that defines the applicable modifiers. Each bit designates one of the 24 modifiers that can be applied to the item. So for example, arrows have a value of 8388616 or 0x800008 which has bit 4 and 24 on. If you look in item_modifiers.txt the 4th modifier is "bent" and the 24th is "large_bag".
 
And skills.txt:

Code:
trade 19 8 5 Every...

trade = name of skill
19 = info
8 = maximum level
5 = ?
Every... = description

The first 4 bits of info is an enum that defines the dependent attribute, 0 = strength, 1 = agility, 2 = intelligence, 3 = charisma. The 5th bit specifies if it is a party skill (on if it is a party skill). So trade = 19 which is 0x13. 3 = charisma and the 5th bit, 0x10, means it is a party skill.
 
Back
Top Bottom