More Reinforcement Waves

Currently viewing this thread:

monoolho

Knight
M&BWBWF&SNWVC
Alright, this is bothering me too much that I have to ask it here for help.
I like big lasting battles, but with only two waves that's hardly achieveable, so I started trying to figure out a way to tweak the reinforcement waves.

I got 75% of it but then one thing was standing in my way, leading my efforts to failure.
I used the same principle from MB in WB, 4 instances for attackers and 4 fordefenders, and I found all 8, but the very first one does not have a wave indicator, adding one leads to crash in the loading screen.


I am trying to edit the mission_templates.txt
The 8 instances I found are

2147483678 2 144115188075856298  and 2147483678 2 144115188075856299; however, 7 of them have (by default) the numbers 2, 5 and 7 after, which supposedly mean the number of reinforcement waves (2 is for attackers and defenders in open field and village battles, while 5 are attackers and 7 for defenders on castle battles), the first instance of 2147483678 2 144115188075856298 does not have any wave indicator beside it, it jumps right to 144115188075856300 2370 1 1224979098644774917 30 2 [...] and I have absolutely no idea what it does.

I also tried changing the first 25 to 26 and then adding a 12 after the code, trying a desperate theory, didn't work.

So I had to call for help on this matter, I modified the numbers to 12 without crash, but adding a number beside the first instance crashes on loading, without it I think that the defenders only get two waves on field battles, I didn't test it on castle battles to see if they changed, probably did, or didn't; but that renders the modification quasi-useless, since most of the battles are on the open field, and usually I am the attacker.

Now, does anybody have any sort of help/advice/information about it? If I am wrong about the reinforcement codes and those 7 instances are merely a coincidence, tell me, this information is very useful, especially for people with low-end computers and can't really fight huge battles with the battlesizer, and for those crazy who want epic monstrous ginormous battles.

This is the full line of code, if someone can actually understand any of it:
1.000000 0.000000 5.000000  25 1 2 936748722493063339 648518346341351439 2133 2 1224979098644774912 72057594037927936 2133 2 1224979098644774913 0 12 1 1224979098644774914 1704 1 1224979098644774914 1716 2 1224979098644774915 1224979098644774914 4 0 2147483679 2 1224979098644774915 648518346341351424 2147485354 1 1224979098644774914 2105 2 1224979098644774913 1 3 0 3 0 2121 3 1224979098644774916 1224979098644774912 1224979098644774913 4 0 2147483678 2 1224979098644774916 15 30 2 144115188075856298 2 31 2 144115188075856301 0 2105 2 144115188075856300 1 2133 2 144115188075856301 1 3 0 2147483678 2 144115188075856298 144115188075856300 2370 1 1224979098644774917 30 2 1224979098644774917 10 2385 2 1224979098644774918 0 2147483678 2 1224979098644774918 6  3 1930 2 0 7 2133 2 144115188075856301 0 2105 2 144115188075856298 1
 

monoolho

Knight
M&BWBWF&SNWVC
Thanks, but I can't get my head around python. Seriously.

I try using logic and searching for the entries, but I either find too many or not enough of them, and don't know which ones to modify.

I'm not trying to create a mod, I'm only trying to tweak the reinforcement waves, more specifically the defenders' open field reinforcements, that's why I asked for help instead of take my free time learning python.

If anyone with a little more expertise with pyhton could help pointing what to change there, I would be glad and could go on alone from there.

I THINK it might be around here...

Code:
(
    "lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
     ],
    [
      (ti_on_agent_spawn, 0, 0, [],
       [
         (store_trigger_param_1, ":agent_no"),
         (call_script, "script_agent_reassign_team", ":agent_no"),

         (assign, ":initial_courage_score", 5500),
         (store_random_in_range, ":randomized_addition_courage", 0, 3000), #average : 1500
         (val_add, ":initial_courage_score", ":randomized_addition_courage"), 
                   
         (agent_get_party_id, ":agent_party", ":agent_no"),         
         (party_get_morale, ":cur_morale", ":agent_party"),
         
         (store_sub, ":morale_effect_on_courage", ":cur_morale", 70),
         (val_mul, ":morale_effect_on_courage", 30), #this can effect morale with -2100..900
         (val_add, ":initial_courage_score", ":morale_effect_on_courage"), 
         
         #average = 6000 + 1500 = 7500; min : 6000, max : 9000
         #morale effect = min : -2100(party morale is 0), average : 0(party morale is 70), max : 900(party morale is 100)
         #min starting : 3900, max starting  : 9900, average starting : 6000
         (agent_set_slot, ":agent_no", slot_agent_courage_score, ":initial_courage_score"), 
         ]),

      common_battle_init_banner,
		 
      (ti_on_agent_killed_or_wounded, 0, 0, [],
       [
        (store_trigger_param_1, ":dead_agent_no"),
        (store_trigger_param_2, ":killer_agent_no"),
        (store_trigger_param_3, ":is_wounded"),

        (try_begin),
          (ge, ":dead_agent_no", 0),
          (neg|agent_is_ally, ":dead_agent_no"),
          (agent_is_human, ":dead_agent_no"),
          (agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
          (str_store_troop_name, s6, ":dead_agent_troop_id"),
          (assign, reg0, ":dead_agent_no"),
          (assign, reg1, ":killer_agent_no"),
          (assign, reg2, ":is_wounded"),
          (agent_get_team, reg3, ":dead_agent_no"),          
          #(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"), 
          (party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
          (eq, ":is_wounded", 1),
          (party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), 
        (try_end),

        (call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
       ]),

      common_battle_tab_press,

      (ti_question_answered, 0, 0, [],
       [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        (try_begin),
          (store_mission_timer_a, ":elapsed_time"),
          (gt, ":elapsed_time", 20),
          (str_store_string, s5, "str_retreat"),
          (call_script, "script_simulate_retreat", 10, 20, 1),
        (try_end),
        (call_script, "script_count_mission_casualties_from_agents"),
        (finish_mission,0),]),

      (ti_before_mission_start, 0, 0, [],
       [
         (team_set_relation, 0, 2, 1),
         (team_set_relation, 1, 3, 1),
         (call_script, "script_place_player_banner_near_inventory_bms"),

         (party_clear, "p_routed_enemies"),

         (assign, "$g_latest_order_1", 1), 
         (assign, "$g_latest_order_2", 1), 
         (assign, "$g_latest_order_3", 1), 
         (assign, "$g_latest_order_4", 1), 
         ]),

      
      (0, 0, ti_once, [], [(assign,"$g_battle_won",0),
                           (assign,"$defender_reinforcement_stage",0),
                           (assign,"$attacker_reinforcement_stage",0),
                           (call_script, "script_place_player_banner_near_inventory"),
                           (call_script, "script_combat_music_set_situation_with_culture"),
                           (assign, "$g_defender_reinforcement_limit", 2),
                           ]),

      common_music_situation_update,
      common_battle_check_friendly_kills,

      (1, 0, 5, [
                              
      #new (25.11.09) starts (sdsd = TODO : make a similar code to also helping ally encounters)
      #count all total (not dead) enemy soldiers (in battle area + not currently placed in battle area)
      (call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
      (assign, ":total_enemy_soldiers", reg0),
      
      #decrease number of agents already in battle area to find all number of reinforcement enemies
      (assign, ":enemy_soldiers_in_battle_area", 0),
      (try_for_agents,":cur_agent"),
        (agent_is_human, ":cur_agent"),
        (agent_get_party_id, ":agent_party", ":cur_agent"),
        (try_begin),
          (neq, ":agent_party", "p_main_party"),
          (neg|agent_is_ally, ":cur_agent"),
          (val_add, ":enemy_soldiers_in_battle_area", 1),
        (try_end),
      (try_end),
      (store_sub, ":total_enemy_reinforcements", ":total_enemy_soldiers", ":enemy_soldiers_in_battle_area"),

      (try_begin),
        (lt, ":total_enemy_reinforcements", 15),
        (ge, "$defender_reinforcement_stage", 2),
        (eq, "$defender_reinforcement_limit_increased", 0),
        (val_add, "$g_defender_reinforcement_limit", 2),                    
        (assign, "$defender_reinforcement_limit_increased", 1),
      (try_end),   

My initial plan was to edit the right entry(ies), create the mission_templates.txt file and then copy and paste the entries to the native file, or overwrite it, if necessary, but the file generated is different, reinfocement code is different.

Damn, it was so simple before... Why not include a simple option for that? It's so... essential.
 

SPD_Phoenix

Master Knight
From the code you posted above, go down to the next block where the triggers are.

      (lt,"$defender_reinforcement_stage","$g_defender_reinforcement_limit"), # Spd this is defender waves limit calculated above.
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10), # 10 minutes into the battle? Not too sure
                (store_normalized_team_count,":num_defenders", 0),
                (lt,":num_defenders",6)], # Number of defender left? This may have something to do with battle advantage. May be multiple of 6
          [(add_reinforcements_to_entry,0,7),(assign, "$defender_reinforcement_limit_increased", 0),(val_add,"$defender_reinforcement_stage",1)]), # Spawn a number of new defenders and add up the number of waves
     
      (1, 0, 5, [(lt,"$attacker_reinforcement_stage",2), # Spd - the number of attacker waves
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10), # Mission timer again
                (store_normalized_team_count,":num_attackers", 1),
                (lt,":num_attackers",6)], # Number of attackers left
          [(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]),  # spawn new attackers
I'm not too sure, but that's what I would try.
 

KON_Air

Master Knight
M&BWB
Code:
(store_normalized_team_count,":num_defenders", 0),
(lt,":num_defenders",6)], # Number of defender left? This may have something to do with battle advantage. May be multiple of 6

wow you guys are green...

in pathetic flesh language;
count the number of agents belong to team 0 and store it as number of defenders
if number of defenders is little then six
...
 

monoolho

Knight
M&BWBWF&SNWVC
Call me stupid,newbie or whatever, but I don't quite get it yet.

I don't know what to do.

Whatever I try to do crashes the game.

Can any "pro" at this teach a poor soul?
 

Tooff

Squire
it`s work for me (warband v.1.127)
in module_mission_templates.py find
      (lt,"$defender_reinforcement_stage", "$g_defender_reinforcement_limit" ),
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10),
                (store_normalized_team_count,":num_defenders", 0),
                (lt,":num_defenders",6)],
          [(add_reinforcements_to_entry,0,7),(assign, "$defender_reinforcement_limit_increased", 0),(val_add,"$defender_reinforcement_stage",1)]),
     
      (1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10),
                (store_normalized_team_count,":num_attackers", 1),
                (lt,":num_attackers",6)],
          [(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]),

and change the blue colored stuff to whatever, looks like:

      (lt,"$defender_reinforcement_stage", 9),
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10),
                (store_normalized_team_count,":num_defenders", 0),
                (lt,":num_defenders",6)],
          [(add_reinforcements_to_entry,0,7),(assign, "$defender_reinforcement_limit_increased", 0),(val_add,"$defender_reinforcement_stage",1)]),
     
      (1, 0, 5, [(lt,"$attacker_reinforcement_stage",9),
                (store_mission_timer_a,":mission_time"),
                (ge,":mission_time",10),
                (store_normalized_team_count,":num_attackers", 1),
                (lt,":num_attackers",6)],
          [(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]),
here i change it to 9 for both sides (after 300 dead battle end)
 
Top Bottom