Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Angry Newbie said:
Does anybody know how to increase the Captain Co-op teammate bot limit so that the limit can be higher then 6? Ive been shifting through the code and cannot figure out where the line is that even dictates the limits.

While im at it, Is there a way to increase the enemy bot limit percentage? so more enemy spawn?

I think I remember seeing parts in module_presentations and module_scripts....
 
Holla, got a problem. I added a 7th faction to the game, and everything was fine. Then I decided to port my current work to Diplomacy, and succeeded, except for one tiny part. Kingdom 7 works fine, but it starts out with no armies. The lords are just sitting in their castles, completely alone.
 
Toasticuss said:
Angry Newbie said:
Does anybody know how to increase the Captain Co-op teammate bot limit so that the limit can be higher then 6? Ive been shifting through the code and cannot figure out where the line is that even dictates the limits.

While im at it, Is there a way to increase the enemy bot limit percentage? so more enemy spawn?

I think I remember seeing parts in module_presentations and module_scripts....

Ive seen bits and pieces but i do not know which line changes the limits, i have no idea if i have to change an actual number or replace a line(s)...
 
Somebody said:
Look for instances of (assign, "$g_multiplayer_squad_size", 6), in both module_presentations and module_scripts

Thats what i had thought. I changed the number in scripts but i didnt think to look in presentations.

Whelp, That actually did not work, Any more suggestions?
 
Hey mates ! I've got two questions.

The first is not mine (its Lato's) but I'd be really interested (Lato was said to post it here but he didn't) :
Ok I have seen this in a few roman mods in some form or another, but i just want the basic one. When the battle starts the few horse troops always run ahead like fools and die while the main force walks slowly behind, its stuipd and I dont know why WB and fire and sword have it. What is the edit I have to do to make your whole army stay in place and await orders at the start of a battle? Now i dont use the MS i just edit text, so what folder and line do I need to change?
Original thread here. Difference is I use the MS.

My second question is : is it possible to edit a mod by using the Module System ? I'm running Diplomacy but, whenever I use the MS, I'm forced to copy-paste some lines from a "MS'd Native" folder without really knowing what I'm doing. Nevermind. I know it's impossible but some great guy gave me what I was searching for. First question still relevant. :smile:

Thanks.
 
Zamensis said:
Ok I have seen this in a few roman mods in some form or another, but i just want the basic one. When the battle starts the few horse troops always run ahead like fools and die while the main force walks slowly behind, its stuipd and I dont know why WB and fire and sword have it.
The official answer was somewhat "it's more convenient for noobs".

Zamensis said:
What is the edit I have to do to make your whole army stay in place and await orders at the start of a battle? Now i dont use the MS i just edit text, so what folder and line do I need to change?

In single player battle mission templates you need to add a trigger like
Code:
( 0, 2, ti_once, [],
  [
     (get_player_agent_no, ":player_agent"),
     (agent_get_team, ":agent_team", ":player_agent"),
     (team_give_order, ":agent_team", grc_everyone, mordr_hold),    ])
 
Oh I see. Thanks for your help but that's not exactly what I'm searching for (sorry). I mean, there's three choices for an army to make :
1 - They just charge, that's the most common.
2 - They charge, but all soldiers hold a line and walk slowly to the enemy.
3 - They stand ground, that's only for the AI sometimes when being attacked.

I'd like to keep choice 3 as it is. And choice 1 should be replaced by choice 2 in most cases. There's just an exception for neutral factions (looters, bandits, ...) and Khergits because they're only horsemen and would suffer heavy damages if advancing slowly. I don't know if it's possible to tweak this.

I hope you understand, since my English is pretty bad. :???:

Edit : But I'll retain your suggestion for the player's army. :smile:
Edit 2 : Hail to the foxes ! :lol:
 
Rongar said:
Zamensis said:
Ok I have seen this in a few roman mods in some form or another, but i just want the basic one. When the battle starts the few horse troops always run ahead like fools and die while the main force walks slowly behind, its stuipd and I dont know why WB and fire and sword have it.
The official answer was somewhat "it's more convenient for noobs".

Zamensis said:
What is the edit I have to do to make your whole army stay in place and await orders at the start of a battle? Now i dont use the MS i just edit text, so what folder and line do I need to change?

In single player battle mission templates you need to add a trigger like




I cant find this is the text files, is this for the MS?
Code:
( 0, 2, ti_once, [],
  [
     (get_player_agent_no, ":player_agent"),
     (agent_get_team, ":agent_team", ":player_agent"),
     (team_give_order, ":agent_team", grc_everyone, mordr_hold),    ])
 
Zamensis said:
I hope you understand, since my English is pretty bad. :???:
I understand your English but confused about your goal.
1. Do you want to tweak enemy/ally AI behavior, to make It more often choose the second strategy?
2. Or do you want to implement something for players army?

For 1, you need to find select_battle_tactic_aux in scripts and change conditions.

Lato said:
I cant find this is the text files, is this for the MS?
Yes, it's for MS.
 
Rongar said:
Zamensis said:
I hope you understand, since my English is pretty bad. :???:
I understand your English but confused about your goal.
1. Do you want to tweak enemy/ally AI behavior, to make It more often choose the second strategy?
2. Or do you want to implement something for players army?

For 1, you need to find select_battle_tactic_aux in scripts and change conditions.

Lato said:
I cant find this is the text files, is this for the MS?
Yes, it's for MS.

I dont soppose you know the line to change it in text files?
 
If you're talking about tweak enemy AI, I of course know the line, it's next line after select_battle_tactic_aux -1 in scripts.txt. But I'm afraid that does not help you.
If you mean adding trigger into a mission. You should find e.g. 'mst_lead_charge lead_charge' in mission_tempates.txt
Code:
mst_lead_charge lead_charge 65538  8
You_lead_your_men_to_battle. 

4 1 4160 0 16 12 0  
0 4160 0 16 0 0  
4 8320 0 16 12 0  
4 8320 0 16 0 0  
21
21 is number of triggers you should change it to 22.
Then you should add new trigger. You may do it just on the next line.
But before you need to translate ms trigger representation into txt one, or find some how does it. It's not that difficult but I don't wont to waste my time on this routine.
 
Rongar said:
If you're talking about tweak enemy AI, I of course know the line, it's next line after select_battle_tactic_aux -1 in scripts.txt. But I'm afraid that does not help you.
If you mean adding trigger into a mission. You should find e.g. 'mst_lead_charge lead_charge' in mission_tempates.txt
Code:
mst_lead_charge lead_charge 65538  8
You_lead_your_men_to_battle. 

4 1 4160 0 16 12 0  
0 4160 0 16 0 0  
4 8320 0 16 12 0  
4 8320 0 16 0 0  
21
21 is number of triggers you should change it to 22.
Then you should add new trigger. You may do it just on the next line.
But before you need to translate ms trigger representation into txt one, or find some how does it. It's not that difficult but I don't wont to waste my time on this routine.

No im not talking about the enemy AI, im talking about your party, I dont want them to always charge, I just want them to wait at the start of the battle.
 
Toasticuss said:
Where in the source is the code for the amount of bandits per party?

Somebody said:
module_party_templates
and
script_update_party_creation_random_limits

Lato said:
No im not talking about the enemy AI, im talking about your party, I dont want them to always charge, I just want them to wait at the start of the battle.
The second part of my previous post is right about it. I provided you a trigger you need to translate it and add into mission_templates.txt as I wrote above.
 
Rongar said:
I understand your English but confused about your goal.
1. Do you want to tweak enemy/ally AI behavior, to make It more often choose the second strategy?
2. Or do you want to implement something for players army?

For 1, you need to find select_battle_tactic_aux in scripts and change conditions.
Yeah, I was thinking of option 1.

I believe this is what I'm interested in but I have absolutely no idea what I should change. :???:
Code:
  # script_select_battle_tactic
  # Input: none
  # Output: none
  ("select_battle_tactic",
    [
      (assign, "$ai_team_1_battle_tactic", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_team, ":player_team", ":player_agent"),
      (try_begin),
        (num_active_teams_le, 2),
        (try_begin),
          (eq, ":player_team", 0),
          (assign, "$ai_team_1", 1),
        (else_try),
          (assign, "$ai_team_1", 0),
        (try_end),
        (assign, "$ai_team_2", -1),
      (else_try),
        (try_begin),
          (eq, ":player_team", 0),
          (assign, "$ai_team_1", 1),
        (else_try),
          (assign, "$ai_team_1", 0),
        (try_end),
        (store_add, "$ai_team_2", ":player_team", 2),
      (try_end),
      (call_script, "script_select_battle_tactic_aux", "$ai_team_1", 0),
      (assign, "$ai_team_1_battle_tactic", reg0),
      (try_begin),
        (ge, "$ai_team_2", 0),
        (assign, ":defense_not_an_option", 0),
        (try_begin),
          (eq, "$ai_team_1_battle_tactic", btactic_hold),
          (assign, ":defense_not_an_option", 1), #don't let two AI defend at the same time
        (try_end),
        (call_script, "script_select_battle_tactic_aux", "$ai_team_2", ":defense_not_an_option"),
        (assign, "$ai_team_2_battle_tactic", reg0),
      (try_end),
  ]),

  # script_select_battle_tactic_aux
  # Input: team_no
  # Output: battle_tactic
  ("select_battle_tactic_aux",
    [
      (store_script_param, ":team_no", 1),
      (store_script_param, ":defense_not_an_option", 2),
      (assign, ":battle_tactic", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_team, ":player_team", ":player_agent"),
      (try_begin),
        (eq, "$cant_leave_encounter", 1),
        (teams_are_enemies, ":team_no", ":player_team"),
        (assign, ":defense_not_an_option", 1),
      (try_end),
      (call_script, "script_team_get_class_percentages", ":team_no", 0),
      #      (assign, ":ai_perc_infantry", reg0),
      (assign, ":ai_perc_archers",  reg1),
      (assign, ":ai_perc_cavalry",  reg2),
      (call_script, "script_team_get_class_percentages", ":team_no", 1),#enemies of the ai_team
      #      (assign, ":enemy_perc_infantry", reg0),
      #      (assign, ":enemy_perc_archers",  reg1),
      #      (assign, ":enemy_perc_cavalry",  reg2),

      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (assign, ":continue", 0),
        (try_begin),
          (teams_are_enemies, ":team_no", ":player_team"),
          (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_hero_party),
          (assign, ":continue", 1),
        (else_try),
          (neg|teams_are_enemies, ":team_no", ":player_team"),
          (gt, "$g_ally_party", 0),
          (party_slot_eq, "$g_ally_party", slot_party_type, spt_kingdom_hero_party),
          (assign, ":continue", 1),
        (try_end),
        #(this_or_next|lt, ":rand", 20),
        (eq, ":continue", 1),
		(store_faction_of_party, ":enemy_faction_no", "$g_enemy_party"),
		(neq, ":enemy_faction_no", "fac_kingdom_3"), #don't let khergits use battle tactics
        (try_begin),
          (eq, ":defense_not_an_option", 0),
          (gt, ":ai_perc_archers", 50),
          (lt, ":ai_perc_cavalry", 35),
          (assign, ":battle_tactic", btactic_hold),
        (else_try),
          (lt, ":rand", 80),
          (assign, ":battle_tactic", btactic_follow_leader),
        (try_end),
      (try_end),
      (assign, reg0, ":battle_tactic"),
  ]),  # script_select_battle_tactic
  # Input: none
  # Output: none
  ("select_battle_tactic",
    [
      (assign, "$ai_team_1_battle_tactic", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_team, ":player_team", ":player_agent"),
      (try_begin),
        (num_active_teams_le, 2),
        (try_begin),
          (eq, ":player_team", 0),
          (assign, "$ai_team_1", 1),
        (else_try),
          (assign, "$ai_team_1", 0),
        (try_end),
        (assign, "$ai_team_2", -1),
      (else_try),
        (try_begin),
          (eq, ":player_team", 0),
          (assign, "$ai_team_1", 1),
        (else_try),
          (assign, "$ai_team_1", 0),
        (try_end),
        (store_add, "$ai_team_2", ":player_team", 2),
      (try_end),
      (call_script, "script_select_battle_tactic_aux", "$ai_team_1", 0),
      (assign, "$ai_team_1_battle_tactic", reg0),
      (try_begin),
        (ge, "$ai_team_2", 0),
        (assign, ":defense_not_an_option", 0),
        (try_begin),
          (eq, "$ai_team_1_battle_tactic", btactic_hold),
          (assign, ":defense_not_an_option", 1), #don't let two AI defend at the same time
        (try_end),
        (call_script, "script_select_battle_tactic_aux", "$ai_team_2", ":defense_not_an_option"),
        (assign, "$ai_team_2_battle_tactic", reg0),
      (try_end),
  ]),

  # script_select_battle_tactic_aux
  # Input: team_no
  # Output: battle_tactic
  ("select_battle_tactic_aux",
    [
      (store_script_param, ":team_no", 1),
      (store_script_param, ":defense_not_an_option", 2),
      (assign, ":battle_tactic", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_team, ":player_team", ":player_agent"),
      (try_begin),
        (eq, "$cant_leave_encounter", 1),
        (teams_are_enemies, ":team_no", ":player_team"),
        (assign, ":defense_not_an_option", 1),
      (try_end),
      (call_script, "script_team_get_class_percentages", ":team_no", 0),
      #      (assign, ":ai_perc_infantry", reg0),
      (assign, ":ai_perc_archers",  reg1),
      (assign, ":ai_perc_cavalry",  reg2),
      (call_script, "script_team_get_class_percentages", ":team_no", 1),#enemies of the ai_team
      #      (assign, ":enemy_perc_infantry", reg0),
      #      (assign, ":enemy_perc_archers",  reg1),
      #      (assign, ":enemy_perc_cavalry",  reg2),

      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (assign, ":continue", 0),
        (try_begin),
          (teams_are_enemies, ":team_no", ":player_team"),
          (party_slot_eq, "$g_enemy_party", slot_party_type, spt_kingdom_hero_party),
          (assign, ":continue", 1),
        (else_try),
          (neg|teams_are_enemies, ":team_no", ":player_team"),
          (gt, "$g_ally_party", 0),
          (party_slot_eq, "$g_ally_party", slot_party_type, spt_kingdom_hero_party),
          (assign, ":continue", 1),
        (try_end),
        #(this_or_next|lt, ":rand", 20),
        (eq, ":continue", 1),
		(store_faction_of_party, ":enemy_faction_no", "$g_enemy_party"),
		(neq, ":enemy_faction_no", "fac_kingdom_3"), #don't let khergits use battle tactics
        (try_begin),
          (eq, ":defense_not_an_option", 0),
          (gt, ":ai_perc_archers", 50),
          (lt, ":ai_perc_cavalry", 35),
          (assign, ":battle_tactic", btactic_hold),
        (else_try),
          (lt, ":rand", 80),
          (assign, ":battle_tactic", btactic_follow_leader),
        (try_end),
      (try_end),
      (assign, reg0, ":battle_tactic"),
  ]),
 
Lueii said:
I want to make a way to go from the Intro menu to the town of Praven.  How is this best done?

Somebody said:
(start_encounter, "p_town_6"),
+
(party_relocate_near_party, "p_main_party", "p_town_6", 2),

Zamensis said:
I believe this is what I'm interested in but I have absolutely no idea what I should change. :???:
It depends on what you want to do.
This
Zamensis said:
I'd like to keep choice 3 as it is. And choice 1 should be replaced by choice 2 in most cases. There's just an exception for neutral factions (looters, bandits, ...) and Khergits because they're only horsemen and would suffer heavy damages if advancing slowly. I don't know if it's possible to tweak this.
means you need to understand and rewrite script_select_battle_tactic_aux.
 
Status
Not open for further replies.
Back
Top Bottom