Importing a tweak from VC to AWOIAF and changing it.

Users who are viewing this thread

so I did add a tweak on AWOIAF (game of thrones mod based on brytenwalda/VC) from kraggrim

this tweak add a dialogue with the lair captain to be able to recruit soldier directly.

this is the code(original one from kraggrim for viking conquest):

dlga_lair_captain:lair_captain_add_troops 69631 1142 0 Give_me_one_recruit. 1151 2 1610 3 648518346341351424 360287970189639680 1 1529 2 360287970189639680 50 0 NO_VOICEOVER

this is the code I modified to make it work in AWOIAF:

dlga_lair_captain:lair_captain_add_troops 69631 2665 0 Give_me_one_recruit. 2674 2 1610 3 648518346341351424 360287970189639720 1 1529 2 360287970189639680 50 0 NO_VOICEOVER

now I wanted to add multiple option but can't get it to work. It work with one option but when I try to add a second dialog It give me and RGL error bad file ending.
I carefully checked there a empty space in the end of voice over, and added the pattern still don't work (and of course edited dialogs counter on the second line of conversation.txt, as I said having only one option work perfectly, made it working and running could recruit and all, my problem is trying to add a second option)

(what I did)

dlga_lair_captain:lair_captain_add_troops 69631 2665 0 Give_me_one_recruit. 2674 2 1610 3 648518346341351424 360287970189639720 1 1529 2 360287970189639680 50 0 NO_VOICEOVER
dlga_lair_captain:lair_captain_add_troops.1 69631 2665 0 Give_me_one_recruit. 2674 2 1610 3 648518346341351424 360287970189639725 1 1529 2 360287970189639680 50 0 NO_VOICEOVER

and it give me RGL error when the game load conversation.txt

now I tried to do a little change with another code line to check if I doing something wrong
edited the simple code:
dlga_lair_captain:close_window 69631 2665 0 That'll_be_all. 6 0 NO_VOICEOVER

to:
dlga_lair_captain:close_window 69631 2665 0 That'll_be_all. 6 0 NO_VOICEOVER
dlga_lair_captain:close_window.1 69631 2665 0 That'll_be_all_test_ok. 6 0 NO_VOICEOVER

and it work, the dialogue is added and work.

but somehow dlga_lair_captain:lair_captain_add_troops I can't add the .1 pattern, even trying to use the exact same code, same troop id and all and only slightly modifying description and pattern, it still don't work.

so maybe I need to change dlga_lair_captain:lair_captain_add_troops configuration to be able to add .1? maybe its in another file?
I am pretty much stuck really.
 
Solution
having two custom dlga in conversation.txt

it was already explained? As I said its quite technical, so if you want to skip the why (hours of studying the compiler), just use a shortcut as mentioned above. Use a modsys like VC or Native, add your dialogs, compile it, run WinMerge to compare the changes in the files, and figure out from there what you need to hack your .txt
working with .txt edits can be quite complicated, as you need to follow the parse rules to the letter to not break a bunch of stuff. Its quite technical in nature.

for conversations.txt remember to increase the counter (second line), keep all the spaces as is, and pay attention to the masks used for troops, global variables, etc, which you will have to handle manually.

you can use a modsys to play with the dialogs and later "transplant" them to your mod, just remember to update the masked values.

masks come from
Code:
bignum = 0x40000000000000000000000000000000

op_num_value_bits = 24 + 32

tag_register        =  1
tag_variable        =  2
tag_string          =  3
tag_item            =  4
tag_troop           =  5
tag_faction         =  6
tag_quest           =  7
tag_party_tpl       =  8
tag_party           =  9
tag_scene           = 10
tag_mission_tpl     = 11
tag_menu            = 12
tag_script          = 13
tag_particle_sys    = 14
tag_scene_prop      = 15
tag_sound           = 16
tag_local_variable  = 17
tag_map_icon        = 18
tag_skill           = 19
tag_mesh            = 20
tag_presentation    = 21
tag_quick_string    = 22
tag_track        = 23
tag_tableau         = 24
tag_animation       = 25
tags_end            = 26

opmask_register             =  tag_register       << op_num_value_bits
opmask_variable             =  tag_variable       << op_num_value_bits
##opmask_string             =  tag_string         << op_num_value_bits
##opmask_item_index         =  tag_item           << op_num_value_bits
##opmask_troop_index        =  tag_troop          << op_num_value_bits
##opmask_faction_index      =  tag_faction        << op_num_value_bits
opmask_quest_index          =  tag_quest          << op_num_value_bits
##opmask_p_template_index   =  tag_party_tpl      << op_num_value_bits
##opmask_party_index        =  tag_party          << op_num_value_bits
##opmask_scene_index        =  tag_scene          << op_num_value_bits
##opmask_mission_tpl_index  =  tag_mission_tpl    << op_num_value_bits
##opmask_menu_index         =  tag_menu           << op_num_value_bits
##opmask_script             =  tag_script         << op_num_value_bits
##opmask_particle_sys       =  tag_particle_sys   << op_num_value_bits
##opmask_scene_prop         =  tag_scene_prop     << op_num_value_bits
##opmask_sound              =  tag_sound          << op_num_value_bits
##opmask_map_icon           =  tag_map_icon       << op_num_value_bits
opmask_local_variable       =  tag_local_variable << op_num_value_bits
opmask_quick_string         =  tag_quick_string   << op_num_value_bits
 
Upvote 0
first thanks for the fast answer kalarhan.
the thing is kraggrim only posted the code in plain text and I don't really get how to reproduce it with python in the module.py, never coded in python gonna have a bunch to learn...
and it work when there is one option, tried with multiple troop id it work like a charm, it make the error only when I try to have two option at the same time. (cause i want to be able to recruit multiple unit not only one).
I probably messing one number, but I don't get which one, also weird it work perfectly with one and not with 2 option
maybe the code was not made for multiple use in mind.
hopefully kraggrim put some light on it
thanks for the answer tho.
 
Last edited:
Upvote 0
never coded in python gonna have a bunch to learn...

its not Python, its MBScript (Mount Blade Scripting Language), which you can learn in the tutorial section.

To reverse the .txt code above to mbscript just open header_operations.py and go from there. Follow the syntax from module_dialogs.py explained on the comments at the start of the file.


Code:
2 1610 3 648518346341351424 360287970189639720 1

2: 2 operations on this block
1610: operation XXX from header_operations.py
3: has 3 parameters
648518346341351424 : use masks above to convert it
360287970189639720 : use masks above to convert it
1 : 1

and you have it on mbscript code
 
Upvote 0
ok so I got it, actually searching a bit.

I got what the problem. you can't add more than 1 custom dlga in conversation.txt

or atleast not without the source code of the mod, and AWOIAF creator didn't give sources code (those why I can't add two custom dlga.)
that what I understood. I did get what the codes meant, I could even make different character with different UI id have the same option. and it worked,
it really look like I just can't add more than one custom dlga even tho the two dlga could work at the same time, like if there was a limit.

that probably something I need to change in another file, I tried to add the customs dialogue id (lair_captain_add_troops) in dialogue dialog_states.txt to maybe make it seen by the game as not a custom dlga but an compiled one. but without success...

(for example I made the cook give me troops... and it worked: (
Code:
dlga_lair_cook:lair_add_troops 69631 2646  0 Give_me_100_Archer_for_twenty_thousand.  2647  2 1610 3 648518346341351424 360287970189639725 100 1529 2 360287970189639680 20000 0 NO_VOICEOVER
))

"648518346341351424" is the party id (its the same not matter what the mod)
"360287970189639680" is the player id
"360287970189639725" is the troop id.
"1610" is the "add_troop_to_party" command
"2646 + 2647" is the ui id
"lair_add_troops" is the custom dialogue id
"dlga_lair_cook" is the cook main dialogue ui id.
"100" the number of troop
"1529" is the "remove_money" command

"2" is number of operation
"3" number of parameter following

I nailed it, and again I could make it work with many character dialogue in the game, only not when there was more than 1 dialogue added, even if it was to different character



I tried to have both the option (both cook and captain) but not its just not possible, I have to remove one of the option or I get the error even if both work individually (when the other is not in the file).

the two code are working, and are right, the problem is that those two cannot be together even tho they have different dlga id.
so the only explanation is that the code are not recognized when there is more than one. maybe I need to add the custom dlga id to another file for the game to recognize and locate it normally.

that the thing I don't get how to do, I believe there is a way, I just don't get what file to edit, but that probably not in conversation.txt
maybe when there only 1 custom(new) dlga without set path the game get it.

(and of course, Like I said in previous post dialog count is not the problem each time I add a new dialog are add +1 to the dialog count.
also its not a problem with the empty space in the end of the line as I said in first post and take care of it in the begin, and if I would **** up on this I wouldn't be able to have even 1 option working. (also not updating dialog count don't make the game crash with rgl error, it just don't take the dialogue itself into account and you won't see it in the game.)


and thanks kalarhan for trying to help me!
 
Last edited:
Upvote 0
Please mark this thread as solved
but it was not solved? there probably a way to make two custom dlga work, and someone who maybe already did this could help me?
no one told its not possible, so I don't understand why would this thread be solved in any way but if someone explain why wouldn't it be possible?
if someone explain me why its not possible, having two custom dlga in conversation.txt. then I would mark it solved.
but that not the case.

but if you insist on it I won't go against the wall.
 
Upvote 0
having two custom dlga in conversation.txt

it was already explained? As I said its quite technical, so if you want to skip the why (hours of studying the compiler), just use a shortcut as mentioned above. Use a modsys like VC or Native, add your dialogs, compile it, run WinMerge to compare the changes in the files, and figure out from there what you need to hack your .txt
 
Upvote 0
Solution
Hi,
Rather than Tweak
Is there any link to get AWOIAF v7.xx source code/module system
This makes your work with no error
 
Upvote 0
Back
Top Bottom