Any way to mod starting order from charge to follow me?

Users who are viewing this thread

RoboPatton

Recruit
Is there any way to mod starting orders in battles, from charge to follow me?

Is there like a txt file or ini or some simply changed value?

If so, could somebody tell me? I'm not looking to download a mod of epic proportions, just want to change my existing module.
 
HannibalTheCannibal said:
I would love to know this too, though I'd prefer the default to be hold position. I start every battle spamming F1.

This is my problem too. A nations CPU army will usually come at you in a line marching 10 paces until fighting (unlike barbarians and looters who just rush in).

You really have to use a similar tactic to stand a chance, but all that button spamming, just to get the army to Step 1 is ridiculous.

There must be a way!
 
1) Go into module_mission_templates.py and then search for "lead_charge" (should be around line 2925).

2) Go into that mission, scroll down until you find the trigger that looks like this (around line 2300):
Code:
      (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),
                           ]),

3) Replace that tuple with the following:
Code:
      (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),
                           ## HOLD ON START
                           (get_player_agent_no, ":player_agent"),
                           (agent_get_team, ":player_team", ":player_agent"),
                           (set_show_messages, 0),
                           (team_give_order, ":player_team", grc_everyone, mordr_hold),
                           (set_show_messages, 1),
                           ## END HOLD ON START
                           ]),

4) Change "mordr_hold" to "mordr_follow" if you'd rather they begin following than holding.

6) Find other instances of missions containing the trigger beginning with
Code:
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
such as "village_attack_bandits" etc and add the bit enclosed in ##HOLD ON START comments as desired.

Credit to rubik's Custom Commander, where I first saw this bit of code.

 
Caba`drin said:
1) Go into module_mission_templates.py and then search for "lead_charge" (should be around line 2925).

2) Go into that mission, scroll down until you find the trigger that looks like this (around line 2300):
Code:
      (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),
                           ]),

3) Replace that tuple with the following:
Code:
      (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),
                           ## HOLD ON START
                           (get_player_agent_no, ":player_agent"),
                           (agent_get_team, ":player_team", ":player_agent"),
                           (set_show_messages, 0),
                           (team_give_order, ":player_team", grc_everyone, mordr_hold),
                           (set_show_messages, 1),
                           ## END HOLD ON START
                           ]),

4) Change "mordr_hold" to "mordr_follow" if you'd rather they begin following than holding.

6) Find other instances of missions containing the trigger beginning with
Code:
(0, 0, ti_once, [], [(assign,"$g_battle_won",0),
such as "village_attack_bandits" etc and add the bit enclosed in ##HOLD ON START comments as desired.

Credit to rubik's Custom Commander, where I first saw this bit of code.

Thanks for the help, however these files are not in native. I suppose I need to download a mod as a spring board to what I want? Anyway to do this without dling a new mod?
 
Mod system is pretty easy to use once you've run through it once. Especially is that's all you're changing.

Maybe one of us is up for compiling a native version of that and posting it. I'm too lazy. Any mods I make are to my own custom setup and I have enough trouble working up the willpower for that :smile:

Also I'm at work.
 
The file I mentioned is part of the Module System, the set of files containing actual code that is compiled to the text files with their numbers that you see in your Native folder. You can download the Module System here. There is some documentation on getting started with it here.

But, as CptStanky suggested, one could just compile it for you to allow for an easy switch...it's a give a man a fish/teach a man to fish situation.

Here's a fish:

0) Make a backup of mission_templates.txt (found in your Warband\Modules\Native\ folder)
1) Open up mission_templates.txt (turn off Wordwrap or use Notepad++, etc)
2) Search for "lead_charge" (should be around line 369)
3) Find the line of code that begins with "0.000000 0.000000" (it follows a line beginning with "-19.000000 0.000000" and comes before a line that begins with "30.000000 0.000000"; around line 383)
4) Select that entire line
5a) To make open field battles begin with your troops HOLDING, replace it with the following:
Code:
0.000000 0.000000 100000000.000000  0  11 2133 2 144115188075856297 0 2133 2 144115188075856298 0 2133 2 144115188075856299 0 1 1 936748722493063616 1 1 936748722493063652 2133 2 144115188075856300 2 1700 1 1224979098644774912 1770 2 1224979098644774913 1224979098644774912 1107 1 0 1790 3 1224979098644774913 9 0 1107 1 1
5b) To make open field battles begin with your troops FOLLOWING, replace it with the following:
Code:
0.000000 0.000000 100000000.000000  0  11 2133 2 144115188075856297 0 2133 2 144115188075856298 0 2133 2 144115188075856299 0 1 1 936748722493063616 1 1 936748722493063652 2133 2 144115188075856300 2 1700 1 1224979098644774912 1770 2 1224979098644774913 1224979098644774912 1107 1 0 1790 3 1224979098644774913 9 1 1107 1 1
6) Save and play!
 
Thanks for the assist. I'll try this later when I have more time. All the extra work seems intimidating, but I'll figure it out.
 
RoboPatton said:
Thanks for the assist. I'll try this later when I have more time. All the extra work seems intimidating, but I'll figure it out.

The procedure in the previous post is just copy-paste, I assure you. No sweat. Just be sure to make a backup of mission_templates.txt before you begin.
 
**Edit- Derrr I found it. notepad++ FTW.

***Edit 2- It works, thanks for the Fish!

Now, just for fun, what if you wanted to have one unit type Hold Position, and another to Stand Ground? Lets say, you hide archers behind melee units with shields, they tend to fight better when they can move a little, and Archers better when they don't move at all. Is it possible to say "Infantry, Stand Ground!" and "Archers Hold Position" right from the start?

I guess I really wonder, how many starting orders can you give? Or is it hard coded to only issue to "everyone".

This is more of a hypothetical then something I think I would want.


 
RoboPatton said:
I guess I really wonder, how many starting orders can you give? Or is it hard coded to only issue to "everyone".

Glad it's working out. Technically, what is hardcoded is the order to have everyone charge. This isn't changed with the numbers above. The bit you just copied in are simply orders given immediately after the "Everyone, Charge!" order to say either "Everyone Hold" or "Everyone Follow"; the end result is that the Charge order lasts only a fraction of a second and the Hold/Follow order takes over, so that is what you see. Since we're in the business of coding new orders, there could be as many orders as you would like, to as many different groups as you would like.
 
Back
Top Bottom