markfamily
Sergeant at Arms
Further to my problem with the commander troop problem I have inserted a debugging script from diplomacy and it has helped, also it wasn't the problem I thought it was.
Which is weird as I entered it like was printed
module triggers
module simple triggers
(party_set_slot, ":party_no", slot_party_ai_object, ":target_center"),
(try_end),
(try_end),
]),
#mark edits start reinforce garrison
(0.2, #Every 0.2 game hours will the game check if there are any reinforcements in the centers.
[
(try_for_parties, ":party_no"),
(party_slot_eq, ":party_no", slot_party_type, spt_reinforcement_party), #Find parties of the type spt_reinforcement_party
(party_is_in_any_town, ":party_no"), # Is the party in any town?
(party_get_cur_town, ":cur_center", ":party_no"), #What town are they in?
(call_script, "script_party_add_party_companions", ":cur_center", ":party_no"), #Add the party to the center, which is infact a party
(party_clear, ":party_no"), #Not sure if this cleaning up is necessary, but it's a precaution so we don't have a bundle of templates lying around.
(try_end),
]),
#mark edits end reinforce garrison
#Troop AI: Village farmers thinking
(8,
[
(try_for_parties, ":party_no"),
The only thing i can think of is that i have more factions than native i have 10 instead of 6 but cannot see any reference for that.
Again as always any help would be great.
Edit: I wonder if it has something to do with the constants
Yep was the position moved the reinforcement and all seems ok
DEBUG -- Doing political calculations for Princess Hallbera
Boyar Nelag commander of party #1638 which is not his troop leaded party 1640
Commanded party #1638 is Reinforcements from Azgad, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1637 which is not his troop leaded party 1640
Commanded party #1637 is Reinforcements from Epeshe, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1636 which is not his troop leaded party 1640
Commanded party #1636 is Reinforcements from Iyindah, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1635 which is not his troop leaded party 1640
Commanded party #1635 is Reinforcements from Cazzeck, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1634 which is not his troop leaded party 1640
Commanded party #1634 is Reinforcements from Ler Via, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1633 which is not his troop leaded party 1640
Commanded party #1633 is Reinforcements from Chaeza, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1632 which is not his troop leaded party 1640
Commanded party #1632 is Reinforcements from Aldelen, troop leaded party #1640 is Boyar Nelag's Party
DEBUG -- Doing political calculations for Princess Brynhild
Boyar Nelag commander of party #1638 which is not his troop leaded party 1640
Commanded party #1638 is Reinforcements from Azgad, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1637 which is not his troop leaded party 1640
Commanded party #1637 is Reinforcements from Epeshe, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1636 which is not his troop leaded party 1640
Commanded party #1636 is Reinforcements from Iyindah, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1635 which is not his troop leaded party 1640
Commanded party #1635 is Reinforcements from Cazzeck, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1634 which is not his troop leaded party 1640
Commanded party #1634 is Reinforcements from Ler Via, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1633 which is not his troop leaded party 1640
Commanded party #1633 is Reinforcements from Chaeza, troop leaded party #1640 is Boyar Nelag's Party
Boyar Nelag commander of party #1632 which is not his troop leaded party 1640
Commanded party #1632 is Reinforcements from Aldelen, troop leaded party #1640 is Boyar Nelag's Party
DEBUG -- Doing political calculations for Princess Brynhild
module triggers
(assign, "$npc_to_rejoin_party", ":npc"),
(try_end),
(try_end),
(try_end),
]),
#NPC system changes end
#mark edits srart garrison reinforcements
(36, 0, 0.0, [], [ ## Set the reinforcements interval to 36 Game hours. Change as you feel like.
(try_for_range, ":center", walled_centers_begin, walled_centers_end),
(party_get_slot, ":besieged", ":center", slot_center_is_besieged_by),
(neg|ge, ":besieged", 0), #Town/castle is under siege jump out
(store_faction_of_party, ":faction", ":center"),
(party_get_num_companions, ":garrison", ":center"),
(faction_get_slot, ":party_template_a", ":faction", slot_faction_reinforcements_a),
(faction_get_slot, ":party_template_b", ":faction", slot_faction_reinforcements_b),
(faction_get_slot, ":party_template_c", ":faction", slot_faction_reinforcements_c),
(assign, ":party_template", 0),
(try_begin),
(party_slot_eq, ":center", slot_party_type, spt_town),
(lt, ":garrison", 600), ## Under this number of troops will towns get reinforcements
(assign, ":party_template", "pt_reinforcements"),
(else_try),
(party_slot_eq, ":center", slot_party_type, spt_castle),
(lt, ":garrison", 400), ## Under this number of troops will castles get reinforcements
(assign, ":party_template", "pt_reinforcements"),
(try_end),
(try_begin),
(gt, ":party_template", 0),
(try_for_range, ":village_reinforcements", villages_begin, villages_end),
(try_begin),
(party_slot_eq, ":center", slot_party_type, spt_castle), ## For Castles
(party_slot_eq, ":village_reinforcements", slot_village_bound_center, ":center"),
(party_slot_eq, ":village_reinforcements", slot_village_state, svs_normal), ## Not if the village is being raided or is looted
(neg|party_slot_eq, ":center", slot_town_lord, "trp_player"), ## Not a player owned center
(spawn_around_party, ":village_reinforcements", ":party_template"),
(assign, ":result", reg0),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(is_between, ":rand", 0, 45), ## Get weakest template
(party_add_template, ":result", ":party_template_a"),
(else_try),
(is_between, ":rand", 45, 85), ## Get stronger template
(party_add_template, ":result", ":party_template_b"),
(else_try),
(ge, ":rand", 85), ## Get strongest template
(party_add_template, ":result", ":party_template_c"),
(try_end),
(party_set_faction, ":result", ":faction"),
(party_set_slot, ":result", slot_party_type, spt_reinforcement_party),
(party_set_slot, ":result", slot_party_ai_object, ":center"),
(str_store_party_name, s14, ":village_reinforcements"),
(party_set_name, ":result", "@Reinforcements from {s14}"),
(party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
(party_set_ai_object,":result", ":center"),
(party_set_flags, ":result", pf_default_behavior, 1),
(else_try),
(party_slot_eq, ":center", slot_party_type, spt_town), ## For Towns
(party_slot_eq, ":village_reinforcements", slot_village_bound_center, ":center"),
(party_slot_eq, ":village_reinforcements", slot_village_state, svs_normal), ## Not if the village is being raided or is looted
# (neg|party_slot_eq, ":center", slot_town_lord, "trp_player"), ## Not a player owned center
(spawn_around_party, ":village_reinforcements", ":party_template"),
(assign, ":result", reg0),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(is_between, ":rand", 0, 45), ## Get weakest template
(party_add_template, ":result", ":party_template_a"),
(else_try),
(is_between, ":rand", 40, 85), ## Get stronger template
(party_add_template, ":result", ":party_template_b"),
(else_try),
(ge, ":rand", 85), ## Get strongest template
(party_add_template, ":result", ":party_template_c"),
(try_end),
(party_set_faction, ":result", ":faction"),
(party_set_slot, ":result", slot_party_type, spt_reinforcement_party),
(party_set_slot, ":result", slot_party_ai_object, ":center"),
(str_store_party_name, s14, ":village_reinforcements"),
(party_set_name, ":result", "@Reinforcements from {s14}"),
(party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
(party_set_ai_object,":result", ":center"),
(party_set_flags, ":result", pf_default_behavior, 1),
(try_end),
(try_end),
(try_end),
(try_end)]),
#mark edits end garrison reinforcements
#NPC system changes end
# Lady of the lake achievement
(1, 0, 0,
[
(try_end),
(try_end),
(try_end),
]),
#NPC system changes end
#mark edits srart garrison reinforcements
(36, 0, 0.0, [], [ ## Set the reinforcements interval to 36 Game hours. Change as you feel like.
(try_for_range, ":center", walled_centers_begin, walled_centers_end),
(party_get_slot, ":besieged", ":center", slot_center_is_besieged_by),
(neg|ge, ":besieged", 0), #Town/castle is under siege jump out
(store_faction_of_party, ":faction", ":center"),
(party_get_num_companions, ":garrison", ":center"),
(faction_get_slot, ":party_template_a", ":faction", slot_faction_reinforcements_a),
(faction_get_slot, ":party_template_b", ":faction", slot_faction_reinforcements_b),
(faction_get_slot, ":party_template_c", ":faction", slot_faction_reinforcements_c),
(assign, ":party_template", 0),
(try_begin),
(party_slot_eq, ":center", slot_party_type, spt_town),
(lt, ":garrison", 600), ## Under this number of troops will towns get reinforcements
(assign, ":party_template", "pt_reinforcements"),
(else_try),
(party_slot_eq, ":center", slot_party_type, spt_castle),
(lt, ":garrison", 400), ## Under this number of troops will castles get reinforcements
(assign, ":party_template", "pt_reinforcements"),
(try_end),
(try_begin),
(gt, ":party_template", 0),
(try_for_range, ":village_reinforcements", villages_begin, villages_end),
(try_begin),
(party_slot_eq, ":center", slot_party_type, spt_castle), ## For Castles
(party_slot_eq, ":village_reinforcements", slot_village_bound_center, ":center"),
(party_slot_eq, ":village_reinforcements", slot_village_state, svs_normal), ## Not if the village is being raided or is looted
(neg|party_slot_eq, ":center", slot_town_lord, "trp_player"), ## Not a player owned center
(spawn_around_party, ":village_reinforcements", ":party_template"),
(assign, ":result", reg0),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(is_between, ":rand", 0, 45), ## Get weakest template
(party_add_template, ":result", ":party_template_a"),
(else_try),
(is_between, ":rand", 45, 85), ## Get stronger template
(party_add_template, ":result", ":party_template_b"),
(else_try),
(ge, ":rand", 85), ## Get strongest template
(party_add_template, ":result", ":party_template_c"),
(try_end),
(party_set_faction, ":result", ":faction"),
(party_set_slot, ":result", slot_party_type, spt_reinforcement_party),
(party_set_slot, ":result", slot_party_ai_object, ":center"),
(str_store_party_name, s14, ":village_reinforcements"),
(party_set_name, ":result", "@Reinforcements from {s14}"),
(party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
(party_set_ai_object,":result", ":center"),
(party_set_flags, ":result", pf_default_behavior, 1),
(else_try),
(party_slot_eq, ":center", slot_party_type, spt_town), ## For Towns
(party_slot_eq, ":village_reinforcements", slot_village_bound_center, ":center"),
(party_slot_eq, ":village_reinforcements", slot_village_state, svs_normal), ## Not if the village is being raided or is looted
# (neg|party_slot_eq, ":center", slot_town_lord, "trp_player"), ## Not a player owned center
(spawn_around_party, ":village_reinforcements", ":party_template"),
(assign, ":result", reg0),
(store_random_in_range, ":rand", 0, 100),
(try_begin),
(is_between, ":rand", 0, 45), ## Get weakest template
(party_add_template, ":result", ":party_template_a"),
(else_try),
(is_between, ":rand", 40, 85), ## Get stronger template
(party_add_template, ":result", ":party_template_b"),
(else_try),
(ge, ":rand", 85), ## Get strongest template
(party_add_template, ":result", ":party_template_c"),
(try_end),
(party_set_faction, ":result", ":faction"),
(party_set_slot, ":result", slot_party_type, spt_reinforcement_party),
(party_set_slot, ":result", slot_party_ai_object, ":center"),
(str_store_party_name, s14, ":village_reinforcements"),
(party_set_name, ":result", "@Reinforcements from {s14}"),
(party_set_ai_behavior,":result",ai_bhvr_travel_to_party),
(party_set_ai_object,":result", ":center"),
(party_set_flags, ":result", pf_default_behavior, 1),
(try_end),
(try_end),
(try_end),
(try_end)]),
#mark edits end garrison reinforcements
#NPC system changes end
# Lady of the lake achievement
(1, 0, 0,
[
(party_set_slot, ":party_no", slot_party_ai_object, ":target_center"),
(try_end),
(try_end),
]),
#mark edits start reinforce garrison
(0.2, #Every 0.2 game hours will the game check if there are any reinforcements in the centers.
[
(try_for_parties, ":party_no"),
(party_slot_eq, ":party_no", slot_party_type, spt_reinforcement_party), #Find parties of the type spt_reinforcement_party
(party_is_in_any_town, ":party_no"), # Is the party in any town?
(party_get_cur_town, ":cur_center", ":party_no"), #What town are they in?
(call_script, "script_party_add_party_companions", ":cur_center", ":party_no"), #Add the party to the center, which is infact a party
(party_clear, ":party_no"), #Not sure if this cleaning up is necessary, but it's a precaution so we don't have a bundle of templates lying around.
(try_end),
]),
#mark edits end reinforce garrison
#Troop AI: Village farmers thinking
(8,
[
(try_for_parties, ":party_no"),
Again as always any help would be great.
Edit: I wonder if it has something to do with the constants
#slot_party_type values
##spt_caravan = 1
spt_castle = 2
spt_town = 3
spt_village = 4
##spt_forager = 5
##spt_war_party = 6
##spt_patrol = 7
##spt_messenger = 8
##spt_raider = 9
##spt_scout = 10
spt_kingdom_caravan = 11
##spt_prisoner_train = 12
spt_kingdom_hero_party = 13
##spt_merchant_caravan = 14
spt_reinforcement_party = 14 #edits start and end
spt_village_farmer = 15
spt_ship = 16
spt_cattle_herd = 17
spt_bandit_lair = 18
#spt_deserter = 20
kingdom_party_types_begin = spt_kingdom_caravan
kingdom_party_types_end = spt_kingdom_hero_party + 1
##spt_caravan = 1
spt_castle = 2
spt_town = 3
spt_village = 4
##spt_forager = 5
##spt_war_party = 6
##spt_patrol = 7
##spt_messenger = 8
##spt_raider = 9
##spt_scout = 10
spt_kingdom_caravan = 11
##spt_prisoner_train = 12
spt_kingdom_hero_party = 13
##spt_merchant_caravan = 14
spt_reinforcement_party = 14 #edits start and end
spt_village_farmer = 15
spt_ship = 16
spt_cattle_herd = 17
spt_bandit_lair = 18
#spt_deserter = 20
kingdom_party_types_begin = spt_kingdom_caravan
kingdom_party_types_end = spt_kingdom_hero_party + 1
("reinforcements","Reinforcements",icon_axeman|pf_show_faction,0,fac_commoners,soldier_personality,[]),