Modding VC: basic tutorials and Q&A thread

Users who are viewing this thread

kalarhan said:
Code:
neq, ":companion_candidate", "trp_npc7"
^ sandbox modes, not for storyline
I got my companion to show up at a scene but for some reason the dialogue didn't work. Then if I make my companion random (location) the dialogue does work *shrugs*.

I think I need to learn a bit more about the coding before making them fixed. But thanks for the help :grin:
 
VC Map Editor

Does anyone know what they used to Create the Map itself?

I used Bloodpass Editor for Warband, it worked like a Charm. But trying to use same does not work for VC at all.

Did they use Blender with the plugin or any other mod tool that is out there? I want to do a overhaul of the entire map... like not just the UK and make a mod based on the Mechanics.

If any of the DEV are reading this, would be happy to work with the same editor that made the map and I am open for all suggestions. if you guys have a Map editor feel free to realase it.  :mrgreen:


Cheers  :fruity:

 
LAST_ACTION_HERO said:
VC Map Editor

Does anyone know what they used to Create the Map itself?

I used Bloodpass Editor for Warband, it worked like a Charm. But trying to use same does not work for VC at all.

Did they use Blender with the plugin or any other mod tool that is out there? I want to do a overhaul of the entire map... like not just the UK and make a mod based on the Mechanics.

If any of the DEV are reading this, would be happy to work with the same editor that made the map and I am open for all suggestions. if you guys have a Map editor feel free to realase it.  :mrgreen:


Cheers  :fruity:

I've no idea what the Devs used, but you can load up the VC map in Thorgrims map editor.

2w2aa.jpg
 
Guide on how to mod the VC Map

First off thanks to NPC99 for the feedback, I basically will just copy past his answers below, because they where simply so good.

Second, just a reminder "  VC map can't be used for public Warband mods without the VC developer's permission. "




Collected Information about how to mod the Map:


However, if you just want to edit the VC map:

Thorgrims is an old programme - only works with M&B. For Warband you need to copy your  map.txt, parties.txt and module.ini into an M&B module folder - register the name of that folder in Thorgrim’s settings.cfg file (Mod=folder_name) and specify its location mbPath=C:/Program Files (x86)/Steam/SteamApps/common/MountandBlade

As Thorgrims is old, it doesn’t work with later map icons. Make sure its resources.txt file points to the old M&B icons (load_resource not load_mod_resource) for map_icon_meshes map_icons_b & map_icons_c.
You then need to edit the copy of parties.txt in your M&B folder to use older moveable map icons. For example change the six digit icon reference after p_town_12 Lundenwic from 4219960 to 4220038

Edit and save your map. The updated map.txt can be transferred to your Warband folder if you’ve modified terrain. If you’ve only moved places, the new locations are saved in the parties.txt file. However, you can’t copy this back to your Warband folder until you’ve reset the map icon numbers back to those required by VC.



You might find these links useful.

Thorgrim’s help page: http://members.iinet.net.au/~dstent/mnb/help.html

Thorgrim’s tutorial:
https://forums.taleworlds.com/index.php/topic,158656.0.html





Polys = the critical factor, not size. You can make a big map, which stretches a limited number of polys over a large area without any performance issues - however this will make detailing the map more crude/difficult.

Guide number of polys:
Native Warband map 41,387
Viking Conquest map 113,799
A Clash of Kings mod 132,487

I wouldn't recommend going above 130,000 polys for your first map - probably best to stick to 100,000. You can use bigger (I'm currently working on one with 144,959 polys) but this can cause performance issues due to memory requirements.

Look at the Viking Conquest map in wireframe mode (Control W in Thorgrims) - peripheral triangles are much bigger. On featureless terrain such as oceans you can reduce your poly count to improve performance or map size. For example I reduced the poly count of my mod's map from 198,922 to 92,115 polys.

To reduce polys:
1. Use Thorgrims to export an obj file of your map
2. Use Meshlab to quadratically decimate peripheral areas of your map
3. Load the original undecimated map into Thorgrims and select new - this deletes the mesh but still retains the paint layers even though you can't see them - this is imperative unless you want to retexture your map from scratch.
4. Import the decimated obj file into Thorgrims where it should inherit the paint layers as its the same map just with fewer polys.

How can you tell the number of polys? The map.txt file tells you, if you look hard enough.
The first number in a map.txt file is the number of vertices
After that is a list of three columns that seems to run forever - these are the X, Y & Z co-ordinates for each vertex listed in order.
Then the next number is the number of polys or faces.
Then you have a six column list that goes on forever - these are:

a terrain code
b 0 - presumably depreciated
c 3 - number of vertices for each face
d vertex 1 (ref number in the vertex list)
e vertex 2 (ref number in the vertex list)
f vertex 3 (ref number in the vertex list)

Vertex numbers as with all TW lists start with 0 as opposed to 1.

terrain codes are
0 = sea or ocean
1 = mountain (impassable)
2 = steppe
3 = plain
4 = snow
5 = desert
7 = ford/bridge (walkable water) use sparingly to avoid crashes
8 = river
9= steppe mountain (impassable)
10 = steppe forest
11 = forest
12 = snow forest
13 = desert forest (not paintable in Thorgrims)
15 = deep ocean (walkable water) has blending issues if adjacent to non-water terrain





Again all Credits go to NPC99  :mrgreen:
 
I have a new question, regarding the AI behaviour in battles.

Is there a way to stop the AI from using the formations?

I just want them to charge in against my formation head on, especially during refuge or camp battles. Because the AI movement always makes your formations turn and move to the side etc... and ruins your carefully placing them in a way to plug the entrance with a shieldwall (your formations end up next to the entrance or half the men outside etc...) If you can force the AI to charge head on without formation your own formation should stay in place.

Which file would I have to alter?

The options in the modmenu don't work for me, because I do want the formations, I just don't want the AI to be able to use them because it messes up the players battle lines
 
Level Modding

Does Anyone know how to mod the XP per Level? I would like to make it more even, I am aware it overflows at a Certain Point. But looking through the Python files I found no references where its edited or stored?

Like it looks like this in Native:

warband_level.PNG



My Idea was to make as Max Level not 62 but rather 100 and then just edit the XP range when the Char levels up. Also can we edit the number of Skill points we get per level? 

Thanks again for any help  :wink:
 
kalarhan said:
Try script game_get_upgrade_xp

Skills points: module.ini

Thanks again Kalarhan  :wink:

Could it be the first block is for the Player itself and the Second one for the Troops?



  # script_game_get_upgrade_xp
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed exp for upgrade
  ("game_get_upgrade_xp",
    [
      (store_script_param_1, ":troop_id"),
     
      (assign, ":needed_upgrade_xp", 0),
      #formula : int needed_upgrade_xp = 2 * (30 + 0.006f * level_boundaries[troops[troop_id].level + 3]);
      (store_character_level, ":troop_level", ":troop_id"),
      (store_add, ":needed_upgrade_xp", ":troop_level", 3),
      (get_level_boundary, reg0, ":needed_upgrade_xp"),       
      (val_mul, reg0, 6),
      (val_div, reg0, 1000),
      (val_add, reg0, 30),

      (try_begin),             
        (ge, ":troop_id", bandits_begin),
        (lt, ":troop_id", bandits_end),
        (val_mul, reg0, 2),
      (try_end),

      (set_trigger_result, reg0),
  ]),

 
  # script_game_get_upgrade_cost
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed cost for upgrade
  ("game_get_upgrade_cost",
    [
      (store_script_param_1, ":troop_id"),
     
      (store_character_level, ":troop_level", ":troop_id"),
     
      (try_begin),
        (is_between, ":troop_level", 0, 6),
        (assign, reg0, 10),
      (else_try), 
        (is_between, ":troop_level", 6, 11),
        (assign, reg0, 20),
      (else_try), 
        (is_between, ":troop_level", 11, 16),
        (assign, reg0, 40),
      (else_try), 
        (is_between, ":troop_level", 16, 21),
        (assign, reg0, 80),
      (else_try), 
        (is_between, ":troop_level", 21, 26),
        (assign, reg0, 120),
      (else_try), 
        (is_between, ":troop_level", 26, 31),
        (assign, reg0, 160),
      (else_try), 
        (assign, reg0, 200),
      (try_end), 
       
      (set_trigger_result, reg0),
  ]),
 
First script is XP. Second is upgrade cost (price). Also that code is not from VC, get VC modsys to see how it works for the DLC.

You can implement your own logic or XP curve.
 
You are right I used Native as code to see how it would be simpler then in VC it looks like this:
# script_game_get_upgrade_xp
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed exp for upgrade
  ("game_get_upgrade_xp",
    [
      (store_script_param_1, ":troop_id"),
     
      (assign, ":needed_upgrade_xp", 0),
      #formula : int needed_upgrade_xp = 2 * (30 + 0.006f * level_boundaries[troops[troop_id].level + 3]);
      (store_character_level, ":troop_level", ":troop_id"),
      (try_begin),
        (eq,"$easy_levelling", 0),
        (try_begin),
          (ge, ":troop_level", 2:cool:,
          (store_add, ":needed_upgrade_xp", ":troop_level", 4),# was 8
        (else_try),
          (store_add, ":needed_upgrade_xp", ":troop_level", :cool:, #high level troops more difficult to upgrade -10
        (try_end),
      (else_try),
        (eq,"$easy_levelling", 1),
        (try_begin),
          (ge, ":troop_level", 2:cool:,
          (store_add, ":needed_upgrade_xp", ":troop_level", 2),# was 8
        (else_try),
          (store_add, ":needed_upgrade_xp", ":troop_level", 4), #high level troops more difficult to upgrade -10
        (try_end),
      (else_try),
        (eq,"$easy_levelling", 2),
        (try_begin),
          (le, ":troop_level", 23),
          (store_add, ":needed_upgrade_xp", ":troop_level", :cool:,# was 8
        (else_try),
          (store_add, ":needed_upgrade_xp", ":troop_level", 10), #high level troops more difficult to upgrade -10
        (try_end),
      (try_end),
      (get_level_boundary, reg0, ":needed_upgrade_xp"),
      (val_mul, reg0, 6),
      (val_div, reg0, 1000),
      (val_add, reg0, 30),
      (try_begin),
        (gt, ":troop_level", 23),
        (try_begin),
          (eq,"$easy_levelling", 1),
          (val_mul, reg0, 6),
          (val_div, reg0, 5),
        (else_try),
          (eq,"$easy_levelling", 0),
          (val_mul, reg0, 4),
          (val_div, reg0, 3),
        (else_try),
          (eq, "$easy_levelling", 2),
          (val_mul, reg0, 3), #high level troops more difficult to upgrade -- was 3
        (try_end),
      (try_end),
      (try_begin),
        (eq, "$easy_levelling", 2),
        (is_between, ":troop_id", bandits_begin, bandits_end),
        (val_mul, reg0, 2),
      (else_try),
        (this_or_next|eq,"$easy_levelling", 1),
        (eq,"$easy_levelling", 0),
        (is_between, ":troop_id", bandits_begin, bandits_end),
        (val_mul, reg0, 2),
        (val_div, reg0, 3),
      (try_end),
      (set_trigger_result, reg0),
  ]),

I played a bit around with the numbers but End level all time seems to be 61. I wonder if that Information is somewhere else stored?
 
Game engine has Max values (based on data type or engine logic), you need to work inside the limits.

You can change behaviors with your code. Skill points, effects, HP, damage, whatever you want. The further you move from Native baseline the more you need to add custom code.

You can visit the Forge to discuss normal modding stuff not related to VC (more people there to join in)
 
It seems both blocks are for Troops only. Player Level progression must be somewhere else stored, If I find it will post more about it. Like I played around with Numbers it seems to affect troops only. The second block seems to only affect upgrade cost. Actually I am wondering if its possible to have Troops upgrading from Level 1-61 so like 60 Stages, will test that out and then report if it works.

About the Formula:

  #formula : int needed_upgrade_xp = 2 * (30 + 0.006f * level_boundaries[troops[troop_id].level + 3]);


Do you happen to know the " level +3 " in the end it seems in VC they used it to make troops faster or slower to upgrade ( from the menu in start of the game where you can choose it as easy,normal or hard ) they let the rest of the formula as it was in native. They seem to have used for easy 0 and 1 it seems 3 is normal so as higher the number goes as slower the upgrade should be?

Another Questions I started to mod it as 2032 and now its out 2036, are the changes in the Module files or in a upper folder in Warband and the Module just works with it when compiling? If its in the Modules I can basically just copy past the changes into mine?


One more Question about Difficulty Settings, I found in VC in Simple_triggers.py the fellowing:
            (eq, ":reduce_campaign_ai", 0), #hard (2x reinforcing)
            (assign, ":num_hiring_rounds", 2),
          (else_try),
            (eq, ":reduce_campaign_ai", 1), #medium (1x or 2x reinforcing)
            (assign, ":num_hiring_rounds", 1),
            (store_random_in_range, ":random_value", 0, 2),
            (val_add, ":num_hiring_rounds", ":random_value"),
          (else_try),
            (eq, ":reduce_campaign_ai", 2), #easy (1x reinforcing)
            (assign, ":num_hiring_rounds", 1),
so I assume the Difficulty is only how often the AI gets troops?
 
just a update: I am off town for a few more days, so I will look at your questions @Dionaea and @Last_Action_hero when I get back. No guaranties on a answer, and you should also try to visit the Forge Q&A (a lot more modders hang out there).

Cheers
 
kalarhan said:
just a update: I am off town for a few more days, so I will look at your questions @Dionaea and @Last_Action_hero when I get back. No guaranties on a answer, and you should also try to visit the Forge Q&A (a lot more modders hang out there).

Cheers

Thank you karlahan :smile:

Anyone else that is interested in Modding where is more Informations: https://forums.taleworlds.com/index.php/board,64.0.html
 
kalarhan said:
just a update: I am off town for a few more days, so I will look at your questions @Dionaea and @Last_Action_hero when I get back. No guaranties on a answer, and you should also try to visit the Forge Q&A (a lot more modders hang out there).

Cheers

I bought an online course to learn python so maybe I'll be able to figure it out in a few weeks  :grin:
 
Dionaea said:
I bought an online course to learn python so maybe I'll be able to figure it out in a few weeks  :grin:

learning Python can definitely help (the basics), so learn stuff like tuples, variables, printing messages (log) for the compiler, run process on terminal, etc. It is the first few hours of a beginners course.

however remember that Warband uses MBScript, which has nothing to do with Python per si. It is similar to learning English and Spanish. Both share the same letters and some grammar struts, but just cause you learn one, it doesn't mean you know the other. For MBScript the best source are the basic tutorials in the Forge. And a lot of trial and error.

Cheers
 
If I want companions to have no personalityclash or kingsupport_opponent can I simply change the troop to trp_dranton  in module_scripts without causing any problems? Will this prevent companions from not getting along and not being able to go on right to rule quests if their opponent already has whilst both in the party without messing anything up?

(Apologies for previously posting to the wrong thread)
 
theman007 said:
If I want companions to have no personalityclash or kingsupport_opponent

you should disable the trigger that controls the clashes. You can see how it is done on [VC Tweaks Tool] and either use it on your game, or copy the code to your own modsys.

VC Tweaks Tool thread: https://forums.taleworlds.com/index.php/topic,348186.0.html

module_triggers.py
Code:
  #Process morale and determine personality clashes

tweaks.ini
TWEAK 3: STOP THEM FROM LEAVING
TWEAK_STOP_COMPANIONS_LEAVING = 0

for the king support add the global check on this part
        #Check for political issues
        (try_begin), #does npc's opponent pipe up?         
 
Back
Top Bottom