testing_bot_troops_end = "trp_godlike_hero"
To make bots not attack each other, set them in a different hard coded team from 3 - 7 and set the team relations to be friendly to each other but hostile to the player team 1 (human players can only use teams 0 and 1, hard coded into the multiplayer part of the engine); you could either set the relevant parameter of add_visitors_to_current_scene (see header_operations) or use agent_set_team from inside ti_on_agent_spawned.
team_bots = 3
(team_set_relation, team_bots, team_bots, 1), # make bots allied to each other
(team_set_relation, team_bots, team_default, -1), # make bots enemies with the default player team
(team_set_relation, team_default, team_bots, -1),
(team_set_relation, team_bots, team_spawn_invulnerable, 0), # prevent bots from attacking players while protected for 10 seconds after spawn
(team_set_relation, team_spawn_invulnerable, team_bots, 0),
(try_begin),
(agent_is_non_player, ":agent_id"),
(agent_set_team, ":agent_id", team_bots),
(try_end),
Vornne said:After testing the team_no parameter of add_visitors_to_current_scene, it seems that it only works for the hard coded multiplayer teams, 0 and 1; so you would need to use the agent_set_team method on spawn (which I know works, for bots). First define a label for the team number you want to use in header_common.py, after the current "team_default", "team_spawn_invulnerable", "team_spectators" lines:Then set the relations in a mission start trigger, like the one named before_mission_start_setup in PW:Code:team_bots = 3
Then add this block either at the start or the end of script_on_agent_spawned (which is called by the mission template trigger ti_on_agent_spawn):Code:(team_set_relation, team_bots, team_bots, 1), # make bots allied to each other (team_set_relation, team_bots, team_default, -1), # make bots enemies with the default player team (team_set_relation, team_default, team_bots, -1), (team_set_relation, team_bots, team_spawn_invulnerable, 0), # prevent bots from attacking players while protected for 10 seconds after spawn (team_set_relation, team_spawn_invulnerable, team_bots, 0),
And then you get an unending rabble surrounding and constantly attacking you, like the sallies against castle sieging in single player...Code:(try_begin), (agent_is_non_player, ":agent_id"), (agent_set_team, ":agent_id", team_bots), (try_end),