[TWEAKS] VC Tweaks Tool: +80 tweaks the easy way! (released/1.2)

Users who are viewing this thread

Vetrogor said:
Skirt Chaser Achievement (make 5 womens your lovers) is not active. It is placed after commas.

hi @Vetrogor.

This "special trait" was deactivated on a patch when the devs removed the cheating wives feature. It is not a change in the tool, it is part of the DLC (vanilla). In this case, I will keep it as is.

You can, however, change it on your own game version if you want to. Simple remove the "#" on the lines you showed above, restore code from a older version (VC code) and execute [run_app.bat]

Cheers and happy modding!




Ruan said:
Is there a way to allow archers and some skirmishers forming ranks?
You would need to check the formations scripts and remove the restrictions on that type of formation for those classes (divisions). Visit the [modding Q&A] thread if you need help with that.

[Rank] style has a different focus from the [shieldwall] as the priority for selection of weapons, so you will also need to examine the impact of that AI on your soldiers.

Cheers
 
kalarhan said:
This "special trait" was deactivated on a patch when the devs removed the cheating wives feature. It is not a change in the tool, it is part of the DLC (vanilla). In this case, I will keep it as is.

Thanks. I found that it will not work because slot_troop_lover also deactivated in commas. And there is no any script to handle slot_troop_lover.
 
Vetrogor said:
Thanks. I found that it will not work because slot_troop_lover also deactivated in commas. And there is no any script to handle slot_troop_lover.

you would need to download a older version of the game code (modsys) and see how it worked before, then restore it (copy the code to your tool). See patch notes (VC) to know when it was removed.

Cheers
 
Coodn't find any old modsys. Anyway in this code all unmarried ladies with relation >= 30 will be counted as lovers

module_simple_triggers.txt
Code:
...
 ###########
  #STrig 160
  ##############
...
  (24, #Specials
      (try_begin),
        (eq, "$special1", 0),
        (assign, ":lover", 0),
        (try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
          (troop_slot_ge, ":lady", slot_troop_met, 1), # met or better
          (troop_slot_eq, ":lady", slot_troop_spouse, -1), # unmarried
          (call_script, "script_troop_get_relation_with_troop", "trp_player", ":lady"),
          (ge, reg0, 30),
	  # (troop_slot_eq, ":npc", slot_troop_lover, "trp_player"),
          (val_add, ":lover", 1),
        (try_end),
        (ge,":lover", 5),
        (assign, "$special1", 2),
      (try_end),
...

 
shortfried said:
Does this mod stop the morale drop and bickering between the companions?

not a mod, but a tool to apply tweaks on your game thus creating your own custom version. One of them stops companions leaving the party. Part of the "bickering" was removed in a recent patch (vanilla VC). If you want to tweak it further you can also do it, as the game code is in the tool/the tool is the game code + tweaks.

Cheers
 
Just a thank you to Kalarhan for all his work maintaining this. The Viking Conquest community is lucky to have you providing such consistent support!
 
Thanks kalarhan for your work. I'm new here, installation went quite good. But i have a question. In OP, if I understand correctly, there is a tweak for ammo. Is it possible to add this tweak here? I love javelins, but i can't really use them. Best case scenario is 4 pack by 6 javs = 24. It sucks. I don't know how it works, but I guess it can be achieved by tweaking "large bag of", which adds 1 in vanilla.
 
Skramel said:
Is it possible to add this tweak here?

see "tool/app" folder. Game code is all there (used by the devs to create the DLC). With that you can tweak anything else you desire.

for javelins you can see module_items.py. Look for the item entry by name using quotes like "Simple Javelins"
Code:
["darts",         "Simple Javelins", [("javelin",0),("javelin_carry", ixmesh_carry)], itp_type_thrown |itp_primary|itp_secondary|itp_bonus_against_shield|itp_next_item_as_melee ,itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 
200, weight(2)|difficulty(1)|spd_rtng(85) | shoot_speed(28) | thrust_damage(15 ,  pierce)|max_ammo(4)|weapon_length(65)|accuracy(99),imodbits_thrown ,
[], [fac_kingdom_20, fac_kingdom_17, fac_kingdom_19, fac_kingdom_17, fac_kingdom_18, fac_kingdom_19, fac_kingdom_10, fac_kingdom_11]],
and change the value for "max_ammo(4)" . Same thing for other types of javelins.
 
Skramel said:
I love javelins, but i can't really use them. Best case scenario is 4 pack by 6 javs = 24.
You can also use
horseman javelins, which come in packs of 12. They have same stats as skirmisher javelins. You can find them by defeating parties with horsemen, most often found in Ireland and North England. You can't find them in shops. Or heavy javelins, which come in packs of 8 and do more damage than horseman/skirmish javelins. You find them by killing veteran/elite skirmishers(maybe some more, check the troop tree)
My favorite build is shield, sword and 2 packs of horseman javelins :wink:
 
Hello!
There are tweaks to get recruits from your culture in any town/fort/village.
However, is it possible to make all lords in any kingdom to only recruit the troops from that particular kingdom's culture?
This is to avoid the mess when all cultures fight against the same cultures in the end game.
 
Alex Kit said:
is it possible to make all lords in any kingdom to only recruit the troops from that particular kingdom's culture?

they already recruit from their faction on villages (with that tweak), however there are other situations like prisoners and when they spawn (reborn after a defeat, etc). For the latter:

1) disable rebellion
2) change script_cf_reinforce_party and remove code related to original faction
 
Thank you!!

when they spawn (reborn after a defeat, etc)
Yes, this is exactly what I mean!

I'm looking at the script, but I'm not sure I understand which piece of code makes them recruit from their original faction.
The only references to the original faction I could find are these:
Code:
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
But I think this part recruits to the towns, doesn't it?

Again, if I understand the source correctly, the lord recruiting piece is this:
Code:
  # script_hire_men_to_kingdom_hero_party
  # Input: arg1 = troop_no (hero of the party)
  # Output: none
  ("hire_men_to_kingdom_hero_party",
    [
      (store_script_param_1, ":troop_no"),
      
      (troop_get_slot, ":party_no", ":troop_no", slot_troop_leaded_party),
      (troop_get_slot, ":cur_wealth", ":troop_no", slot_troop_wealth),
      
      #while hiring reinforcements party leaders can only use 3/4 of their budget. This value is holding in ":hiring budget".
      (assign, ":hiring_budget", ":cur_wealth"),
      (val_mul, ":hiring_budget", 3),
      (val_div, ":hiring_budget", 4),
      
      (try_begin),
        (eq, ":party_no", "p_main_party"),
        (call_script, "script_game_get_party_companion_limit"),
        (store_div, ":ideal_size", reg0, 2),
      (else_try),
        (call_script, "script_party_get_ideal_size", ":party_no"),
        (assign, ":ideal_size", reg0),
      (try_end),
      
      (store_mul, ":ideal_top_size", ":ideal_size", 3),
      (val_div, ":ideal_top_size", 2),
      
      #(try_begin),
      #	(ge, "$cheat_mode", 1),
      #  (str_store_troop_name, s7, ":troop_no"),
      #  (assign, reg9, ":cur_wealth"),
      #  (display_message, "@{!}DEBUGS : {s7} total budget is {reg9}"),
      #  (assign, reg6, ":ideal_size"),
      #  (assign, reg7, ":ideal_top_size"),
      #  (assign, reg8, ":hiring_budget"),
      #  (display_message, "str_debug__hiring_men_to_s7_ideal_size__reg6_ideal_top_size__reg7_hiring_budget__reg8"),
      #(try_end),
      
      (party_get_num_companions, ":party_size", ":party_no"),
      
      (store_faction_of_party, ":party_faction", ":party_no"),
      (try_begin),
        (this_or_next|eq, ":party_faction", "fac_player_supporters_faction"),
        (eq, ":party_faction", "$players_kingdom"),
        (assign, ":reinforcement_cost", reinforcement_cost_moderate),
      (else_try),
        (options_get_campaign_ai, ":reduce_campaign_ai"), #moto chief
        (assign, ":reinforcement_cost", reinforcement_cost_moderate),
        (try_begin),
          (eq, ":reduce_campaign_ai", 0), #hard
          (assign, ":reinforcement_cost", reinforcement_cost_hard),
        (else_try),
          (eq, ":reduce_campaign_ai", 1), #moderate
          (assign, ":reinforcement_cost", reinforcement_cost_moderate),
        (else_try),
          (eq, ":reduce_campaign_ai", 2), #easy
          (assign, ":reinforcement_cost", reinforcement_cost_easy),
        (try_end),
      (try_end),
      
      (assign, ":num_rounds", 1),
      (try_for_range, ":unused", 0 , ":num_rounds"),
        (try_begin),
          (lt, ":party_size", ":ideal_size"),
          (gt, ":hiring_budget", ":reinforcement_cost"),
          (store_and, reg0, "$first_time", first_time_load_main_party),
          (this_or_next|neq, reg0, 0),
          (gt, ":party_no", 0),
          (call_script, "script_cf_reinforce_party", ":party_no"),
          (val_sub, ":cur_wealth", ":reinforcement_cost"),
          (troop_set_slot, ":troop_no", slot_troop_wealth, ":cur_wealth"),
        (else_try),
          (gt, ":party_size", ":ideal_top_size"),
          (store_troop_faction, ":troop_faction", ":troop_no"),
          (party_get_num_companion_stacks, ":num_stacks", ":party_no"),
          (assign, ":total_regulars", 0),
          (assign, ":total_regular_levels", 0),
          (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
            (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
            (neg|troop_is_hero, ":stack_troop"),
            (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
            (store_character_level, ":stack_level", ":stack_troop"),
            (store_troop_faction, ":stack_faction", ":stack_troop"),
            (try_begin),
              (eq, ":troop_faction", ":stack_faction"),
              (val_mul, ":stack_level", 3), #reducing the chance of the faction troops' removal
            (try_end),
            (val_mul, ":stack_level", ":stack_size"),
            (val_add, ":total_regulars", ":stack_size"),
            (val_add, ":total_regular_levels", ":stack_level"),
          (try_end),
          (gt, ":total_regulars", 0),
          (store_div, ":average_level", ":total_regular_levels", ":total_regulars"),
          (try_for_range_backwards, ":i_stack", 0, ":num_stacks"),
            (party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
            (neg|troop_is_hero, ":stack_troop"),
            (party_stack_get_size, ":stack_size", ":party_no", ":i_stack"),
            (store_character_level, ":stack_level", ":stack_troop"),
            (store_troop_faction, ":stack_faction", ":stack_troop"),
            (try_begin),
              (eq, ":troop_faction", ":stack_faction"),
              (val_mul, ":stack_level", 3),
            (try_end),
            (store_sub, ":level_dif", ":average_level", ":stack_level"),
            (val_div, ":level_dif", 3),
            (store_add, ":prune_chance", 10, ":level_dif"),
            (gt, ":prune_chance", 0),
            (call_script, "script_get_percentage_with_randomized_round", ":stack_size", ":prune_chance"),
            (gt, reg0, 0),
            (party_remove_members, ":party_no", ":stack_troop", reg0),
          (try_end),
        (try_end),
      (try_end),
  ]),

But it doesn't reference the original faction.
Please could you help?

 
Alex Kit said:
But it doesn't reference the original faction.

that scripts calculates how much money the lord has, to decide how many soldiers he can hire. The actual selection of troops is done on script_cf_reinforce_party, as you can see by the line "(call_script, "script_cf_reinforce_party", ...)
 
Thank you!!

I was mislead by this comment
# Adds reinforcement to party according to its type and faction
# Called from several places, simple_triggers for centers, script_hire_men_to_kingdom_hero_party for hero parties

Anyway, this is this script

Code:
script_cf_reinforce_party
  # Input: arg1 = party_no,
  # Output: none
  # Adds reinforcement to party according to its type and faction
  # Called from several places, simple_triggers for centers, script_hire_men_to_kingdom_hero_party for hero parties
  ("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
      
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),
      
      #Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),
      #Rebellion changes end
      
      (try_begin),
        (eq, ":party_no", "p_main_party"),
        (try_begin),
          (is_between, "$players_kingdom", npc_kingdoms_begin, npc_kingdoms_end),
          (assign, ":party_faction", "$players_kingdom"),
        (else_try),
          (assign, ":party_faction", "fac_player_supporters_faction"),
        (try_end),
        
      (else_try),
        (eq, ":party_faction", "fac_player_supporters_faction"),
        (is_between, ":party_no", walled_centers_begin, walled_centers_end),
        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
        (try_begin),
          (gt, ":town_lord", 0),
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
        (try_end),
      (try_end),
      
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),
      
      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (try_end),
      (else_try),
        (this_or_next|eq, ":party_no", "p_main_party"),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
          (lt, ":rand", 55),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (try_end),
      (try_end),
      
      (try_begin),
        (gt, ":party_template", 0),
        (party_add_template, ":party_no", ":party_template"),
      (try_end),
  ]),

As I noted earlier, excluding Rebellion, it only references to troop_original_faction here:
Code:
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),

Is this the line that needs to be changed? What should I better change it to?
 
Alex Kit said:
Is this the line that needs to be changed? What should I better change it to?

one of them.

Code:
      #Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),
      #Rebellion changes end
disable/remove this and also the rebellion system (there is a tweak for that).

the second party controls garrison troops (if you want towns/castles to have faction troops). Remove/disable it.

There may be other parts to change in the code (testing is your friend). You can check the [modding Q&A thread] https://forums.taleworlds.com/index.php/topic,347990.0.html for further help, as it is not about the tool itself.

Happy modding!
 
Thanks again for creating this wonderful tool!

A couple of mistakes found in the module files included with the tweaks tool 1.2:

In module_constants.py under #para negativos equipamiento chief habilidades

Tweaks tool has

desnudos_end = "itm_picts_hoodtunic_11"

2.036 has the correct term

desnudos_end = "itm_picts_hoodtunic_03"

This changes what equipment gets modifiers.

Next, in module_scripts, several of the terms for merchant gold deviate from default values because they are missing + and - amounts, so that even if the player does not tweak the value they still end up with substantially different merchant gold rules than Vanilla VC. So for example, in a couple of places:

Tweaks tool has:

(store_random_in_range,":new_gold",TWEAK_MERCHANT_MIN_CASH,TWEAK_MERCHANT_MAX_CASH),
     

2.036 has:
        (store_random_in_range, ":new_gold", 1000,2500),

For example the second term should have a -1500 modifier in the tweaks tool to maintain vanilla behavior with default values.


Thanks again for maintaining this great tool!



 
Seperating from the bug report some questions about differences that are not errors. I am sure the tweaks tool is right on them, just I was curious about the reason for the difference. Could you explain so I could learn a bit more?

Module_scripts.py, the Tweaks tool has this at the very beginning:

("game_check_party_sees_party", []),
  ("game_missile_launch", []),

But Vanilla VC module files lack this. I am curious what it does?

Then tweaks has this line in 2 places in module_scripts, after the script to calculate morale is used:
(assign, reg8, reg0),

2.036 instead has this line:
(assign, reg8, 50),

I imagine it is because tweaks tool lets the user mod default morale, but since the script that calculates morale also modifies it before assigning it to reg0, I can't figure out why Vanilla VC doesn't also use the reg0 value here.

I understand these 2 aren't problems with the tweaks tool, just curious to learn more about the reason for the difference.
 
Back
Top Bottom