Modding VC: basic tutorials and Q&A thread

Users who are viewing this thread

kalarhan said:
that was just one suggestion. Download [VC Tweaks Tool] and follow the steps of the post above.

If I'm editing my own files using the modsys, how do I know where to find your code in the tweaked source files? I know for the simple value-changing tweaks I can just search the tweaked source for the variable (e.g. 'TWEAK_MIN_TROOPS_TO_LOOT_VILLAGE') but I'm not sure how I can find the code to stop companions for leaving.
 
I've scoured the forums looking for this, but haven't found an answer to my question: how would one change the VC skeletons/human models to that of Native? It should be possible, as the popular awoiaf mod, which is built upon VC, has native models instead of the VC ones.

I understand that if one were to implement Native models into Viking Conquest, one would also have to change the armor, of that I believe I am capable of doing.

Otherwise, I've tried looking around the VC folder files, but I'm at wit's end and thought perhaps someone more adept with editing would know.
 
@ GarlicWatermelon

Have you tried " skeleton_bodies.xml "  in the Data folder of the Mod? I am looking for the same thing but have not yet tried working around it. Since still looking into other things.

If you succeed, can you post you coding or the entire new file, thank you.

But youre right, they rescaled all the Armour and other Equipment so you might need to scale the Equipment in order that it fits again.


Cheers,

Hope it helps.  :mrgreen:

 
GarlicWatermelon said:
awoiaf mod, which is built upon VC, has native models instead of the VC ones

AWOIAF uses some of VC code (scripts or features), it is not built upon it (assets).

Remember to read the permissions thread to know what you can (and cant) do with VC for modding.

LAST_ACTION_HERO said:
skeleton_bodies.xml in the Data folder of the Mod

this. That file translates the body measures (bones) used in the models. Just as you mentioned it will affect the game (3D assets for characters like armor, etc).

remember that module_skins.py is also used (for example to control the scale for kids).
 
LAST_ACTION_HERO said:
Have you tried " skeleton_bodies.xml "  in the Data folder of the Mod?

kalarhan said:
Remember to read the permissions thread to know what you can (and cant) do with VC for modding.

That file translates the body measures (bones) used in the models. Just as you mentioned it will affect the game (3D assets for characters like armor, etc).

remember that module_skins.py is also used (for example to control the scale for kids).

Thanks for the replies both of you. I've tried editing the skeleton_bodies.xml file in the past, and maybe I'm not editing it properly, but changing the number values don't seem to effect any of the skeletons in game. In fact, if I'm reading these files correctly, I believe that Viking Conquest and Native share the same values. For example:

Native:

<Bone name="hb_abdomen" bone_mass="10"> <Bodies> <body type="capsule" radius="0.14" pos_x="-0.04" pos2_x="0.04" pos_y="0.08" pos2_y="0.08" pos_z="-0.03" pos2_z="-0.03"/> </Bodies> </Bone>

Viking Conquest:

<Bone bone_mass="10" name="hb_abdomen">
    <Bodies>
      <body radius="0.14" pos_x="-0.04" pos_y="0.08" pos_z="-0.03" pos2_x="0.04" type="capsule" pos2_y="0.08" pos2_z="-0.03"/>
    </Bodies>

    </Bone>


This is the case for all the other parts, thigh, spine, shoulder, forearm, etc. It would seem the only difference is the formatting, VC follows a more coherent and streamlined writing style. I have noticed that Viking Conquest's skeleton_bodies.xml does include a section called <Skeleton name="skel_human_reduced">, however, it has the same values as the regular <Skeleton name="skel_human"> section:

  <Skeleton name="skel_human_reduced">
  <Bones>
    <Bone bone_mass="10" name="hb_abdomen">
    <Bodies>
      <body radius="0.14" pos_x="-0.04" pos_y="0.08" pos_z="-0.03" pos2_x="0.04" type="capsule" pos2_y="0.08" pos2_z="-0.03"/>
    </Bodies>

    </Bone>


I'm guessing this might be for skeleton references for kids? I haven't looked into this in particular, and I'm reluctant to touch it.

That being said, how would I even change the values of VC skeletons to match those of Native, if they already share the same values? I thought I'd use the Native code or even the AWOAIF ones as reference to editing the VC bodies, but since they have the same numbers I don't think reducing or increasing them would help?



How much of this is reliant on the python scripts? Would I have to edit those alongside the skeleton_bodies.xml to see actual change in game? I'll read through the guides relating to the Module System, but knowing what it does specifically beforehand could help give me an idea of what to look for.

I'm assuming it's not as simple as just changing the numbers around in skeleton_bodies.xml, as I can't see any physical changes. Might there be something else? For example, the way the facial textures are mapped onto the head models are also different, Native and VC have different structures that trying to use one texture for another results in everything looking displaced and wrong. I could just be saying completely wrong things due to my lack of knowledge, but after editing around for a couple of hours nothing has actually changed in-game.

Otherwise, I'll try my best hand at following any advice and fiddling around with editing/learning things, and ask anymore questions I haven't already found the answers to. There's just a lot to read with various guides that may or may not be relevant to what I want to mod; it's all very fun and interesting but also intimidating. Once again, I appreciate the responses.
 
GarlicWatermelon said:
How much of this is reliant on the python scripts?

not much, you will mostly need to update/replace the models (using OpenBRF and 3D tools), and keep the .xml and skins file consistent.

if you need further help you can visit the Forge.

Cheers
 
kalarhan said:
not much, you will mostly need to update/replace the models (using OpenBRF and 3D tools), and keep the .xml and skins file consistent.

Oh dear, it seems I'll have to do a fair bit of research and browsing through old threads/guides to know what I'm getting myself into.

I'm still not entirely sure what I need to edit with skeleton_bodies.xml, and I'll try and look into module_skins.py. Later on, would skins.txt be relevant? Using openbrf tells me that skins.txt is used by materials_face_gen.brf, and if I want to use Native skeletons I'd also have to use different faces. But I my be getting ahead of myself.

Sorry to be repetitive, I'm feeling a bit lost but I'll refrain from asking too many questions until I've done my proper research.
 
GarlicWatermelon said:
Later on, would skins.txt be relevant?

sure, the skins file also has info on stuff like hair and beards and faces, which are models/materials/textures defined on BRF files, so they are connected.

one thingy you may be missing is the relation between models and the game code (modsys). If you try to combine Native (and mods) models with VC then you would need to rework those. If you try to use VC models on a Native base assets you would need to rework the VC ones. If you abandon all VC models (for characters) then you wont have much to worry about, but you will only have access to whatever assets you have from Native/mods.

in other words, it would be easy to take Native and put VC features on it (features, not armor/helmets/etc).

Forge has the tutorials and references to learn more about it.

Cheers
 
kalarhan said:
sure, the skins file also has info on stuff like hair and beards and faces, which are models/materials/textures defined on BRF files, so they are connected.

one thingy you may be missing is the relation between models and the game code (modsys). If you try to combine Native (and mods) models with VC then you would need to rework those. If you try to use VC models on a Native base assets you would need to rework the VC ones. If you abandon all VC models (for characters) then you wont have much to worry about, but you will only have access to whatever assets you have from Native/mods.

in other words, it would be easy to take Native and put VC features on it (features, not armor/helmets/etc).

Alright thanks again for the info. My hope is to replace every VC model, be that npc/unique character/companion/lord, with Native skeletons and using modded skins, for example, from Vikingr or AWOIAF. In turn, I'd hoping to replace all the VC gear/equipment with Native/Modded models, that is if I can figure out what I'm doing with the skeletons. Nothing should be changed gameplay-wise, only the look and appearance of soldiers and their gear.

And naturally I'll get the proper credit/permissions for OSPs used.
 
Hårfager said:
Hey fellas. I am gonna make a custom sail. what program should i download in order to open the files and modify the sail?

see the .txt file on "[game folder]\Modules\Viking Conquest\Your custom Sails". You need a program that can handle the .psd / .dds files like Photoshop (or any alternative like GIMP and PAINT.NET with plugins)
 
A few questions:

1. I've been trying to add all missing family relations to the game, but I run in a problem right at the start. The code I'm using is
Code:
#Sigurd brother relations
	  (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_14"), #Ubba
	  (troop_set_slot, "trp_knight_8_14", slot_troop_guardian, "trp_knight_1_5"), #Ubba
      (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_2"), #Rathbarth
	  (troop_set_slot, "trp_knight_8_2", slot_troop_guardian, "trp_knight_1_5"), #Rathbarth
      (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson
	  (troop_set_slot, "trp_knight_8_13", slot_troop_guardian, "trp_knight_1_5"), #Ivar the Boneless Ragnarsson
	  #Ubba brother relations
      (troop_set_slot, "trp_knight_8_14", slot_troop_guardian, "trp_knight_8_2"), #Rathbarth
	  (troop_set_slot, "trp_knight_8_2", slot_troop_guardian, "trp_knight_8_14"), #Rathbarth
      (troop_set_slot, "trp_knight_8_14", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson
	  (troop_set_slot, "trp_knight_8_13", slot_troop_guardian, "trp_knight_8_14"), #Ivar the Boneless Ragnarsson
	  #Rathbarth brother relations
      (troop_set_slot, "trp_knight_8_2", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson
	  (troop_set_slot, "trp_knight_8_13", slot_troop_guardian, "trp_knight_8_2"), #Ivar the Boneless Ragnarsson
I used several variations and this one is the latest where I'm trying to use the back-and-forth logic of spouses. However, no matter how I format the code, only Ivar has all his siblings - and his siblings have him as a brother, but don't have each other. So Rathbarth isn't recognized as Sigurd's brother, but he recognizes Ivar as a brother, just like Sigurd recognize only Ivar as a brother. What's wrong with my usage of "slot_troop_guardian"?

2. So far I refrained from adding Halfdan's family relations. How catastrophic would be for the ruler of a faction to have a family? Why they don't have any as a rule?

3. I'd like to integrate the mods from http://forums.taleworlds.com/index.php/topic,328368.msg7758570.html, more specifically Kalarhan MapNode and WorldMap by Rubik, as I like to at a glance know how's the political situation (also knowing what's the lord personality type helps when picking up lords that you want to get high relations with). Problem is, it's designed for WRECK (which comes with a  bunch of vanilla stuff for the full install and doesn't support plugins for the drag and drop install) and it's outdated. I'm assuming the latter won't be much of a problem but could I integrate the mapmod and the AI Lord personality info directly in the basic VC compiler, without WRECK, and how would I approach this?

Thanks for any help.
 
zakarum said:
1. I've been trying to add all missing family relations to the game, but I run in a problem right at the start. The code I'm using is

a slot only accepts one numeric value. So when you do this
Code:
 (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_14"), #Ubba
 (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_2"), #Rathbarth
the first one is removed from memory, and only the second is saved for later use. Similar to a variable (just one that is stored in the savegame, not just in-memory).

guardian slot is used for the relation between a lord and a maiden, so you know who to ask permission for marriage. The unmarried lady has XXX as her legal guardian (father, brother, uncle, ...)

you have slots to define the father and mother of a troop. You will need to test how it works with multiple siblings (more than 2).



2. So far I refrained from adding Halfdan's family relations. How catastrophic would be for the ruler of a faction to have a family? Why they don't have any as a rule?
no particular reason other than Native (Warband game) decided that. You can change it of course. Will require testing for gameplay side-effects. Remember that by default the player cant marry the king's daughter.



specifically Kalarhan MapNode and WorldMap by Rubik
you could convert VC to WRECK format (which is not hard). You can translate my old code to MBScript (which is also not hard). The code should still work on latest VC, just adapt any UI button location if needed it.

 
Well I tried the "unique-identifier" format before, which looked like this

Code:
 #Sigurd brother relations
	  (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_14"), #Ubba
      (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_2"), #Rathbarth
      (troop_set_slot, "trp_knight_1_5", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson
	  #Ubba brother relations
      (troop_set_slot, "trp_knight_8_14", slot_troop_guardian, "trp_knight_8_2"), #Rathbarth
      (troop_set_slot, "trp_knight_8_14", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson
	  #Rathbarth brother relations
      (troop_set_slot, "trp_knight_8_2", slot_troop_guardian, "trp_knight_8_13"), #Ivar the Boneless Ragnarsson

The result is the same - only Ivar has brothers. I also tried adding the 3 different brothers to each brother entry. Same result. I understand what you are saying but I'm still at a loss as why only Ivar has brothers. While it's usually used for the relation between a lord and a maiden, the code says that
#Usually siblings are identified by a common parent.This is used for brothers if the father is not an active npc. At some point we might introduce geneologies
. There's also a slot_troop_sibling that seems deprecated and no mods uses it, so I didn't try using it.
The easier alternative would be to put a father for the troops since it seems they all recognize their sister because they have a mother but not each other because they don't have a father, but the father's dead and I don't suppose there's a way to add a dead actor - one that gives them the bound but doesn't appear on the map.

I guess I will try to change VC to WRECK format, it would be the alternative with the most benefits I guess, though I'm fairly new so "not hard" would fall on "hard" to me, considering I can't even get some siblings to identify each other.

Thanks for the help.

EDIT:

Maybe VC to WRECK isn't as easy as I thought.

Code:
Loading module... FAILED.
MODULE `scripts` ERROR:
Traceback (most recent call last):
  File "compile.py", line 109, in <module>
    from module_scripts import *
  File "C:\Users\x\Desktop\VC WRECK\integrated_ms\module_scripts.py", line 15, in <module>
    from module_items import items
  File "C:\Users\x\Desktop\VC WRECK\integrated_ms\module_items.py", line 3714, in <module>
    append_noswing_items(items)
  File "C:\Users\x\Desktop\VC WRECK\integrated_ms\headers\header_items.py", line 410, in append_noswing_items
    add_item = deepcopy(items)
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 237, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 230, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 237, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
  File "C:\PYTHON26\LIB\copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\PYTHON26\LIB\copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\PYTHON26\LIB\copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "C:\PYTHON26\LIB\copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\PYTHON26\LIB\copy.py", line 174, in deepcopy
    y = copier(memo)
TypeError: __call__() takes exactly 4 arguments (2 given)


COMPILATION FAILED.

It's python 2.7 despite being in the 2.6 folder. I can't figure out what arguments are missing from deepcopy and why it would work in the normal compiler and not in WRECK.
 
zakarum said:
Well I tried the "unique-identifier" format before, which looked like this
like mentioned above that wont work, it is like saying

a = 1
a = 2
a = 3

What is "a" value? Answer is 3.

It's python 2.7 despite being in the 2.6 folder. I can't figure out what arguments are missing from deepcopy and why it would work in the normal compiler and not in WRECK.
if you want help WRECKing VC modsys then open a new thread (either in the Forge or on VC forum). You need to be clear on what modsys you are using (VC vanilla version x.xx, a submod, the tweaks tool x.xx, etc), and then post all issues you have like you did above.

as a alternative if you need help with the WRECK to MBScript on the old add-ons you can do the same (create thread, post all the info, etc).

a open source tool WRECKER is available to help you (I never used it, just linking) https://forums.taleworlds.com/index.php/topic,361385.0.html

Cheers
 
Oh, I get it now. You are telling me a troop can only have one guardian. That means that A can be brother of B and B can be brother of C and C can be brother of D, but in this scheme C wouldn't be brother of A and D wouldn't be brother of B because they have their slots filled. The guardian-brother system would support at max 3 fatherless or motherless siblings. I just tested what you said and it's unfortunately true, using this I can only make 3 siblings but I have 5, which means the only way I can get everyone relations right in this case would be making a lord that is the father of them all. I will ask on the forge if I can make an invisible lord or a dead lord for this, thank you very much for all the help and thank you for the tip on the WRECKER tool.
 
Maybe a modder with some experience, as I'm struggling to convert the VC sourcecode to WRECK even with the WRECKER hahahaha
I supposed I will try to do it now that you gave some hints on how to do it, but I'm guessing it will be a trainwreck if I try to change module_simple_triggers and module_scripts at the same time to add it.

EDIT:
Managed to find a solution that doesn't go over slot_troop_guardian or slot_troop_sibling. I think.
While perusing the modules_script.py to understand them better and implement what motomataru suggested, I stumbled over this:

Code:
(else_try),
        (gt, ":father_of_1", -1), #necessary, as some lords do not have the father registered
        (eq, ":father_of_1", ":father_of_2"),
        (assign, ":relation_strength", 10),
        (try_begin),
          (eq, ":gender_1", 1),
          (str_store_string, s11, "str_sister"),
        (else_try),
          (str_store_string, s11, "str_brother"),
        (try_end),

The code seemed to imply it would build the brother/sister relationship in the absence of a father, but it didn't. Because it needed the father for it, I think. I changed the references from father to mother (mother_of_1 and mother_of_2) and now the 4 Ragnar sons are recognized as brothers. I will add Aslaug as a mother to Halfdan and this should include him as a brother too. I don't know if it will break something or if this will carry the relationship bonus/penalties and quests for being siblings, but I hope it does. Posting this here in case anyone has any trouble with this in the future.
 
Back
Top Bottom