Invalid Item Kind ID: -1; LINE NO: 41:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 43:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 40:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 41:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. vdt_regular discard_buffer()
SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 41:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 43:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 40:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 41:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 41:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. SCRIPT ERROR ON OPCODE 527: Invalid Item Kind ID: -1; LINE NO: 43:
At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences. At Mission Template mst_lead_charge trigger no: 2 consequences.
(
"lead_charge",mtf_battle_mode|mtf_synch_inventory,charge,
"You lead your men to battle.",
[
(1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
(0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
(4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
],
[
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(call_script, "script_agent_reassign_team", ":agent_no"),
(assign, ":initial_courage_score", 5000),
(agent_get_troop_id, ":troop_id", ":agent_no"),
(store_character_level, ":troop_level", ":troop_id"),
(val_mul, ":troop_level", 100), #was 35
(val_add, ":initial_courage_score", ":troop_level"), #average : 20 * 35 = 700
(store_random_in_range, ":randomized_addition_courage", 0, 3000), #average : 1500
(val_add, ":initial_courage_score", ":randomized_addition_courage"),
(agent_get_party_id, ":agent_party", ":agent_no"),
(party_get_morale, ":cur_morale", ":agent_party"),
(store_sub, ":morale_effect_on_courage", ":cur_morale", 70),
(val_mul, ":morale_effect_on_courage", 30), #this can effect morale with -2100..900
(val_add, ":initial_courage_score", ":morale_effect_on_courage"),
#average = 5000 + 700 + 1500 = 7200; min : 5700, max : 8700
#morale effect = min : -2100(party morale is 0), average : 0(party morale is 70), max : 900(party morale is 100)
#min starting : 3600, max starting : 9600, average starting : 7200
(agent_set_slot, ":agent_no", slot_agent_courage_score, ":initial_courage_score"),
]),
#Breakable Item Begin+
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent"),
(try_for_range, ":equipment_slot", 4, 8),
(agent_get_item_slot, ":equipment", ":agent", ":equipment_slot"),
(gt, ":equipment", 0), # Agent does have an armor equipped here
#(item_get_hit_points, ":hp", ":equipment"),
(assign, ":hp", 1), #Flat Hitpoints
(try_begin),
(eq, ":equipment_slot", 4), # Head
(agent_set_slot, ":agent", agent_armor_dur_head, ":hp"),
(else_try),
(eq, ":equipment_slot", 5), # Body
(agent_set_slot, ":agent", agent_armor_dur_main, ":hp"),
(else_try),
(eq, ":equipment_slot", 6), # Leg
(agent_set_slot, ":agent", agent_armor_dur_feet, ":hp"),
(else_try),
# Would be 7, Hand
(agent_set_slot, ":agent", agent_armor_dur_hand, ":hp"),
(try_end),
(try_end),
]),
(ti_on_agent_hit, 0, 0, [],
[
(set_fixed_point_multiplier, 100),
(store_trigger_param, ":agent", 1),
(store_trigger_param, ":attacker", 2),
(store_trigger_param, ":damage", 3),
(store_trigger_param, ":bodypart", 4),
# (store_trigger_param, ":missile", 5),
(agent_get_troop_id, ":troop", ":agent"),
(agent_get_troop_id, ":attacker_troop", ":attacker"),
(assign, ":attacker_weapon", reg0),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),
(store_agent_hit_points, ":health_remaining_actual", ":agent", 1),
(store_troop_health, ":current_health", ":troop"),
(troop_set_health, ":troop", 100),
(store_troop_health, ":max_health_actual", ":troop", 1),
(troop_set_health, ":troop", ":current_health"),
# This is a listing of bones for usage in locational damage tracking
# hb_abdomen = 0
# hb_thigh_l = 1
# hb_calf_l = 2
# hb_foot_l = 3
# hb_thigh_r = 4
# hb_calf_r = 5
# hb_foot_r = 6
# hb_spine = 7
# hb_thorax = 8
# hb_head = 9
# hb_shoulder_l = 10
# hb_upperarm_l = 11
# hb_forearm_l = 12
# hb_hand_l = 13
# hb_item_l = 14
# hb_shoulder_r = 15
# hb_upperarm_r = 16
# hb_forearm_r = 17
# hb_hand_r = 18
(try_begin),
(gt, ":attacker_weapon", 0),
(item_get_swing_damage_type, ":damage_type", ":attacker_weapon"),
# I dunno how to determine which attack was unleashed, but this will work
# We can use this to make certain damage types, such as blunt, do more damage
# to armor durability vs things like pierce which should nearly pass through
(else_try),
(assign, ":damage_type", 2),
(try_end),
(try_begin),
(eq, ":damage_type", 0), # Cut
(assign, ":dampen", 3),
(else_try),
(eq, ":damage_type", 1), # Pierce
(assign, ":dampen", 5),
(else_try),
(eq, ":damage_type", 2), # Blunt
(assign, ":dampen", 2),
(try_end),
(store_div, ":durability_hit", ":damage", ":dampen"),
(agent_get_slot, ":head_durability", ":agent", agent_armor_dur_head),
(agent_get_slot, ":hand_durability", ":agent", agent_armor_dur_hand),
(agent_get_slot, ":feet_durability", ":agent", agent_armor_dur_feet),
(agent_get_slot, ":main_durability", ":agent", agent_armor_dur_main),
(agent_get_item_slot, ":head_armor", ":agent", 4),
(agent_get_item_slot, ":hand_armor", ":agent", 7),
(agent_get_item_slot, ":feet_armor", ":agent", 6),
(agent_get_item_slot, ":main_armor", ":agent", 5),
(item_get_slot, ":head_damaged_var", ":head_armor", slot_damaged_variant),
(item_get_slot, ":hand_damaged_var", ":hand_armor", slot_damaged_variant),
(item_get_slot, ":feet_damaged_var", ":feet_armor", slot_damaged_variant),
(item_get_slot, ":main_damaged_var", ":main_armor", slot_damaged_variant),
(try_begin),
(this_or_next|eq, ":bodypart", 0), # Guts
(is_between, ":bodypart", 7, 9), # Spine and Thorax
(gt, ":main_armor", 0), # Has Armor
(val_sub, ":main_durability", ":durability_hit"),
(val_max, ":main_durability", 0), # Durability cannot be negative
(agent_set_slot, ":agent", agent_armor_dur_main, ":main_durability"),
(eq, ":main_durability", 0),
(agent_unequip_item, ":agent", ":main_armor", 5),
(neq, ":main_damaged_var", 0),
(item_get_hit_points, ":hp", ":main_damaged_var"),
(agent_set_slot, ":agent", agent_armor_dur_main, ":hp"),
(agent_equip_item, ":agent", ":main_damaged_var", 5),
(else_try),
(is_between, ":bodypart", 1, 7), # Legs
(gt, ":feet_armor", 0), # Has Armor
(val_sub, ":feet_durability", ":durability_hit"),
(val_max, ":feet_durability", 0), # Durability cannot be negative
(agent_set_slot, ":agent", agent_armor_dur_feet, ":feet_durability"),
(eq, ":feet_durability", 0),
(agent_unequip_item, ":agent", ":feet_armor", 4),
(neq, ":feet_damaged_var", 0),
(item_get_hit_points, ":hp", ":feet_damaged_var"),
(agent_set_slot, ":agent", agent_armor_dur_feet, ":hp"),
(agent_equip_item, ":agent", ":feet_damaged_var", 4),
(else_try),
(eq, ":bodypart", 9), # head
(gt, ":head_armor", 0), # Has Armor
(val_sub, ":head_durability", ":durability_hit"),
(val_max, ":head_durability", 0), # Durability cannot be negative
(agent_set_slot, ":agent", agent_armor_dur_head, ":head_durability"),
(eq, ":head_durability", 0),
(agent_unequip_item, ":agent", ":head_armor", 5),
(neq, ":head_damaged_var", 0),
(item_get_hit_points, ":hp", ":head_damaged_var"),
(agent_set_slot, ":agent", agent_armor_dur_head, ":hp"),
(agent_equip_item, ":agent", ":head_damaged_var", 5),
(else_try),
(this_or_next|is_between, ":bodypart", 12, 14), # Left Forearms and Hand
(gt, ":bodypart", 17), # Right Forearms and Hand
(gt, ":hand_armor", 0), # Has Armor
(val_sub, ":hand_durability", ":durability_hit"),
(val_max, ":hand_durability", 0), # Durability cannot be negative
(agent_set_slot, ":agent", agent_armor_dur_hand, ":hand_durability"),
(eq, ":hand_durability", 0),
(agent_unequip_item, ":agent", ":hand_armor", 5),
(neq, ":hand_damaged_var", 0),
(item_get_hit_points, ":hp", ":hand_damaged_var"),
(agent_set_slot, ":agent", agent_armor_dur_hand, ":hp"),
(agent_equip_item, ":agent", ":hand_damaged_var", 5),
(try_end),
(set_trigger_result, ":damage"),
]),
#Breakable Item End+
common_battle_init_banner,
#more triggers...
(troop_set_slot, "trp_kingdom_1_lady_1", slot_troop_spouse, "trp_knight_1_1"),
(troop_set_slot, "trp_kingdom_1_lady_2", slot_troop_spouse, "trp_knight_1_2"),
(troop_set_slot, "trp_kingdom_1_lady_3", slot_troop_spouse, "trp_knight_1_3"),
(troop_set_slot, "trp_kingdom_1_lady_4", slot_troop_spouse, "trp_knight_1_4"),
(troop_set_slot, "trp_kingdom_1_lady_5", slot_troop_spouse, "trp_knight_1_5"),
(troop_set_slot, "trp_kingdom_1_lady_6", slot_troop_spouse, "trp_knight_1_6"),
(troop_set_slot, "trp_kingdom_1_lady_7", slot_troop_spouse, "trp_knight_1_7"),
(troop_set_slot, "trp_kingdom_1_lady_8", slot_troop_spouse, "trp_knight_1_8"),
[anyone ,"start", [(eq,"$g_talk_troop","trp_konrad"),], "Good day, {sir/madam}. Here to take a look at Balion's finest?", "mercenary_recruit",[]],
[anyone ,"start", [(eq,"$g_talk_troop","trp_sun_knightess"),], "Mind your manners within the walls and we'll have no trouble.", "close_window",[]],
[anyone|plyr,"mercenary_recruit", [], "I wish to recruit some of your men.", "mercenary_buy_troops",[]],
[anyone ,"mercenary_buy_troops",
[
(store_relation, ":keep_faction_relation", "fac_knight_order_1", "fac_player_faction"),
(ge, ":keep_faction_relation", 0),
],
"I'll gather the men available, they'll do anything you say as long as you pay them for it.", "mercenary_buy_troops_2",
[
(set_mercenary_source_party, "$g_talk_troop_party"),
(change_screen_buy_mercenaries)
]],
[anyone, "mercenary_buy_troops",
[
#(store_faction_of_party, "fac_knight_order_1", "p_merc_camp_balion"),
(store_relation, ":keep_faction_relation", "fac_knight_order_1", "fac_player_faction"),
(lt, ":keep_faction_relation", 0),
],
"Sorry, your relationship with my faction is negative.", "mercenary_buy_troops_2", []],
(store_faction_of_party, ":keep_faction", "p_merc_camp_balion")
. Do you mind elaborating how store_faction_of_party works and how could I fix it? Thanks!Okay, I think I am following what you are saying.
# Merc Camp Begin
(try_for_range, ":camp_no", mercenary_camp_begin, mercenary_camp_end),
(call_script, "script_refresh_mercenary_camp_troops",":camp_no"),
(try_end),
# Merc Camp End
# script_refresh_mercenary_camp_troops
# Input: arg1 = camp_no
# Output: none
("refresh_mercenary_camp_troops",
[
(store_script_param_1, ":camp_no"),
(assign, ":ideal_size", 50), # Past this value the troop pool of the camp will be reset
(try_begin),
(eq, ":camp_no", "p_merc_camp_balion"),
(assign, ":party_template", "pt_merc_camp_balion_troops"),
#(else_try),
#(eq, ":camp_no", "p_merc_camp_geroia"),
#(assign, ":party_template", "pt_merc_camp_geroia_troops"),
#(else_try),
#(eq, ":camp_no", "p_merc_camp_jumne"),
#(assign, ":party_template", "pt_merc_camp_jumne_troops"),
#(else_try),
#(eq, ":camp_no", "p_merc_camp_zendar"),
#(assign, ":party_template", "pt_merc_camp_zendar_troops"),
(try_end),
(party_get_num_companions, ":party_size", ":camp_no"),
(try_begin),
(gt, ":party_size", ":ideal_size"), # We're past the ideal number of troops in the camp
(party_clear,":camp_no"), # Reset the troop pool
(party_add_template, ":camp_no", ":party_template"),
(else_try),
(party_add_template, ":camp_no", ":party_template"),
(try_end),
]),
":keep_faction_relation", ":keep_faction", "fac_player_faction"
so I should be able to comment out this part (and update dialogs):
(party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 1), #SB : ge 1, not 0 (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
Yes, the dialog starts fine. One of the two options is to ask the keep master for the backstory and that one shows up fine. I'd like the second option (recruit) to show only if the player has a certain relationship level with the faction of the current settlement but so far I haven't managed to make it work