Modding VC: basic tutorials and Q&A thread

Users who are viewing this thread

AnonWarband said:
Anyone know how to change the code so that I don't get a loss from tax inefficiency when I have too many fiefs ? (VC Version 2.02:cool:

file module_presentations.py
presentation: budge_report
        (try_begin),
          (eq, ":reduce_campaign_ai", 0), #hard
          (assign, ":num_centers_needed_for_efficiency_loss", 2),
          (assign, ":tax_efficiency_loss_ratio_per_center", 10), #chief change
        (else_try),
          (eq, ":reduce_campaign_ai", 1), #medium
          (assign, ":num_centers_needed_for_efficiency_loss", 4),
          (assign, ":tax_efficiency_loss_ratio_per_center", 8 ),#chief change
        (else_try),
          (eq, ":reduce_campaign_ai", 2), #easy
          (assign, ":num_centers_needed_for_efficiency_loss", 6),
          (assign, ":tax_efficiency_loss_ratio_per_center", 6),#chief change
        (try_end),

this is the code, you can change the rules for whatever you like by adding more centers to a certain difficulty tolerance (remember that towns count as 2 centers)

look for it at that file, change the values, compile your code, play.



AnonWarband said:
(VC Version 2.02:cool:

Why are you using 2.028? Game is now 2.036, you should download the latest version. If you are using Tweaks Tool 1.1 (based on 2.025), you should mention that as well.
 
I tried the code. The game crashed with a runtime error. I added the codes to the budget_report presentation cause I couldn't find presentation: budge_report.
So on which part of the budget_report am I supposed to add the code, cause I'm not that good at coding with warband ? (Also I have Tweak Tools 1.1 but I'm not sure on how to use them, unfortunately)
 
AnonWarband said:
So on which part of the budget_report am I supposed to add the code

nowhere. The code is already there.

Your question was: which code I need to change for tax inefficiency?
Answer: I posted the file and the lines of code that you are looking for, with the numbers (in red) that you can change
What you need to do: change those numbers to whatever your new ruleset is, compile the code and play the game. Use a text editor, find those lines (use search function), make your changes.

Example:
(assign, ":num_centers_needed_for_efficiency_loss", 2),
this line says that you can have up to two centers (or 1 town) before paying for corruption.

If you are having issues with setup of modsys you can visit the Forge. The initial posts in this thread have links for tutorials as well, as the basic explanation on modding.

If you have issues with compiler errors, game crashes, in-game error message, etc, you will need to provide the logs (copy them and post on the thread), as well show us your code changes.

Cheers
 
In Brytenwalda I really liked the option of a funeral pyre when looting
Code:
	("funeral_pyre",mcn_no_shadow,"funeral_pyre_icon", 5.0, 0),
Code:
  ("funeral_pyre","Funeral Pyre",icon_funeral_pyre|pf_is_static|pf_hide_defenders|pf_always_visible|pf_no_label ,0,fac_neutral,escorted_merchant_personality,[]),
Code:
  (0, [	(map_free),
		(this_or_next|eq,"$bury_dead",1),
		(eq,"$loot_dead",1),
		(party_get_battle_opponent, ":in_battle", "p_main_party"),
		(le,":in_battle",0),
		(assign,":start_bonfire",0),
		(try_begin),
			(eq,"$bury_dead",1),
			(eq,"$loot_dead",1),
			(assign,":time_after_battle",3),
			(display_message,"@                                Looting and burying the dead."),
			(assign,":start_bonfire",1),
			(gt,"$wagon_attached",0),
			(call_script,"script_add_wagon_inventory"),
		(else_try),
			(eq,"$bury_dead",1),
			(eq,"$loot_dead",0),
			(assign,":time_after_battle",2),
			(assign,":start_bonfire",1),
			(display_message,"@                                      Burying the dead."),
		(else_try),
			(eq,"$bury_dead",0),
			(eq,"$loot_dead",1),
			(assign,":time_after_battle",1),
			(display_message,"@                                       Looting the dead."),
			(gt,"$wagon_attached",0),
			(call_script,"script_add_wagon_inventory"),
		(try_end),
		(assign, "$g_player_icon_state", pis_camping),
		(party_set_slot,"p_main_party",slot_party_entrenched,0),
		(assign,"$g_camp_mode", 1),
		(rest_for_hours,":time_after_battle",0,1),
		(assign,"$bury_dead",0),
		(assign,"$loot_dead",0),
		(try_begin),
			(eq,":start_bonfire",1),
			(set_spawn_radius, 1),
			(spawn_around_party, "p_main_party", "pt_funeral_pyre"),
			(assign, ":funeral_pyre", reg0),
			(store_current_hours,":cur_hour"),
			(val_add,":cur_hour",8),
			(party_set_slot, ":funeral_pyre", slot_village_smoke_added, ":cur_hour"),
			(party_add_particle_system, ":funeral_pyre", "psys_map_village_fire"),
			(party_add_particle_system, ":funeral_pyre", "psys_map_village_fire_smoke"),
		(try_end),
       ]),  
 
#TEMPERED  CLEAN UP FUNERAL PYRES
  (3, [	(store_random_party_of_template,":party_no","pt_funeral_pyre"),
		(gt,":party_no",0),
		(store_current_hours,":cur_hour"),
		(party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
		(gt,":cur_hour",":end_hour"),
		(party_clear_particle_systems, ":party_no"),
		(party_clear,":party_no"),
		(remove_party,":party_no"),
       ]),

how best to do this in the VC?
so if you choose "Leave the loot, but use the time to bury the dead." for some time appeared a burning and fuming funeral pyre icon?
the icon I have made and prescribed in a modular system
Code:
  ### loot options (Phaiak)
  
  (
    "loot_options",0,
    "The battle is over. What do you want to do with the loot?",
    "none",
    [
      (set_background_mesh, "mesh_pic_chest"), #pic book
      #(set_background_mesh, "mesh_pic_extra_navegando"),
      (assign, "$loot_option", 0),
      
      (try_begin),
        (party_get_num_companions, ":party_members", "p_main_party"),
        (le, ":party_members", 3),
        (jump_to_menu, "mnu_total_victory"),	# No loot option for very small party
      (end_try),
      
    ],
    [
      ("loot_0", [], "Share the loot, as is common.",
        [
          (assign, "$loot_option", 0),
          (jump_to_menu, "mnu_total_victory"),
      ]),
      
      ("loot_1", [], "Take first claim on all the loot.",
        [
          (assign, "$loot_option", 1),
          (jump_to_menu, "mnu_total_victory"),
      ]),
      
      ("loot_2", [], "Leave all the loot for your men.",
        [
          (assign, "$loot_option", 2),
          (jump_to_menu, "mnu_total_victory"),
      ]),
      
      ("loot_3", [], "Leave the loot, but use the time to bury the dead.",
        [
          (assign, "$loot_option", 3),
          (jump_to_menu, "mnu_total_victory"),
      ]),
      
    ]
  ),
 
ha3481 said:
how best to do this in the VC?

you can use the same idea as BW. You spawn a static icon (static party) with the mesh/visuals of a pyre, you then add the smoking/fire effect (which you also have in VC) and leave it there for however long you want.

Are you having issues with any particular part of this code?
 
kalarhan said:
Are you have issues with any particular part of this code?
thanks, but I already did  :wink:
I like to do this burning  :roll: that I made this, regardless of loot options
Code:
("funeral_pyre","Funeral Pyre",icon_funeral_pyre|pf_is_static|pf_hide_defenders|pf_always_visible|pf_no_label ,0,fac_neutral,escorted_merchant_personality,[]),
Code:
 (
    "loot_options",0,
    "The battle is over. What do you want to do with the loot?",
    "none",
    [
      (set_background_mesh, "mesh_pic_chest"), #pic book
      #(set_background_mesh, "mesh_pic_extra_navegando"),
      (assign, "$loot_option", 0),
      (try_begin),
        (party_get_num_companions, ":party_members", "p_main_party"),
        (le, ":party_members", 3),
        (jump_to_menu, "mnu_total_victory"),	# No loot option for very small party
      (end_try),
      (assign, "$bury_dead", 1),    #added by me
    ],
    [
      ("loot_0".......
Code:
  (0, [	(map_free),
		(try_begin),
			(eq,"$bury_dead",1),
			(assign,"$bury_dead",0),
			(set_spawn_radius, 1),
			(spawn_around_party, "p_main_party", "pt_funeral_pyre"),
			(assign, ":funeral_pyre", reg0),
			(store_current_hours,":cur_hour"),
			(val_add,":cur_hour",8),
			(party_set_slot, ":funeral_pyre", slot_village_smoke_added, ":cur_hour"),
			(party_add_particle_system, ":funeral_pyre", "psys_map_village_fire"),
			(party_add_particle_system, ":funeral_pyre", "psys_map_village_fire_smoke"),
		(try_end),
       ]),  
  (3, [	(store_random_party_of_template,":party_no","pt_funeral_pyre"),
		(gt,":party_no",0),
		(store_current_hours,":cur_hour"),
		(party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
		(gt,":cur_hour",":end_hour"),
		(party_clear_particle_systems, ":party_no"),
		(party_clear,":party_no"),
		(remove_party,":party_no"),
       ]),
 
ha3481 said:
I like to do this burning 

very nice

now you can add it to NPC battles, add a cool text or mouse over with the battle report (how many were killed and who fought who), play a funeral song if you get near it  ... whatever makes sense to your mod

Dark Age just got darker  :twisted:
 
kalarhan said:
Dark Age just got darker  :twisted:
:mrgreen:

made some changes..
now three funerary icons: one for ships and two for different religions
Code:
#Dark age
  (0, [	(map_free),
		(try_begin),
		  (eq,"$bury_dead",1),
		  (assign,"$bury_dead",0),
		  (set_spawn_radius, 1),
			(try_begin),
			  (eq, "$g_player_icon_state", pis_normal),
				(try_begin),
				  (eq,"$g_player_faith", 1),
				  (spawn_around_party, "p_main_party", "pt_funeral_cross"),
				(else_try),
				  (eq,"$g_player_faith", 2),
				  (spawn_around_party, "p_main_party", "pt_funeral_pyre"),
				(try_end),
		    (else_try),
		      (eq, "$g_player_icon_state", pis_ship),
		      (spawn_around_party, "p_main_party", "pt_funeral_ship"),
		    (try_end),
		  (assign, ":funeral_pyre", reg0),
		  (store_current_hours,":cur_hour"),
		  (val_add,":cur_hour",6),
		  (party_set_slot, ":funeral_pyre", slot_village_smoke_added, ":cur_hour"),
		  (party_add_particle_system, ":funeral_pyre", "psys_map_village_fire"),
		  (party_add_particle_system, ":funeral_pyre", "psys_map_village_fire_smoke"),
		(try_end),
       ]), 
Code:
  (3, [	(store_random_party_of_template,":party_no","pt_funeral_ship"),
		  (gt,":party_no",0),
		  (store_current_hours,":cur_hour"),
		  (party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
		  (gt,":cur_hour",":end_hour"),
		  (party_clear_particle_systems, ":party_no"),
		  (party_clear,":party_no"),
		  (remove_party,":party_no"),
       ]),
  (3, [	(store_random_party_of_template,":party_no","pt_funeral_cross"),
		  (gt,":party_no",0),
		  (store_current_hours,":cur_hour"),
		  (party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
		  (gt,":cur_hour",":end_hour"),
		  (party_clear_particle_systems, ":party_no"),
		  (party_clear,":party_no"),
		  (remove_party,":party_no"),
	   ]),
  (3, [	(store_random_party_of_template,":party_no","pt_funeral_pyre"),
		  (gt,":party_no",0),
		  (store_current_hours,":cur_hour"),
		  (party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
		  (gt,":cur_hour",":end_hour"),
		  (party_clear_particle_systems, ":party_no"),
		  (party_clear,":party_no"),
		  (remove_party,":party_no"),
	  ]),
I failed to combine the triggers #2, #3, #4 into a single trigger...
How can I combine multiple values (pt_funeral_ship/pt_funeral_cross/pt_funeral_pyre) for "store_random_party_of_template" function?
 
ha3481 said:
How can I combine multiple values (pt_funeral_ship/pt_funeral_cross/pt_funeral_pyre) for "store_random_party_of_template" function?

Having those 3 triggers is not a issue (besides repeating code, which is a code quality issue). If you want to combine then you could, as a example

1) Create a script like

Code:
("remove_funeral_icon", [
    (store_script_param_1, ":party_template"),

    (try_begin),
        (store_random_party_of_template,":party_no",":party_template"),
        (gt,":party_no",0),
        (party_is_active, ":party_no"),
        (store_current_hours,":cur_hour"),
        (party_get_slot,":end_hour",":party_no",slot_village_smoke_added),
        (gt,":cur_hour",":end_hour"),
        (party_clear_particle_systems, ":party_no"),
        (party_clear,":party_no"),
        (remove_party,":party_no"),        
    (try_end),
]),

2) Call it 3 times on the trigger
Code:
(3, [
    (call_script, "script_remove_funeral_icon", "pt_funeral_cross"),

    ... other 2 cases

    ]),

You can experiment with your timer (the 3 hour clock), use something else besides random, etc, if you want to explore other ways to make this work. But the important thingy is to have something that works first.

Cheers
 
Tried editing a couple of troops on Viking Conquest using morghs editor but the troops remain unedited? Iv checked morghs editor and the changes are all there and iv started a new game but still nothing... Every other mod and DLC iv done this on has worked but not this...

Not sure whats gone wrong?
 
NicoleUK said:
Tried editing a couple of troops on Viking Conquest using morghs editor but the troops remain unedited? Iv checked morghs editor and the changes are all there and iv started a new game but still nothing... Every other mod and DLC iv done this on has worked but not this...

Not sure whats gone wrong?

Also when iv tried adding items to my inventory using morgh editor they dont show u in game (again iv done this with other mods and DLCs but this one just doesnt seem to work with it?)

so frustrating!
 
NicoleUK said:
Also when iv tried adding items to my inventory using morgh editor they dont show u in game (again iv done this with other mods and DLCs but this one just doesnt seem to work with it?)

VC uses the same engine as the Native (also know as Warband) game. So the Morgh's tool is somewhat compatible.

However, as any non native module, not all features and settings may be 100% compatible with a third party tool that was not updated for it. There are also new and different game mechanics that can override basic options, which the tool has no way to know about.

My recommendation is to use the source code of the DLC (know as modsys), which lets you edit any thingy you want and is 100% compatible (it is what the devs used to created the game).

Download link: https://forums.taleworlds.com/index.php/topic,349080.0.html

You can also check the VC Tweaks Tool, which is the source code + lots of tweaks ready for use: https://forums.taleworlds.com/index.php/topic,348186.0.html



If you insist in using only Morgh's then I will ask you to create a new thread (you can use your old one) and post all your changes (your .txt files, etc), explain each one and what you are trying to do with each one in detail, so we can see what is going wrong. It may be necessary to sanitize the game code and remove some stuff (like imods on troops items) to make it compatible with the tool.
 
NicoleUK said:
is it basically like morghs editor but for VK?

nope

Morgh's is a newbie friendly tool to edit just a few data entries in MB modules. Examples: troops and items. Not for game mechanics.
Tweaks Tool is a newbie friendly tool to edit game mechanics. Examples: tournament bets, village rent, ...

VC Tweaks Tool is a tool that combines game source (recipe) + tweaks (game mechanics). You can use just the built-in tweaks. You can add more tweaks on your own. You can change things like troops and items as well. And you can even use tools like Morgh's (with .py code, not .txt) in combination with it (after code clean up) if you want to.

Visit the thread and you should find more info.
 
So theresno way to use morghs editor on its own with VK?

iv been trying to find a basic instruction gude to adding troops with this tweaker but not finding anything... if you have a link or something to where i could find it i can stop pestering you lol :smile:
 
NicoleUK said:
iv been trying to find a basic instruction gude to adding troops

I posted above about Morgh's in case you still want to use it.

Morgh's is not a "real" modding tool. It is a newbie friendly tool for simple and quick changes used by players. If you want to expand your ability to change the game in more interesting ways, then the modsys and the Tweak Tool are what you should be looking into to.

You are missing the point on the difference between data entries (like a sword) and game mechanics (economy balance, diplomacy, etc).

As a example to edit/add troops you would check the file module_troops.py https://github.com/KalarhanWB/VC_Tweaks_Tool/blob/master/app/module_troops.py

Check the OP in this thread for general instructions and links for modding guides.

NicoleUK said:
So theresno way to use morghs editor on its own with VK?
See above. Answer is yes, you can use it.
 
Vagn said:
Is there a way to make troop upgrade three-way instead of two-way only?

not by default, no. The engine allows for a linear or two paths upgrade.

What you could do is implement a feature for that (coding work), which could, as a example, just swap a [tier 1] troop with anything you want from [tier 2]. That way you could have 2, 3, 4, ... as many options as your troop tree has.

You can visit the Forge Q&A thread if you need further help (as this is a generic Warband modding question)

Cheers
 
Hi guys! I want to mod a game slightly(I think so), but I am new to modding, and literally I'm lost in all topics here, so I gonna ask you a question in very noobish way: What my first steps should look like?

The only thing I want to change is to make refuge generate income, make it self-sustain. Like 0 income from level 1(because it's actually just a few tents in the field on that level), 400-600 from level 2 and 800-1000 from level 3.

I have a basic experience in coding(I am automation tester on C#), but I saw, that there are already some tools for a minor changes. So yeah - Where should I start?

And sorry for a not-so-good English :sad:
 
Nerevar said:
Where should I start?

give a quick read on the initial posts in this thread, as they do a presentation on basic modding. It will tell you what you need to know as a coder, where to get the modsys, link to the Forge (modding forum), etc

for your case you will need to add a event (trigger) somewhere (like the one that handles towns rents once a week) that checks for the existence and level of player refuge. If you need help with that once you read the basic stuff you can ask here or in the Forge.

Cheers
 
Back
Top Bottom