1)
Do I understand correctly that I should just increase the value of 200?
There is also a call to this script from module_simple_triggers
In case of victory and destruction of the lair of bandits in module_mission_templates:
Yes, twiceIt uses the operation "agent_set_scripted_destination" to control the bandits, until you are close enough to let them charge.
Code:
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(agent_is_human, ":agent_no"),
(assign, "$relative_of_merchant_is_found", 0),
(try_begin),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_get_team, ":agent_team", ":agent_no"),
(eq, ":agent_team", 1),
(agent_get_position, pos4, ":agent_no"),
(agent_set_scripted_destination, ":agent_no", pos4, 1),
(try_end),
(try_begin),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(agent_set_team, ":agent_no", 7),
(team_set_relation, 0, 7, 0),
(try_end),
]),
(0, 0, 0,
[
(party_get_template_id, ":template", "$g_encountered_party"),
(eq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_save_relative_of_merchant"),
(eq, "$relative_of_merchant_is_found", 0),
],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(agent_set_scripted_destination, ":agent_no", pos0),
(agent_get_position, pos1, ":agent_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", 200),
#(assign, "$g_talk_troop", "trp_relative_of_merchant"),
(start_mission_conversation, "trp_relative_of_merchant"),
(try_end),
]),
[
(party_get_template_id, ":template", "$g_encountered_party"),
(eq, ":template", "pt_looter_lair"),
(check_quest_active, "qst_save_relative_of_merchant"),
(eq, "$relative_of_merchant_is_found", 0),
],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos0, ":player_agent"),
(try_for_agents, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(is_between, ":troop_no", "trp_relative_of_merchant", "trp_relative_of_merchants_end"),
(agent_set_scripted_destination, ":agent_no", pos0),
(agent_get_position, pos1, ":agent_no"),
(get_distance_between_positions, ":dist", pos0, pos1),
(le, ":dist", 200),
#(assign, "$g_talk_troop", "trp_relative_of_merchant"),
(start_mission_conversation, "trp_relative_of_merchant"),
(try_end),
]),
ok2) shows us your code
Code:
("spawn_bandit_lairs",
[
(party_template_set_slot, "pt_steppe_bandits", slot_party_template_lair_type, "pt_steppe_bandit_lair"),
(party_template_set_slot, "pt_river_pirates", slot_party_template_lair_type, "pt_river_pirates_lair"),###Ushkuiniky
(party_template_set_slot, "pt_mountain_bandits", slot_party_template_lair_type, "pt_mountain_bandit_lair"),
(party_template_set_slot, "pt_forest_bandits", slot_party_template_lair_type, "pt_forest_bandit_lair"),###Likhie Lyudi
###Van_added
(party_template_set_slot, "pt_poland_knightrobber", slot_party_template_lair_type, "pt_poland_knightrobber_lair"),
(party_template_set_slot, "pt_robber_knights_teuton", slot_party_template_lair_type, "pt_robber_knights_teuton_lair"),
(party_template_set_slot, "pt_sea_raiders", slot_party_template_lair_type, "pt_sea_raider_lair"),
# (party_template_set_slot, "pt_desert_bandits", slot_party_template_lair_type, "pt_desert_bandit_lair"),
(party_template_set_slot, "pt_steppe_bandits", slot_party_template_lair_spawnpoint, "p_steppe_bandit_spawn_point_1"),
(party_template_set_slot, "pt_river_pirates", slot_party_template_lair_spawnpoint, "p_river_pirates_spawn_point_1"),
(party_template_set_slot, "pt_mountain_bandits", slot_party_template_lair_spawnpoint, "p_mountain_bandit_spawn_point"),
(party_template_set_slot, "pt_forest_bandits", slot_party_template_lair_spawnpoint, "p_forest_bandit_spawn_point_1"),
###Van_added
(party_template_set_slot, "pt_poland_knightrobber", slot_party_template_lair_spawnpoint, "p_pol_knightrobbers_spawn_point_1"),
(party_template_set_slot, "pt_robber_knights_teuton", slot_party_template_lair_spawnpoint, "p_robber_knights_teuton_spawn_point_1"),
(party_template_set_slot, "pt_sea_raiders", slot_party_template_lair_spawnpoint, "p_sea_raider_spawn_point_1"),
# (party_template_set_slot, "pt_desert_bandits", slot_party_template_lair_spawnpoint, "p_desert_bandit_spawn_point"),
(try_for_range, ":bandit_template", "pt_steppe_bandits", "pt_deserters"),
# GNK temporary addition
(this_or_next|eq, ":bandit_template", "pt_steppe_bandits"),
(this_or_next|eq, ":bandit_template", "pt_mountain_bandits"),
(this_or_next|eq, ":bandit_template", "pt_river_pirates"),
(this_or_next|eq, ":bandit_template", "pt_forest_bandits"),
###Van_added
(this_or_next|eq, ":bandit_template", "pt_poland_knightrobber"),
(this_or_next|eq, ":bandit_template", "pt_robber_knights_teuton"),
(eq, ":bandit_template", "pt_sea_raiders"),
# end GNK temporary addition
(party_template_get_slot, ":bandit_lair_template", ":bandit_template", slot_party_template_lair_type),
(party_template_get_slot, ":bandit_lair_template_spawnpoint", ":bandit_template", slot_party_template_lair_spawnpoint),
(try_begin),
(eq, ":bandit_template", "pt_steppe_bandits"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_steppe_bandit_spawn_points),
(else_try),
(eq, ":bandit_template", "pt_mountain_bandits"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_mountain_bandit_spawn_points),
(else_try),
(eq, ":bandit_template", "pt_river_pirates"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_river_pirates_spawn_points),
(else_try),
(eq, ":bandit_template", "pt_forest_bandits"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_forest_bandit_spawn_points),
###Van_added
(else_try),
(eq, ":bandit_template", "pt_poland_knightrobber"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_pol_knightrobbers_spawn_points),
(else_try),
(eq, ":bandit_template", "pt_robber_knights_teuton"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_teu_knightrobbers_spawn_points),
###Van_end
(else_try),
(eq, ":bandit_template", "pt_sea_raiders"),
(store_add, ":max_spawn_point_no", ":bandit_lair_template_spawnpoint", num_sea_raider_spawn_points),
(try_end),
# (assign, reg1, ":max_spawn_point_no"),
# (display_message, "@{!}DEBUG : max_spawn_point_no: {reg1}"),
(try_for_range, ":bandit_lair_spawn_point", ":bandit_lair_template_spawnpoint", ":max_spawn_point_no"),
(store_sub, ":cur_slot", ":bandit_lair_spawn_point", ":bandit_lair_template_spawnpoint"),
(val_add, ":cur_slot", 4),
(party_template_get_slot, ":bandit_lair_party_slot_no", ":bandit_template", ":cur_slot"),#slot_party_template_lair_party + max_spawn_point_no
# (assign, reg1, ":bandit_lair_party_slot_no"),
# (display_message, "@{!}DEBUG : bandit_lair_party_slot_no: {reg1}"),
(le, ":bandit_lair_party_slot_no", 1),
(set_spawn_radius, 4), # do not change the radius otherwise the sea rider's lair coast position code may be broken, GNK
(spawn_around_party, ":bandit_lair_spawn_point", ":bandit_lair_template"),# (spawn_around_party,<party_id>,<party_template_id>)
(assign, ":new_camp", reg0),
(party_set_slot, ":new_camp", slot_party_type, spt_bandit_lair),
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_no, ":bandit_lair_spawn_point"),
(str_store_party_name, s4, ":new_camp"),
(party_get_position, pos4, ":new_camp"),
#(party_set_flags, ":new_camp", pf_icon_mask, 1),
(party_get_current_terrain, ":new_camp_terrain", ":new_camp"),
(position_get_z, ":elevation", pos4),
(assign, ":center_too_close", 0),
(try_for_range, ":center", centers_begin, centers_end),
(eq, ":center_too_close", 0),
(store_distance_to_party_from_party, ":distance", ":new_camp", ":center"),
(lt, ":distance", 3),
(assign, ":center_too_close", 1),
(try_end),
(try_begin),
(eq, ":center_too_close", 1),
(party_is_active, ":new_camp"),
(remove_party, ":new_camp"),
(party_template_set_slot, ":bandit_template", ":cur_slot", 0),# slot_party_template_lair_party
# (display_message, "@{!}DEBUG : !!! too close, no lair !!!"),
(else_try),
(eq, ":bandit_template", "pt_sea_raiders"),
(this_or_next|eq, ":new_camp_terrain", 3),
(this_or_next|eq, ":new_camp_terrain", 4),
(eq, ":new_camp_terrain", 5),
(assign, ":continue", 0),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 1),
(assign, ":continue", 1),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 2),
(assign, ":continue", 2),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 3),
(assign, ":continue", 3),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 4),
(assign, ":continue", 4),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 5),
(assign, ":continue", 5),
(try_end),
(try_begin),
(gt, ":continue", 1),
(map_get_land_position_around_position, pos6, pos5, 1),
(party_set_position, ":new_camp", pos6),
(try_end),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! sea raiders lair spawned !!!"),
(else_try),
(eq, ":bandit_template", "pt_river_pirates"),
(this_or_next|eq, ":new_camp_terrain", 2),
(this_or_next|eq, ":new_camp_terrain", 3),
(this_or_next|eq, ":new_camp_terrain", 4),
(eq, ":new_camp_terrain", 5),
(assign, ":continue", 0),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 1),
(assign, ":continue", 1),
# (position_get_x, reg2, pos5),
# (position_get_y, reg3, pos5),
# (position_get_z, reg4, pos5),
# (display_message, "@ water position (1): x{reg2}, y{reg3}, z{reg4}"),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 2),
(assign, ":continue", 2),
# (position_get_x, reg2, pos5),
# (position_get_y, reg3, pos5),
# (position_get_z, reg4, pos5),
# (display_message, "@ water position (2): x{reg2}, y{reg3}, z{reg4}"),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 3),
(assign, ":continue", 3),
# (position_get_x, reg2, pos5),
# (position_get_y, reg3, pos5),
# (position_get_z, reg4, pos5),
# (display_message, "@ water position (3): x{reg2}, y{reg3}, z{reg4}"),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 4),
(assign, ":continue", 4),
# (position_get_x, reg2, pos5),
# (position_get_y, reg3, pos5),
# (position_get_z, reg4, pos5),
# (display_message, "@ water position (4): x{reg2}, y{reg3}, z{reg4}"),
(try_end),
(try_begin),
(eq, ":continue", 0),
(map_get_water_position_around_position, pos5, pos4, 5),
(assign, ":continue", 5),
# (position_get_x, reg2, pos5),
# (position_get_y, reg3, pos5),
# (position_get_z, reg4, pos5),
# (display_message, "@ water position (5): x{reg2}, y{reg3}, z{reg4}"),
(try_end),
(try_begin),
(gt, ":continue", 0),
(map_get_land_position_around_position, pos6, pos5, 1),
# (position_get_x, reg2, pos6),
# (position_get_y, reg3, pos6),
# (position_get_z, reg4, pos6),
# (display_message, "@ land position: x{reg2}, y{reg3}, z{reg4}"),
(party_set_position, ":new_camp", pos6),
(try_end),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! river pirates lair spawned !!!"),
(else_try),
(eq, ":bandit_template", "pt_mountain_bandits"),
(eq, ":new_camp_terrain", 3),
(gt, ":elevation", 250),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! mountain bandits lair spawned !!!"),
# (else_try),
# (eq, ":bandit_template", "pt_desert_bandits"),
# (eq, ":new_camp_terrain", 5),
# (gt, ":lair_y", -9000),
# (gt, ":elevation", 125),
# (party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
# (party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
# (party_set_flags, ":new_camp", pf_disabled, 1),
(else_try),
(eq, ":bandit_template", "pt_steppe_bandits"),
(this_or_next|eq, ":new_camp_terrain", 2),
(this_or_next|eq, ":new_camp_terrain", 3),
(this_or_next|eq, ":new_camp_terrain", 4),
(eq, ":new_camp_terrain", 10),
# (this_or_next|eq, ":new_camp_terrain", 10),
# (gt, ":elevation", 200),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
# (party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! steppe bandits lair spawned !!!"),
(else_try),
(eq, ":bandit_template", "pt_forest_bandits"),
(eq, ":new_camp_terrain", 11),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! forest bandits lair spawned !!!"),
###Van_added
(else_try),
(eq, ":bandit_template", "pt_poland_knightrobber"),
# (eq, ":new_camp_terrain", 11),
(this_or_next|eq, ":new_camp_terrain", 2),
(this_or_next|eq, ":new_camp_terrain", 3),
(this_or_next|eq, ":new_camp_terrain", 4),
(eq, ":new_camp_terrain", 5),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! Knight-Robbers lair spawned !!!"),
(else_try),
(eq, ":bandit_template", "pt_robber_knights_teuton"),
# (eq, ":new_camp_terrain", 11),
(this_or_next|eq, ":new_camp_terrain", 2),
(this_or_next|eq, ":new_camp_terrain", 3),
(this_or_next|eq, ":new_camp_terrain", 4),
(eq, ":new_camp_terrain", 5),
(party_template_set_slot, ":bandit_template", ":cur_slot", ":new_camp"),# slot_party_template_lair_party
(party_set_slot, ":new_camp", slot_bandit_lair_spawn_point_slot_no, ":cur_slot"),
(party_set_flags, ":new_camp", pf_disabled, 1),
# (display_message, "@{!}DEBUG : !!! Raubritteren lair spawned !!!"),
###Van_out
(else_try),
(party_is_active, ":new_camp"),
(str_store_party_name, s4, ":new_camp"),
(remove_party, ":new_camp"),
(party_template_set_slot, ":bandit_template", ":cur_slot", 0),# slot_party_template_lair_party
# (display_message, "@{!}DEBUG : !!! bad type, no lair !!!"),
(try_end),
(try_end),
(try_end),
]),
There is also a call to this script from module_simple_triggers
Code:
(7 * 24,
[
(call_script, "script_spawn_bandit_lairs"),
]),
Code:
(party_set_slot, "$g_encountered_party", slot_party_ai_substate, 2),