Modding VC: basic tutorials and Q&A thread

Users who are viewing this thread

No "luck" here, read i'm imcapable to provide the according files and path.

What i did:
- Dl'ed modsys 2.028, dl'ed and installed Python 3.x for x32 sucessfully, although my OS is Win10/64, but i wasn't sure enough about the diverse Python dl sources. Guess though, that this Python version (the newest) works as well, with MB and VC?
- Have put the VC Source folder into the Warband main directory folder.
- Changing the two files from the Source folder, as descibed by you, with Notepad++ - easy enough, not a thing as i do such editing for ages.
- Changed module_info.py, so the path for the Source folder is set to my modfolder.
- Just launched the game, and no according changes are present.

What do i missing that the changed files get linked to the modfolder files?
 
kraggrim ?️ said:
I'm guessing it's mbsrc.fx, but I've not been able to find that particular part (it's seemingly in a different coding language and is quite difficult to interpret.

I don't play much with shaders, but you could try changing the equations (Values) for snow (in special the snow_amount variable). Or check the Forge Q&A, as the file uses the same base system as Warband and you should have more luck there, as the shaders for VC were created by @LA_GRANDMASTER, not BW team IIRC.
 
Unfortunately snow_amount only appears in the part for changing map icons and map trees afaik. I found the bit that seems to work with in-scene snow adding too. But the map snow distribution still eludes me. I'll keep poking  around and ask in the other thread. Cheers kal.
 
So thanks to kalarhan's and kraggrim's help, i was able to achieve a proper mod into my desired direction, and playtesting that the recent days (error-less, at least).

Few questions remain to make it perfect, so to speak. Hope to get answers here.

1. Stats modding stuff (using Morgh's tool on .txt files, after the modded file setup with modsys)

1.1 "Can't be used to block" ... here i modified all langseax and broadseax items according to swords that they can parry (block) like swords. In-game but, the former hint does not disappear. Besides this change, i did a lot of stuff with Morgh's tool sucessfully in the possible .txt applications, just this "block"-change for items does not work properly, it seems. Do i miss something?

2. Strategical stuff (using just the modsys source files to create the according output)

2.1 Which .py files correspond with which .txt output files? I mean, i would like to know exactly, which output files i have produced modified (as the bat application just produces the full file set).
Is there a source where i can find that? Or is it that easy like troops.py -> troops.txt etc., or is there more linking?
I think this question is very important, because when i'm doing step by step modding, as here explained, first modsys then with Morgh's tool different .txt stuff, and i wanna change but files which can't be changed with Morgh's, ie. strategical (scripted) stuff, i have kinda a problem? The solution would be to save the according .txt files changed with Morgh's and re-add these, when i modify/ied .py files afterwards, i guess. Just which ones is my question (needs an exact file knowledge about .py file output links).

2.2. Which file or code is determining, that faction relations are random set up at game start? Wanna perhaps disable that (how?) and modify faction relations to certain alliances and wars (will find that, probably, in factions.py file? ... as of yet, i know oly the according numerical codes from the factions.txt file).
2.2.1 Would it be possible to keep faction relations for a certain time, not just for the game start alone, via script that sets dates, if so, how?

2.3 In-game message "concerned because ... growing power ... declares war ..." guess you know what is meant. Is it possible to disable this casus belli auto-mechanic? If so, how?
 
DaVincix said:
Few questions
1. Stats modding stuff (using Morgh's tool on .txt files, after the modded file setup with modsys)

1.1 "Can't be used to block"

2. Strategical stuff (using just the modsys source files to create the according output)

2.1 Which .py files correspond with which .txt output files?

2.2. Which file or code is determining, that faction relations are random set up at game start?

2.2.1 Would it be possible to keep faction relations for a certain time, not just for the game start alone, via script that sets dates, if so, how?

2.3 In-game message "concerned because ... growing power ... declares war ..."

1) instead of Morgh's just edit the module_items.py, you can see the flags there
2.1) not that easy, as some changes will affect multiple files. So you can't just assume a 1:1 relation if you don't know how the compiler works
2.2) module_scripts.py, see "game_start" and hunt down the code that is responsible for the random relations
2.2.1) see 2.2 and then study how diplomacy scripts work, as you will need to add exception rules there (see Forge tutorials for how to work with MBscript)
2.3) see module_simple_triggers.py, search for "restaurar faccion chief". If you are looking for something else: copy the exact text and do a full text search on your modsys files
 
As always, appreciating the quick reply  :!:


One important question to
2.2) module_scripts.py, see "game_start" and hunt down the code that is responsible for the random relations

if module_scripts.py is changed, which .txt files are affected?

I know you said, i should use solely the modsys and not at all Morgh's, but now it's rather too late, i don't (wanna) plan to make all Morgh-changed .txt files anew with .py files (it's much too much).

Btw., i  find Morgh's tool very comfortable. As i re-found it / re-applied it now, i remembered that i used it a lot with Warband/Brytenwalda, with joy.
 
DaVincix said:
if module_scripts.py is changed, which .txt files are affected?

kalarhan said:
not that easy, as some changes will affect multiple files. So you can't just assume a 1:1 relation if you don't know how the compiler works

could be only scripts.txt, or several files. To learn the why and how you would need to explore the compiler (which requires basic Python know-how) and check how the process_XXX.py work.
 
And for the described faction relations stuff alone? Is it more than scripts.txt?

I don't plan to dive into the depth of the compiler.

Edit: Hm, it starts to be pretty complicate ... wanted to avoid such a situation :wink: ... perhaps i can (or should) live with what changes i did as of yet.
 
kalarhan said:
DaVincix said:
Few questions
1. Stats modding stuff (using Morgh's tool on .txt files, after the modded file setup with modsys)

1.1 "Can't be used to block"

2. Strategical stuff (using just the modsys source files to create the according output)

2.1 Which .py files correspond with which .txt output files?

2.2. Which file or code is determining, that faction relations are random set up at game start?

2.2.1 Would it be possible to keep faction relations for a certain time, not just for the game start alone, via script that sets dates, if so, how?

2.3 In-game message "concerned because ... growing power ... declares war ..."

1) instead of Morgh's just edit the module_items.py, you can see the flags there
2.1) not that easy, as some changes will affect multiple files. So you can't just assume a 1:1 relation if you don't know how the compiler works
2.2) module_scripts.py, see "game_start" and hunt down the code that is responsible for the random relations
2.2.1) see 2.2 and then study how diplomacy scripts work, as you will need to add exception rules there (see Forge tutorials for how to work with MBscript)
2.3) see module_simple_triggers.py, search for "restaurar faccion chief". If you are looking for something else: copy the exact text and do a full text search on your modsys files

As for no. 2.3, that was for the Rebellion case. I instead looked for the "balancing" casus belli "alarmed ... curb power", which i found in scripts as well. Disabling the according lines worked: This war declaration is not anymore active in my mod.


Another question: Is it known by the community, what the hair-disappearance under certain helms causes?
 
DaVincix said:
I instead looked for the "balancing" casus belli "alarmed ... curb power", which i found in scripts as well. Disabling the according lines worked: This war declaration is not anymore active in my mod.
Be aware that casus belli is the mechanism for causing wars between random factions. If you shut down the mechanism rather than just the message, then factions won't war as much with one another.
 
motomataru said:
DaVincix said:
I instead looked for the "balancing" casus belli "alarmed ... curb power", which i found in scripts as well. Disabling the according lines worked: This war declaration is not anymore active in my mod.
Be aware that casus belli is the mechanism for causing wars between random factions. If you shut down the mechanism rather than just the message, then factions won't war as much with one another.

Thanks for the hint, moto. What do you mean with "rather than just the message"?
Just disabling the random wars as balancing act along "curb growing power" was the purpose of the change, as such a script property is too much of free gameplay for me within the historical setup, that VC provides in general.


Bit more about the theme of (random) wars:
In Warband and upcoming Bannerlord, i'm fully okay with such random stuff. For VC, i prefer something closer to historical events. For me, ideally, VC would have a scripted historical timeline all along the Great Heathen Army, between 867 and fe. 878 AD.

In my mod, where all the random war start-setup is disabled and with my faction relations setup, it seems to work halfway good now along what i desired for an immersive play, that is not totally ahistorical.
Ie. Wessex and Mercia go into alliance rather than war each other as happened in vanilla, same for Danmark and Northumbria., which usually fight each other in vanilla. Such things in vanilla are wholly immersion destroying for me. Now i observe the historical conflicts, just Anglo-Saxons vs Norse, where Anglo-Saxons are under good pressure. Besides this, the other conflicts are mere a sideshow for me, while i also didn't like it when in vanilla, fe. Brycheiniog as one-town faction declares war to Northumbria and such similar things. A campaign AI script should be imo. more like: A big agressor attacks, the small realms ally with each other, while historical facts should be conditions.

EDIT

My further playtesting showed that the "...alarmed...curb power..." casus belli is still active in my mod. As said, i disabled the according lines in scripts.py.
Anybody an idea what i'm missing?

Although, this casus belli appeared as of yet with factions, where i don't mind it. Well, i would like to know the thing out of principle and will think about then, if i disable it completely or not.
 
Making a more historical experience? That's a cool project...

The purely random war mechanism may be found in simple_triggers.py by the comment, "ramp up border incidents."

All other casi belli can be found in the giant script_npc_decision_checklist_peace_or_war. The "growing power" casus section is under the comment, "Attack strongest kingdom." There is a tendency to attack dissimilar cultures tracked by variable, cultural_antipathy.

I doubt one could find these things easily in the .txt files. Have fun!
 
I guess this is a VC-specific question, so I'll post it here.

So far as I know, faction troops have various body types (ie; troops are different heights, randomly)

And yet if one looks at module_troops.py, faction troops don't seem to have any such variable set for them. How does this work? Or am I wrong and do all troops have the normal body type?
 
Fearg said:
faction troops have various body types (ie; troops are different heights, randomly)

height in VC is controlled by the skin (module_skins.py). Default Warband uses this for male/female, while VC has tall man, normal man, short man, kids, and the females versions.

Code:
["npc6","Bodo","Bodo",tf_alto|tf_hero|tf_unmoveable_in_party_window, 0, reserved,  fac_commoners,[itm_hoodtunic_02,itm_carbatinae_1,itm_javelin, itm_long_light_spear2],
    str_14 | agi_11 | int_10 | cha_14|level(9),wpex(111,91,91,91,91,91)|wp_firearm(91),
   knows_ironflesh_7|knows_power_strike_7|knows_power_throw_7|knows_maintenance_3|knows_weapon_master_5|knows_athletics_5|knows_riding_4|knows_trainer_5|knows_tactics_5|knows_inventory_management_4|knows_first_aid_2|knows_persuasion_7|knows_leadership_7|knows_trade_1|knows_shield_3,
  0x00000004b40c628d45188ce8ae8e592300000000001d9c9b0000000000000000], #chief acabado
  ["npc7","Dwywei","Dwywei",tf_female|tf_hero|tf_unmoveable_in_party_window, 0, reserved,  fac_commoners,[itm_ptunic_6woman,(itm_womenshoes_3, imod_ragged), itm_hunting_crossbow, itm_bolts, itm_knife],
    str_10 | agi_12 | int_12 | cha_12|level(7),wpex(91,72,91,72,95,72)|wp_firearm(91), #chief acabado
   knows_ironflesh_3|knows_power_strike_4|knows_power_throw_5|knows_power_draw_5|knows_maintenance_2|knows_weapon_master_6|knows_athletics_6|knows_riding_5|knows_looting_6|knows_inventory_management_5|knows_wound_treatment_4|knows_surgery_2|knows_first_aid_5|knows_persuasion_7|knows_leadership_5|knows_trade_3|knows_shield_2,
   0x000000002d00600212ae47566c71d88b00000000001e3dec0000000000000000], #moto
  ["npc8","Reginhard","Reginhard",tf_bajo|tf_hero|tf_unmoveable_in_party_window, 0, reserved,  fac_commoners,[(itm_phrygian15, imod_ragged), (itm_btunic_5woman,imod_tattered), (itm_carbatinae_vc1s, imod_ragged), (itm_long_light_spear2, imod_cracked),itm_seax_4, (itm_javelin, imod_bent)],
    str_11 | agi_15 | int_10 | cha_10|level(12),wpex(91,73,125,91,72,91)|wp_firearm(91), #lo conoce en la taberna en la quest principal
   knows_navigation_2|knows_ironflesh_5|knows_power_strike_5|knows_power_throw_5|knows_power_draw_3|knows_weapon_master_6|knows_athletics_6|knows_riding_2|knows_looting_7|knows_tracking_5|knows_tactics_2|knows_pathfinding_7|knows_spotting_3|knows_inventory_management_5|knows_first_aid_3|knows_persuasion_3|knows_leadership_3|knows_trade_5|knows_shield_2,
   0x0000000d6e040b037ae68dd5b4f5532c00000000001e34da0000000000000000], #chief acabado

note the tf_XXXX flag used on the companions. like "tf_alto", "tf_female", "tf_bajo"

as usual you should check the header_XXX.py for the file you are changing. For troops, that is header_troops.py

Code:
#body types implemented so far
tf_male              = 0
# tf_female            = 1  already speced
tf_alto              = tf_tall  #2
tf_alta              = tf_tall | tf_female  #3
tf_bajo              = tf_short #4
tf_baja              = tf_short | tf_female  #5
tf_nino              = tf_child #6
tf_nina              = tf_child | tf_female  #7
tf_oso               = tf_fat #8
tf_osa               = tf_fat | tf_female  #9
tf_undead         = 10
 
My question was more specifically about generic troops, I understand how it works for companions, but none of the generic troops have the tf_XXXX flag, and yet they appear to have variance in height ingame. Do these kind of flags "swadian_face_younger_1" have height variance built into them?
 
Fearg said:
have variance in height ingame

as explained above the height is a function of skin/gender/type, so check how the operation that controls that value is applied to soldiers and you have your answer

Code:
common_battle_init_banner = (
  ti_on_agent_spawn, 0, 0, [],
  [
    (store_trigger_param_1, ":agent_no"),
    (agent_get_troop_id, ":troop_no", ":agent_no"),
    (call_script, "script_troop_agent_set_banner", "tableau_game_troop_label_banner", ":agent_no", ":troop_no"),
    ####    # alturas chief, activar si queremos adiferentes alturas en batalla
    (get_player_agent_no, ":player_agent"),
    (try_begin),
      (neq, ":agent_no", ":player_agent"), #no player
      (neq, ":troop_no", "trp_sea_raider_leader"), #berserker
      (neq, ":troop_no", "trp_looter_leader"), #Ulfhedinn
      (neq, ":troop_no", "trp_troll_bridge"), #troll
      (neq, ":troop_no", "trp_elf_riddles"), #elf
      (neq, ":troop_no", "trp_mountain_bandit_leader"), #enemy
      (neq, ":troop_no", "trp_thiaderd"), #thiaderd
      (neq, ":troop_no", "trp_caliacas_son"), #troop
      (neg|troop_is_hero, ":troop_no"),
      (troop_get_type, ":gender", ":troop_no"),
      (eq, ":gender", 0), #male
      (store_random_in_range, ":rand", 0, 2),
      (val_mul, ":rand", 2),
      (troop_set_type, ":troop_no", ":rand"), # next agent spawned will be tf_male, tf_alto or tf_bajo
    (try_end),
    ##    #
])
 
motomataru said:
Making a more historical experience? That's a cool project...

The purely random war mechanism may be found in simple_triggers.py by the comment, "ramp up border incidents."

All other casi belli can be found in the giant script_npc_decision_checklist_peace_or_war. The "growing power" casus section is under the comment, "Attack strongest kingdom." There is a tendency to attack dissimilar cultures tracked by variable, cultural_antipathy.

I doubt one could find these things easily in the .txt files. Have fun!

That helps, thanks moto!

Why ".txt files"? Such changes i'm doing within the .py files.

EDIT

Well, found comment Attack strongest kingdom in line 52050. I'm not sure what to disable from up this line.

Moto, can you make a change-suggestion, which comes close to my idea for a less random war/peace/truce play, within the according code?

In effect, that afterwards a factions.txt relations adjustment would be handled by the AI more along its edited values.
That would be esp. that a) Anglo-Saxon factions don't war each other, that b) Norse factions don't war each other, but tendentially ally with each other.

Comicably, in my current mod state, that happens already in-game after a few days in the game (probably due to edited scripts.py lines and factions.txt), but surely, that is not a stable faction relations status.
So i'm looking for a code (or disabling code lines), which would rather ensure, that the historical conflicts play out over years.

Besides this, the "alarmed...growing ...curb power" casus belli should not appear anymore in addition with such changes, at least not within/between Anglo-Saxon factions and within/between Norse factions.

Edit: I stopped modding the game (lost passion to fiddle with the files); and it already plays good enough.
 
Back
Top Bottom