Hello all, I'm trying to disable bots spawning as cavalry units on certain maps of team deathmatch mode. In siege mode in NW there is working restriction for bots spawning as cavalry, at least in defending team, but I didn't find script for that. Maybe someone can point me where it is? I think it can be a start for disabling AI cavalry in other modes
Also I've noticed that on my new scene attacking team has no horses (but all bots are of the same unit), and defending team has cavalry, which is strange
I created new topic, but maybe here someone will see and help me (and, I guess, help many other modders), so sorry for double-posting.
I made many attempts to find a solution. I was advised to look into this module_mission_templates code,
Spoiler
(call_script, "script_multiplayer_find_bot_troop_and_group_for_spawn", ":selected_team", ":look_only_actives"),
(assign, ":selected_troop", reg0),
(assign, ":selected_group", reg1),
(team_get_faction, ":team_faction", ":selected_team"),
(assign, ":num_ai_troops", 0),
(try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
(eq, ":ai_troop_faction", ":team_faction"),
(val_add, ":num_ai_troops", 1),
(try_end),
As I think, disable cavalry for certain scenes could be made by adding list of scenes as condition and excluding cavalry units from available for spawning after oriiginal line
(try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
First of all I tried to add lines like (neg|troop_is_guarantee_horse, ":cur_ai_troop") or (neg|troop_select_type_cavalry, ":cur_ai_troop") and couple of other variants, but they didn't work, bots were dead in list of players.
In the end I changed module_constants (added infantry of all factions) after multiplayer_ai_troops_end (as this variable is referenced in original script)
Spoiler
multiplayer_ai_troops_begin = "trp_british_infantry_ai"
multiplayer_ai_troops_end = multiplayer_troops_begin
multiplayer_ai_british_infantry_begin = "trp_british_infantry_ai"
multiplayer_ai_british_infantry_end = "trp_british_hussar_ai"
multiplayer_ai_french_infantry_begin = "trp_french_infantry_ai"
multiplayer_ai_french_infantry_end = "trp_french_hussar_ai"
multiplayer_ai_prussian_infantry_begin = "trp_prussian_infantry_ai"
multiplayer_ai_prussian_infantry_end = "trp_prussian_dragoon_ai"
multiplayer_ai_russian_infantry_begin = "trp_russian_foot_guard_ai"
multiplayer_ai_russian_infantry_end = "trp_russian_hussar_ai"
multiplayer_ai_austrian_infantry_begin = "trp_austrian_infantry_ai"
multiplayer_ai_austrian_infantry_end = "trp_austrian_hussar_ai"
multiplayer_ai_rhine_infantry_begin = "trp_rhine_infantry_bavaria_ai"
multiplayer_ai_rhine_infantry_end = "trp_rhine_mounted_jaeger_ai"
So my code looks like this now
(call_script, "script_multiplayer_find_bot_troop_and_group_for_spawn", ":selected_team", ":look_only_actives"),
(assign, ":selected_troop", reg0),
(assign, ":selected_group", reg1),
(team_get_faction, ":team_faction", ":selected_team"),
(assign, ":num_ai_troops", 0),
(store_current_scene, ":cur_scene"),
(try_begin),
(eq, ":cur_scene", "scn_assault_on_malakoff_test"),
(eq, "$g_multiplayer_game_type", multiplayer_game_type_team_deathmatch),
(try_for_range, ":cur_ai_troop", multiplayer_ai_british_infantry_begin, multiplayer_ai_british_infantry_end),
(try_for_range, ":cur_ai_troop", multiplayer_ai_french_infantry_begin, multiplayer_ai_french_infantry_end),
(try_for_range, ":cur_ai_troop", multiplayer_ai_russian_infantry_begin, multiplayer_ai_russian_infantry_end),
(try_for_range, ":cur_ai_troop", multiplayer_ai_prussian_infantry_begin, multiplayer_ai_prussian_infantry_end),
(try_for_range, ":cur_ai_troop", multiplayer_ai_austrian_infantry_begin, multiplayer_ai_austrian_infantry_end),
(try_for_range, ":cur_ai_troop", multiplayer_ai_rhine_infantry_begin, multiplayer_ai_rhine_infantry_end),
(store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
(eq, ":ai_troop_faction", ":team_faction"),
(val_add, ":num_ai_troops", 1),
(try_end),
(else_try),
(try_for_range, ":cur_ai_troop", multiplayer_ai_troops_begin, multiplayer_ai_troops_end),
(store_troop_faction, ":ai_troop_faction", ":cur_ai_troop"),
(eq, ":ai_troop_faction", ":team_faction"),
(val_add, ":num_ai_troops", 1),
(try_end),
But bots are dead when I start team deathmach with bots.
And maybe I wrote something wrong? Maybe overall it's the right way, but I just wrote something wrong?
I really hope someone will help me.