OSP Code Combat [WB][B] Alternate Weapon Modes

GunFred

Squire
Best answers
0
Thanks, the header_triggers got me past the build_module but I got one last problem. The item does not switch model/mesh ingame. But the item's icon in the right bottom does change, as does the item's stats and sound.
Got any idea what the issue could be or what part of the code that does the actual ingame model/mesh switching? I got the "next_item_as_melee" flag on the first item and I have been using "X" to switch weapon mode.
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
That is the Native behaviour of changing items - the mesh does not update. To make sure you've implemented this correctly please post your module_items entry and the associated module_script lines where you link the two through the
Code:
slot_item_alternate
slot.
 

GunFred

Squire
Best answers
0
Here they are. I have only tested it past the building on WFaS but I have not seen a difference between WFaS and WB around these new codes and they both had the same errors before I got past the building.

Items:
["sef_axe_ham", "Axe", [("toporik_pure_a",0)], itp_type_one_handed_wpn|itp_merchandise|itp_wooden_parry|itp_primary|itp_secondary|itp_bonus_against_shield|itp_next_item_as_melee|itp_unbalanced, itc_scimitar|itcf_carry_axe_left_hip, 300, weight(1.4)|difficulty(0)|spd_rtng(95)|weapon_length(50)|swing_damage(33,cut)|thrust_damage(0,pierce), imodbits_axe ],
["sef_axe_ham_alt", "Axe (Hammer)", [("axehammer_bad_alt",0)], itp_type_one_handed_wpn|itp_merchandise|itp_wooden_parry|itp_primary|itp_secondary|itp_unbalanced|itp_can_knock_down|itp_extra_penetration, itc_scimitar|itcf_carry_axe_left_hip, 300, weight(1.4)|difficulty(:cool:|spd_rtng(95)|weapon_length(50)|swing_damage(30,blunt)|thrust_damage(0,pierce), imodbits_axe ],
["sef_axe_ham_good", "Good Axe", [("toporik_rich_a",0)], itp_type_one_handed_wpn|itp_merchandise|itp_wooden_parry|itp_primary|itp_secondary|itp_bonus_against_shield|itp_next_item_as_melee|itp_unbalanced, itc_scimitar|itcf_carry_axe_left_hip, 900, weight(1.4)|difficulty(0)|spd_rtng(95)|weapon_length(50)|swing_damage(38,cut)|thrust_damage(0,pierce), imodbits_axe ],
["sef_axe_ham_good_alt", "Good Axe (Hammer)", [("axehammer_good_alt",0)], itp_type_one_handed_wpn|itp_merchandise|itp_wooden_parry|itp_primary|itp_secondary|itp_unbalanced|itp_can_knock_down|itp_extra_penetration, itc_scimitar|itcf_carry_axe_left_hip, 900, weight(1.4)|difficulty(0)|spd_rtng(95)|weapon_length(50)|swing_damage(35,blunt)|thrust_damage(0,pierce), imodbits_axe ],
....
["sef_alebarda", "Halberd", [("halberd",0)], itp_type_polearm|itp_merchandise|itp_wooden_parry|itp_two_handed|itp_primary|itp_cant_use_on_horseback, itc_staff|itcf_carry_spear, 1500, weight(3)|difficulty(12)|spd_rtng(77)|weapon_length(170)|swing_damage(30,cut)|thrust_damage(26,pierce), imodbits_axe ],
["sef_alebarda_alt", "Halberd (Spike)", [("halberd_alt",0)], itp_type_polearm|itp_merchandise|itp_wooden_parry|itp_two_handed|itp_primary|itp_cant_use_on_horseback|itp_extra_penetration, itc_staff|itcf_carry_spear, 1500, weight(3)|difficulty(12)|spd_rtng(77)|weapon_length(170)|swing_damage(28,pierce)|thrust_damage(26,pierce), imodbits_axe ],

Scripts: Surrounding codes are green, relevant one red...
  #script_multiplayer_send_item_selections
  # Input: none
  # Output: none
  ("multiplayer_send_item_selections",
  [
    (multiplayer_get_my_player, ":my_player_no"),
    (try_for_range, ":i_item", slot_player_selected_item_indices_begin, slot_player_selected_item_indices_end),
      (player_get_slot, ":item_id", ":my_player_no", ":i_item"),
      (multiplayer_send_2_int_to_server, multiplayer_event_set_item_selection, ":i_item", ":item_id"),
    (try_end),


(try_begin),
  (call_script, "script_cf_multiplayer_can_buy_squad"),
  (try_for_range, ":bot_slot", slot_player_captain_bot_data_begin, slot_player_captain_bot_data_end),
        (player_get_slot, ":bot_amount", ":my_player_no", ":bot_slot"),
        (multiplayer_send_3_int_to_server, multiplayer_event_other_events, multiplayer_event_other_event_set_bot_purchase, ":bot_slot", ":bot_amount"),
      (try_end),
(try_end),
    ]),









# Somebody's Alternate Weapon Modes
    ("alternate_weapon_modes",
    [
(item_set_slot, "itm_sef_axe_ham", slot_item_alternate, "itm_sef_axe_ham_alt"),
(item_set_slot, "itm_sef_axe_ham_alt", slot_item_alternate, "itm_sef_axe_ham"),
(item_set_slot, "itm_sef_axe_ham_good", slot_item_alternate, "itm_sef_axe_ham_good_alt"),
(item_set_slot, "itm_sef_axe_ham_good_alt", slot_item_alternate, "itm_sef_axe_ham_good"),
(item_set_slot, "itm_sef_alebarda", slot_item_alternate, "itm_sef_alebarda_alt"),
(item_set_slot, "itm_sef_alebarda_alt", slot_item_alternate, "itm_sef_alebarda"),


    ]),



  #script_multiplayer_set_default_item_selections_for_troop
  # Input: arg1 = player_no, arg2 = troop_no
  # Output: none
  ("multiplayer_set_default_item_selections_for_troop",
  [
    (store_script_param, ":player_no", 1),
(store_script_param, ":troop_no", 2),
    (call_script, "script_multiplayer_clear_player_selected_items", ":player_no"),
    (assign, ":cur_weapon_slot", 0),
    (troop_get_inventory_capacity, ":inv_cap", ":troop_no"),
    (try_for_range, ":i_slot", 0, ":inv_cap"),
      (troop_get_inventory_slot, ":item_id", ":troop_no", ":i_slot"),
      (ge, ":item_id", 0),
      (item_get_slot, ":item_class", ":item_id", slot_item_multiplayer_item_class),
      (try_begin),
        (is_between, ":item_class", multi_item_class_type_weapons_begin, multi_item_class_type_weapons_end),
        (this_or_next|eq, "$g_multiplayer_disallow_ranged_weapons", 0),
        (neg|is_between, ":item_class", multi_item_class_type_ranged_weapons_begin, multi_item_class_type_ranged_weapons_end),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, ":cur_weapon_slot"),
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
        (val_add, ":cur_weapon_slot", 1),
      (else_try),
        (is_between, ":item_class", multi_item_class_type_heads_begin, multi_item_class_type_heads_end),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, 4),
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
      (else_try),
        (is_between, ":item_class", multi_item_class_type_bodies_begin, multi_item_class_type_bodies_end),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, 5),
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
      (else_try),
        (is_between, ":item_class", multi_item_class_type_feet_begin, multi_item_class_type_feet_end),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, 6),
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
      (else_try),
        (is_between, ":item_class", multi_item_class_type_gloves_begin, multi_item_class_type_gloves_end),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, 7),
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
      (else_try),
        (is_between, ":item_class", multi_item_class_type_horses_begin, multi_item_class_type_horses_end),
        (eq, "$g_horses_are_avaliable", 1),
        (store_add, ":selected_item_slot", slot_player_selected_item_indices_begin, :cool:,
        (player_set_slot, ":player_no", ":selected_item_slot", ":item_id"),
      (try_end),
    (try_end),
    ]),
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
You probably need to call script_alternate_weapon_modes from game_quick_start or game_start, sounds like the slots aren't being set.
 

GunFred

Squire
Best answers
0
I did the following but unfortunatly it did not help...
  ("game_start",
  [

      # Somebody's Alternate Weapon Modes 
      (call_script, "script_alternate_weapon_modes"),


...............................................

  ("game_quick_start",
    [

      # Somebody's Alternate Weapon Modes 
      (call_script, "script_alternate_weapon_modes"),

I also noticed this...
      (try_begin),
       
        (try_for_range, ":item_slot", ek_item_0, ":end"),
          (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
          (this_or_next|eq, ":item_id", "itm_h_alt"),
          (this_or_next|eq, ":item_id", "itm_ih_alt"),
          (this_or_next|eq, ":item_id", "itm_bec_de_corbin_a"),
          (this_or_next|eq, ":item_id", "itm_pickaxe"),
          (is_between, ":item_id", "itm_fighting_pick", "itm_morningstar"),
          (assign, ":item_no", ":item_id"),
          (assign, ":end", ek_item_0),
          (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
         
        (try_end),
      (try_end),
      #these are piercing weapons
      (this_or_next|eq, ":item_no", "itm_h_alt"),
      (this_or_next|eq, ":item_no", "itm_ih_alt"),
      (this_or_next|eq, ":item_no", "itm_bec_de_corbin_a"),
      (this_or_next|eq, ":item_no", "itm_pickaxe"),
      (is_between, ":item_no", "itm_fighting_pick", "itm_morningstar"),
    (else_try), #exclude them
      (assign, ":swap_no", 0),
    (try_end),
Do the items there matter for the player or is it only relevant to get the troops to properly switch mode on command? And the blue part should be "try_begin" right?
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
That particular block of code concerns the AI weapon switching behaviour when ordered to use blunt weapons, so those items are the pierce/cut versions of whatever blunt weapons they should be picking. That particular code block looks through the unequipped items in the agent's inventory, leave the try_end as-is.
 

GunFred

Squire
Best answers
0
Hey Somebody, I tried to follow the main post and the new things you told me about in your later posts but with Warband, using native items to make sure that there was no WFaS or new item related error. But in the end it still did not work and not even the icons switched without next_item_melee. So could I ask you to post all your own working codes(especially your Scripts) along with a row or two of the above codes for the sake of placing the codes correctly? And to be sure, "X" is the button used for switching right?
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Code:
def set_item_score():
  item_score = []
  for i_item in xrange(len(items)):    
    type = items[i_item][3] & 0x000000ff
    name = items[i_item][0]
    if (type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield) or (type >= itp_type_pistol and type <= itp_type_bullets):
      item_score.append((item_set_slot, i_item, slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      item_score.append((item_set_slot, i_item, slot_item_swing_damage, get_swing_damage(items[i_item][6])))
      if (items[i_item][3] & itp_next_item_as_melee == itp_next_item_as_melee) and type != itp_type_thrown: #toggleable weapons
        item_score.append((item_set_slot, i_item, slot_item_alternate, i_item + 1))
        item_score.append((item_set_slot, i_item + 1, slot_item_alternate, i_item))
        #print items[i_item][0] + str(i_item) + " has alternate " + str(i_item+1)
      elif name.endswith("_alt"):
        name = name.rstrip('_alt')
        #print "checking for " + name
        for x_item in xrange(i_item-1,0,-1):
          if items[x_item][0] == name:
            item_score.append((item_set_slot, i_item, slot_item_alternate, x_item))
            item_score.append((item_set_slot, x_item, slot_item_alternate, i_item))
            print items[i_item][1] + " has been paired with " + items[x_item][1]
            break

  return item_score[:]
...
("init_item_slots", set_item_score()),
Uncomment the printouts if you want to check if your item associations are working.
Code:
common_ai_order_toggle = (ti_on_order_issued, 0, 0, [
  (store_trigger_param_1, ":order_no"),
  (this_or_next|eq, ":order_no", mordr_use_any_weapon),
  (eq, ":order_no", mordr_use_blunt_weapons),
  ],
  [
  (store_trigger_param_1, ":order_no"),
  (store_trigger_param_2, ":agent_id"), #probably the player
  (agent_get_team, ":team_id", ":agent_id"),

  (try_for_agents, ":agent_no"),

    (agent_is_active, ":agent_no"),
    (agent_is_human, ":agent_no"),
    (agent_is_non_player, ":agent_no"),
    (agent_is_alive, ":agent_no"),
    (agent_get_team, ":team_no", ":agent_no"),
    (eq, ":team_no", ":team_id"),
    (agent_get_class, ":class_no", ":agent_no"),
    (class_is_listening_order, ":team_no", ":class_no"),
    (agent_get_wielded_item, ":item_no", ":agent_no", 0),
    # (assign, reg10, ":agent_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (try_begin),
      # (le, ":item_no", 0),
      # (str_store_string, s2, "@nothing"),
    # (else_try),
      # (str_store_item_name, s2, ":item_no"),
    # (try_end),
    # (str_store_string, s1, "@{reg10}:{s1} holding {s2}:"),
    # (try_for_range, ":item_slot", ek_item_0, ek_head),
      # (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
      # (gt, ":item_id", 0),
      # (neq, ":item_id", ":item_no"),
      # (str_store_item_name, s0, ":item_id"),
      # (str_store_string, s1, "@{s1}, {s0}"),
    # (try_end),
    # (display_message, s1),


    (gt, ":item_no", 0),
    (assign, ":swap_no", 0),

    #here we assume a weapon with alternate mode has been found already - it is rare that two item types will be equipped that can be swapped with different damage modes
    (try_begin), #make use of the other item slots
      (eq, ":order_no", mordr_use_any_weapon), #just plain swapping
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
      (gt, ":swap_no", 1),
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no", 0),
      # (store_mission_timer_a, ":timer_a"),
      # (val_add, ":timer_a", 1000),
      # (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":timer_a"),
    (else_try),
      (eq, ":order_no", mordr_use_blunt_weapons), #switching to blunt modes only
      (neg|item_slot_ge, ":item_no", slot_item_swing_damage, 513), #not already holding blunt
      #check inventory to see if weapon can be toggled
      (assign, ":end", ek_head),
      # (str_store_agent_name, s10, ":agent_no"),
      # (assign, reg10, ":agent_no"),
      # (str_store_string, s10, "@{reg10}={s10}:blunt"),
      (try_for_range, ":item_slot", ek_item_0, ":end"),
        (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
        (gt, ":item_id", 0),

        (item_get_type, ":item_itp", ":item_id"),
        (is_between, ":item_itp", itp_type_one_handed_wpn, itp_type_arrows),
        (neg|item_slot_ge, ":item_id", slot_item_swing_damage, 513), #let engine set wielded
        # (str_store_item_name, s1, ":item_id"),
        # (item_get_slot, reg9, ":item_id", slot_item_swing_damage),
        # (str_store_string, s10, "@{s10},checking {s1} with {reg9} dmg"),
        (item_get_slot, ":swap_id", ":item_id", slot_item_alternate),
        (gt, ":swap_id", 1),
        # (str_store_string, s10, "@{s10} and alt"),

        (try_begin),
          # (item_get_slot, ":damage", ":swap_id", slot_item_swing_damage),
          # (gt, ":damage", 512),
          (item_slot_ge, ":swap_id", slot_item_swing_damage, 513),
          (item_get_slot, ":damage", ":item_id", slot_item_thrust_damage),
          (this_or_next|eq, ":damage", 0), #no thrust capability
          (this_or_next|eq, ":damage", 256), #defined as (0, flag)
          (gt, ":damage", 512),

          # (assign, ":item_no", ":item_id"),
          (assign, ":end", -1),
          (agent_unequip_item, ":agent_no", ":item_id"),
          (agent_equip_item, ":agent_no", ":swap_id"),
          (agent_force_rethink, ":agent_no"),
        (try_end),
      (try_end),
      # (try_begin),
        # (eq, ":end", ek_head),
        # (assign, ":swap_no", -1),
        # (assign, ":item_no", -1),
        # (assign, ":color", 0xFF0000),
        # (display_message, "@{reg10}: switch to nothing", ":color"),
      # (else_try),
        # (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
        # (assign, ":color", 0x00FF00),
        # (str_store_item_name, s2, ":swap_no"),
        # (display_message, "@{reg10}: switch to {s2}", ":color"),
      # (try_end),
    # (else_try), #exclude them
      # (assign, ":swap_no", 0),
    (try_end),
    # (gt, ":item_no", 0),
    # (gt, ":swap_no", 0),
    # (agent_unequip_item, ":agent_no", ":item_no"),
    # (agent_unequip_item, ":agent_no", ":swap_no"),
    # (agent_equip_item, ":agent_no", ":swap_no"),
    # #(agent_set_wielded_item, ":agent_no", ":swap_no"),
    # (str_store_item_name, s3, ":item_no"),
    # (str_store_item_name, s2, ":swap_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (display_message, "@{reg10}:{s1} switching to {s2} from {s3}", ":color"),
    # (agent_force_rethink, ":agent_no"),
  (try_end),
  ]
)
common_ai_sanity_check = (
  ti_on_item_wielded, 0, 0, [
  (store_trigger_param_2, ":item_no"),
  (eq, ":item_no", 0),
  ],
  [
  (store_trigger_param_1, ":agent_no"),
  # (str_store_agent_name, s11, ":agent_no"),
  # (assign, reg11, ":agent_no"),
  # (str_store_string, s11, "@{reg11}+{s11}"),
  # (try_for_range, ":item_slot", 0, ek_head),
    # (agent_get_item_slot, reg11, ":agent_no", ":item_slot"),
    # (str_store_string, s11, "@{s11}; {reg11}"),
  # (try_end),
  # (display_message, s11),
  (agent_unequip_item, ":agent_no", 0),
  (agent_force_rethink, ":agent_no"),

  ]
)
common_ai_random_toggle = (1, 0, 0,
  [],
  [
    (store_mission_timer_a, ":timer_a"),
    (try_for_agents, ":agent_no"),
      (assign, ":swap_no", -1),
      #check valid agent candidates
      (agent_is_active, ":agent_no"),
      (agent_is_human, ":agent_no"),
      (agent_is_non_player, ":agent_no"),
      (agent_is_alive, ":agent_no"),
      (agent_get_combat_state, ":cs", ":agent_no"),
      (this_or_next|eq, ":cs", 0), #cs_free
      (this_or_next|eq, ":cs", 7), #cs_still
      (eq, ":cs", 3), #cs_wield

      (agent_get_team, ":agent_team", ":agent_no"),
      (agent_get_class, ":agent_class", ":agent_no"),
      #should probably cache this inside team slots
      (team_get_weapon_usage_order, ":order_no", ":agent_team",  ":agent_class"),
      (neq, ":order_no", wordr_use_blunt_weapons),
      #check validity of weapon
      (agent_get_wielded_item, ":item_no", ":agent_no", 0),
      (gt, ":item_no", 1),
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),

      (gt, ":swap_no", 1),
      (item_get_type, ":itp", ":item_no"),
      (is_between, ":itp", itp_type_one_handed_wpn, itp_type_arrows),
      #weapon mastery increases chance of toggling
      (agent_get_troop_id, ":troop_no", ":agent_no"),
      (store_skill_level, ":skill", "skl_weapon_master", ":troop_no"),
      (store_random_in_range, ":random_no", 0, 100),

      #most native troops do NOT have weapon mastery - adjust as needed
      (ge, ":skill", ":random_no"),

      (store_mission_timer_a, ":timer_a"),
      #check timing
      (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggled),
      (lt, ":last_switched", ":timer_a"),

      (store_sub, ":wpt", ":itp", 2),
      (store_proficiency_level, ":prof", ":troop_no", ":wpt"),
      (assign, reg9, ":prof"),
      #proficiency decreases time between toggle
      (val_mul, ":random_no", 8), #from 0 to 160
      (val_add, ":random_no", 1600), #delay
      (store_sub, ":prof", ":random_no", ":prof"), #between 1500 to 600 usually
      (val_div, ":prof", 80), #between 12s to 7.5s

      #store timing
      (store_add, ":last_switched", ":timer_a", ":prof"),
      (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":last_switched"),

      #actual switching
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no"),

      # (assign, reg10, ":last_switched"),
      # (str_store_item_name, s3, ":item_no"),
      # (str_store_item_name, s2, ":swap_no"),
      # (str_store_agent_name, s1, ":agent_no"),
      # (display_message, "@{reg10}:{s1} with {reg9} wpx switching to {s2} from {s3}"),
    (try_end),
  ]
)
common_player_toggle = (0,0,1, [
        (neg|main_hero_fallen),
        (game_key_clicked, gk_toggle_weapon_mode),
        (get_player_agent_no, "$g_player_agent"),
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (gt, ":item", 0),
        (item_slot_ge, ":item", slot_item_alternate, 1),
      ],
      #side effects may include cleaning the weapon automatically, improper carry positions, and items not corresponding to stats when switched between trigger checks using native behaviour
      [
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (item_get_slot, ":alternate", ":item", slot_item_alternate),
        (gt, ":alternate", 1),
        (agent_unequip_item, "$g_player_agent", ":alternate"),
        (agent_unequip_item, "$g_player_agent", ":item"),
        (agent_equip_item, "$g_player_agent", ":alternate"),
        (agent_set_wielded_item, "$g_player_agent", ":alternate"),
      ],
    )
common_wpn_swapping = [common_ai_order_toggle,common_ai_sanity_check,common_ai_random_toggle,common_player_toggle]
 

GunFred

Squire
Best answers
0
I replaced the mission_template and added the new script like this...
The "def set_item_score" does not get past the building and I assume that it is not MS code. I understood from your post that it is supposed to be able to tell if an item and its alternate are connected properly but how do I use it?
(item_set_slot, itp_type_book, dplmc_slot_item_type_not_for_sell, 1),
(item_set_slot, itp_type_goods, dplmc_slot_item_type_not_for_sell, 1),
(item_set_slot, itp_type_animal, dplmc_slot_item_type_not_for_sell, 1),

(assign, "$g_autoloot", 2),
(try_end),
  ]),

 
# Somebody's Alternate
    # ("alternate_weapon_modes",
    # [


(call_script, "script_init_item_score"),

    (item_set_slot, "itm_sarranid_two_handed_pick_b", slot_item_alternate, "itm_sarranid_two_handed_axe_b"),
    (item_set_slot, "itm_sarranid_two_handed_axe_b", slot_item_alternate, "itm_sarranid_two_handed_pick_b"),
    (item_set_slot, "itm_bec_de_corbin_alt", slot_item_alternate, "itm_bec_de_corbin_a"),
    (item_set_slot, "itm_bec_de_corbin_a", slot_item_alternate, "itm_bec_de_corbin_alt"),
   
    (item_set_slot, "itm_pick_alt", slot_item_alternate, "itm_pickaxe"),
    (item_set_slot, "itm_pickaxe", slot_item_alternate, "itm_pick_alt"),
    (item_set_slot, "itm_fp_alt", slot_item_alternate, "itm_fighting_pick"),
    (item_set_slot, "itm_fighting_pick", slot_item_alternate, "itm_fp_alt"),
    (item_set_slot, "itm_mp_alt", slot_item_alternate, "itm_military_pick"),   
    (item_set_slot, "itm_military_pick", slot_item_alternate, "itm_mp_alt"),
   
    (item_set_slot, "itm_hammer", slot_item_alternate, "itm_h_alt"),
    (item_set_slot, "itm_h_alt", slot_item_alternate, "itm_hammer"),
    (item_set_slot, "itm_military_hammer", slot_item_alternate, "itm_ih_alt"),
    (item_set_slot, "itm_ih_alt", slot_item_alternate, "itm_military_hammer"),

    # ]),



def set_item_score():
  item_score = []
  for i_item in xrange(len(items)):   
    type = items[i_item][3] & 0x000000ff
    name = items[i_item][0]
    if (type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield) or (type >= itp_type_pistol and type <= itp_type_bullets):
      item_score.append((item_set_slot, i_item, slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      item_score.append((item_set_slot, i_item, slot_item_swing_damage, get_swing_damage(items[i_item][6])))
      if (items[i_item][3] & itp_next_item_as_melee == itp_next_item_as_melee) and type != itp_type_thrown: #toggleable weapons
        item_score.append((item_set_slot, i_item, slot_item_alternate, i_item + 1))
        item_score.append((item_set_slot, i_item + 1, slot_item_alternate, i_item))
        print items[i_item][0] + str(i_item) + " has alternate " + str(i_item+1)
      elif name.endswith("_alt"):
        name = name.rstrip('_alt')
        print "checking for " + name
        for x_item in xrange(i_item-1,0,-1):
          if items[x_item][0] == name:
            item_score.append((item_set_slot, i_item, slot_item_alternate, x_item))
            item_score.append((item_set_slot, x_item, slot_item_alternate, i_item))
            print items[i_item][1] + " has been paired with " + items[x_item][1]
            break

  return item_score[:]
...
("init_item_slots", set_item_score()),
# Somebody's Alternate END
 
 

##"script_dplmc_get_troop_standing_in_faction"
#
#INPUT: arg1  :troop_no
#      arg2  :faction_no

Do I really need the red parts? In your initial posts, you did not include them.
# Somebody's Alternate Weapon Modes
  ("alternate_weapon_modes",
    [

    (item_set_slot, "itm_sarranid_two_handed_pick_b", slot_item_alternate, "itm_sarranid_two_handed_axe_b"),
    (item_set_slot, "itm_sarranid_two_handed_axe_b", slot_item_alternate, "itm_sarranid_two_handed_pick_b"),
    (item_set_slot, "itm_bec_de_corbin_alt", slot_item_alternate, "itm_bec_de_corbin_a"),
    (item_set_slot, "itm_bec_de_corbin_a", slot_item_alternate, "itm_bec_de_corbin_alt"),
   
    (item_set_slot, "itm_pick_alt", slot_item_alternate, "itm_pickaxe"),
    (item_set_slot, "itm_pickaxe", slot_item_alternate, "itm_pick_alt"),
    (item_set_slot, "itm_fp_alt", slot_item_alternate, "itm_fighting_pick"),
    (item_set_slot, "itm_fighting_pick", slot_item_alternate, "itm_fp_alt"),
    (item_set_slot, "itm_mp_alt", slot_item_alternate, "itm_military_pick"),   
    (item_set_slot, "itm_military_pick", slot_item_alternate, "itm_mp_alt"),
   
    (item_set_slot, "itm_hammer", slot_item_alternate, "itm_h_alt"),
    (item_set_slot, "itm_h_alt", slot_item_alternate, "itm_hammer"),
    (item_set_slot, "itm_military_hammer", slot_item_alternate, "itm_ih_alt"),
    (item_set_slot, "itm_ih_alt", slot_item_alternate, "itm_military_hammer"),    ]),
...............................................

  ("game_start",
  [

      # Somebody's Alternate Weapon Modes 
      (call_script, "script_alternate_weapon_modes"),


...............................................

  ("game_quick_start",
    [
 
      # Somebody's Alternate Weapon Modes 
      (call_script, "script_alternate_weapon_modes"),
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
("init_item_slots", set_item_score()), goes in the bottom, you call it (or rename it alternate_weapon_modes) from whatever game mode you want this to be usable in.
def set_item_score(): goes at the top, like so
Code:
####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
def set_item_score():
  item_score = []
  for i_item in xrange(len(items)):    
    type = items[i_item][3] & 0x000000ff
    name = items[i_item][0]
    if (type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield) or (type >= itp_type_pistol and type <= itp_type_bullets):
      item_score.append((item_set_slot, i_item, slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      item_score.append((item_set_slot, i_item, slot_item_swing_damage, get_swing_damage(items[i_item][6])))
      if (items[i_item][3] & itp_next_item_as_melee == itp_next_item_as_melee) and type != itp_type_thrown: #toggleable weapons
        item_score.append((item_set_slot, i_item, slot_item_alternate, i_item + 1))
        item_score.append((item_set_slot, i_item + 1, slot_item_alternate, i_item))
        print items[i_item][0] + str(i_item) + " has alternate " + str(i_item+1)
      elif name.endswith("_alt"):
        name = name.rstrip('_alt')
        print "checking for " + name
        for x_item in xrange(i_item-1,0,-1):
          if items[x_item][0] == name:
            item_score.append((item_set_slot, i_item, slot_item_alternate, x_item))
            item_score.append((item_set_slot, x_item, slot_item_alternate, i_item))
            print items[i_item][1] + " has been paired with " + items[x_item][1]
            break

  return item_score[:]
  
scripts = [


  #script_game_start:
  # This script is called when a new game is started
  # INPUT: none
  ("game_start",
 

GunFred

Squire
Best answers
0
The def code seems to be working now but I still got some problems...
####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
def set_item_score():
  item_score = []
  for i_item in xrange(len(items)):   
    type = items[i_item][3] & 0x000000ff
    name = items[i_item][0]
    if (type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield) or (type >= itp_type_pistol and type <= itp_type_bullets):
      item_score.append((item_set_slot, i_item, slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      item_score.append((item_set_slot, i_item, slot_item_swing_damage, get_swing_damage(items[i_item][6])))
      if (items[i_item][3] & itp_next_item_as_melee == itp_next_item_as_melee) and type != itp_type_thrown: #toggleable weapons
        item_score.append((item_set_slot, i_item, slot_item_alternate, i_item + 1))
        item_score.append((item_set_slot, i_item + 1, slot_item_alternate, i_item))
        print items[i_item][0] + str(i_item) + " has alternate " + str(i_item+1)
      elif name.endswith("_alt"):
        name = name.rstrip('_alt')
        print "checking for " + name
        for x_item in xrange(i_item-1,0,-1):
          if items[x_item][0] == name:
            item_score.append((item_set_slot, i_item, slot_item_alternate, x_item))
            item_score.append((item_set_slot, x_item, slot_item_alternate, i_item))
            print items[i_item][1] + " has been paired with " + items[x_item][1]
            break

  return item_score[:]
 
scripts = [


  #script_game_start:
  # This script is called when a new game is started
  # INPUT: none
  ("game_start",
  [

...............................

(call_script, "script_init_item_slots"),

    (item_set_slot, "itm_sarranid_two_handed_pick_b", slot_item_alternate, "itm_sarranid_two_handed_axe_b"),
    (item_set_slot, "itm_sarranid_two_handed_axe_b", slot_item_alternate, "itm_sarranid_two_handed_pick_b"),
    (item_set_slot, "itm_bec_de_corbin_alt", slot_item_alternate, "itm_bec_de_corbin"),
    (item_set_slot, "itm_bec_de_corbin", slot_item_alternate, "itm_bec_de_corbin_alt"),
   
    (item_set_slot, "itm_pick_alt", slot_item_alternate, "itm_pickaxe"),
    (item_set_slot, "itm_pickaxe", slot_item_alternate, "itm_pick_alt"),
    (item_set_slot, "itm_fp_alt", slot_item_alternate, "itm_fighting_pick"),
    (item_set_slot, "itm_fighting_pick", slot_item_alternate, "itm_fp_alt"),
    (item_set_slot, "itm_mp_alt", slot_item_alternate, "itm_military_pick"),   
    (item_set_slot, "itm_military_pick", slot_item_alternate, "itm_mp_alt"),
   
    (item_set_slot, "itm_h_alt", slot_item_alternate, "itm_hammer"),
    (item_set_slot, "itm_hammer", slot_item_alternate, "itm_h_alt"),
    (item_set_slot, "itm_ih_alt", slot_item_alternate, "itm_military_hammer"),
    (item_set_slot, "itm_military_hammer", slot_item_alternate, "itm_ih_alt"),
  ("game_quick_start",
    [

.........................
#Somebody's Alternate
("init_item_slots", set_item_score()),

    ]),

.........................

  ("game_start",
  [

.........................
#Somebody's Alternate
("init_item_slots", set_item_score()),

  ]),

First build error...
I had to add next_item_melee to the items or they would not get the "has alternate" after checking. For some reason it checks for "bec_de_corbin". There used to be an OSP "bec_de_corbin" but I added "_b" to the item name and it still searches for "bec_de_corbin" which I have been unable to find among any of my codes.
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
Exporting quest data...
Exporting info_page data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 5, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\GunFred\Desktop\A\process_operations.py", line 21, in <module>
    from module_mission_templates import *
  File "C:\Users\GunFred\Desktop\A\module_mission_templates.py", line 1430, in <
module>
    (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggl
ed),
NameError: name 'slot_agent_last_weapon_toggled' is not defined
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
I noted the "NameError: name 'slot_agent_last_weapon_toggled' is not defined" and added the red part but then I got another really long error build...
slot_agent_walker_occupation      = 25
slot_agent_last_weapon_toggled = 26 # Somebody's Alternate Weapon Modes

hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Initializing...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Compiling all global variables...
Error in script:
(1, 'script_init_item_slots')
Error in script:
(507, 'itm_sarranid_two_handed_pick_b', 62, 'itm_sarranid_two_handed_axe_b')
Error in script:
(507, 'itm_sarranid_two_handed_axe_b', 62, 'itm_sarranid_two_handed_pick_b')
Error in script:
(507, 'itm_bec_de_corbin_alt', 62, 'itm_bec_de_corbin_a')
Error in script:
(507, 'itm_bec_de_corbin_a', 62, 'itm_bec_de_corbin_alt')
Error in script:
(507, 'itm_pick_alt', 62, 'itm_pickaxe')
Error in script:
(507, 'itm_pickaxe', 62, 'itm_pick_alt')
Error in script:
(507, 'itm_fp_alt', 62, 'itm_fighting_pick')
Error in script:
(507, 'itm_fighting_pick', 62, 'itm_fp_alt')
Error in script:
(507, 'itm_mp_alt', 62, 'itm_military_pick')
Error in script:
(507, 'itm_military_pick', 62, 'itm_mp_alt')
Error in script:
(507, 'itm_h_alt', 62, 'itm_hammer')
Error in script:
(507, 'itm_hammer', 62, 'itm_h_alt')
Error in script:
(507, 'itm_ih_alt', 62, 'itm_military_hammer')
Error in script:
(507, 'itm_military_hammer', 62, 'itm_ih_alt')
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
as a brave {man-at-arms/warrior} and a fine leader of men, {playername}.I shall
be pleased to accept your {s0} into my service and bestow vassalage upon you,if
you are ready to swear homage to me.', 'lord_give_oath_1', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[266239, 'lord_request_mission_ask', [(31, '$players_kingdom', 0), (30, '$g_talk
_troop_faction_relation', 0), (30, '$g_talk_troop_relation', 0), (560, 'trp_play
er', 7, 30), (2147484190L, '$g_talk_troop_faction', 11, '$g_talk_troop'), (522,
':last_offer_time', '$g_talk_troop_faction', 31), (2133, ':num_enemies', 0), (6,
':faction_no', 'fac_player_supporters_faction', 'fac_kingdom_12'), (542, '$g_ta
lk_troop_faction', 21, 0), (2190, ':reln', '$g_talk_troop_faction', ':faction_no
'), (2147483678L, ':reln', 0), (2105, ':num_enemies', 1), 3, (30, ':num_enemies'
, 1), (2270, ':cur_hours'), (2120, ':week_past_last_offer_time', ':last_offer_ti
me', 16:cool:, (2105, ':last_offer_time', 24), (30, ':cur_hours', ':last_offer_time'
), (2136, ':rand', 0, 100), (3221225502L, ':rand', 20), (30, ':cur_hours', ':wee
k_past_last_offer_time'), (2133, 72057594037927936L, 0), 4, (1, 'script_cf_dplmc
_faction_has_bias_against_gender', '$g_talk_troop_faction', '$character_gender')
, (2133, 72057594037927936L, 1), 3, (1073741855, 72057594037927936L, 0), (107374
1854, '$g_disable_condescending_comments', 2), (1073742384, '$g_talk_troop', 52,
:cool:, (1073742364, '$g_talk_troop', 52, 4), (540, '$g_talk_troop', 52, 6)], '{!}W
arning: This line should never display.', 'lord_propose_mercenary', [(2270, ':cu
r_hours'), (502, '$g_talk_troop_faction', 31, ':cur_hours')]]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_propose_mercenary', [(1, 'script_party_calculate_strength', 'p_main
_party', 0), (2133, ':eek:ffer_value', 72057594037927936L), (2105, ':eek:ffer_value',
100), (1, 'script_round_value', ':eek:ffer_value'), (2133, ':eek:ffer_value', 72057594
037927936L), (2133, '$temp', ':eek:ffer_value'), (522, ':faction_leader', '$g_talk_
troop_faction', 11), (2147483679L, ':faction_leader', '$g_talk_troop'), (2335, 9
, '$g_talk_troop_faction'), (2322, 10, ':faction_leader'), 4, (2147483678L, '$g_
disable_condescending_comments', 0), (2147483679L, 72057594037928001L, '$charact
er_gender'), (1, 'script_cf_dplmc_faction_has_bias_against_gender', '$g_talk_tro
op_faction', '$character_gender'), (540, '$g_talk_troop', 52, 1), (2320, 11, 'st
r_now_some_might_say_that_women_have_no_business_leading_mercenary_companies_but
_i_suspect_that_you_would_prove_them_wrong_what_do_you_say'), 5, (2320, 11, '@Wh
at do you say to entering the service of {s9} as a mercenary captain? I have no
doubt that you would be up to the task.'), 3], 'As it happens, {playername}, I p
romised {s10} that I would hire a company of mercenaries for an upcoming campaig
n.', 'lord_mercenary_service', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_mercenary_elaborate_castle', [(2147483678L, '$g_disable_condescendi
ng_comments', 2), (542, '$g_talk_troop_faction', 11, '$g_talk_troop'), (1, 'scri
pt_cf_dplmc_faction_has_bias_against_gender', '$g_talk_troop_faction', '$charact
er_gender')], 'Only my loyal vassals can own lands and castles in my realm -- an
d all my vassals are {women/men}. I am not inclined to depart from this traditio
n without a very good reason. If you prove yourself in battle, you can swear an
oath of homage to me and become my vassal. We may then discuss how you may obtai
n a castle.', 'lord_mercenary_elaborate_1', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_mercenary_elaborate_castle', [(2147483678L, '$g_disable_condescendi
ng_comments', 2), (1, 'script_cf_dplmc_faction_has_bias_against_gender', '$g_tal
k_troop_faction', '$character_gender'), (1, 'script_dplmc_print_cultural_word_to
_sreg', '$g_talk_troop', 6, 0), (522, 72057594037927936L, '$g_talk_troop_faction
', 11), (1, 'script_dplmc_store_troop_is_female', 72057594037927936L), 4, (31, 7
2057594037927936L, 1), (1, 'script_dplmc_print_cultural_word_to_sreg', '$g_talk_
troop', 5, 1), 5, (1, 'script_dplmc_print_cultural_word_to_sreg', '$g_talk_troop
', 4, 1), 3], 'Hmm... Only loyal vassals of {s10} can own lands and castles. Whi
le {s0} will sometimes accept vassalage from {men/women} who prove themselves in
battle, and grant them land, I have never heard of a {s1} who gave fiefs to {me
n/women}. You had best discuss that issue with {s10} {reg0?herself:himself}.', '
lord_mercenary_elaborate_1', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_tell_mission', [(31, '$player_has_homage', 1), (2147483679L, '$rand
om_quest_no', 'qst_rescue_prisoner'), (2147483679L, '$random_quest_no', 'qst_des
troy_bandit_lair'), (2147483679L, '$random_quest_no', 'qst_raise_troops'), (2147
483679L, '$random_quest_no', 'qst_escort_lady'), (2147483679L, '$random_quest_no
', 'qst_lend_companion'), (2147483679L, '$random_quest_no', 'qst_capture_enemy_h
ero'), (2147483679L, '$random_quest_no', 'qst_cause_provocation'), (2147483679L,
'$random_quest_no', 'qst_collect_debt'), (2133, ':is_close', 0), (2133, ':nomin
al_superior', 0), 4, (1, 'script_dplmc_is_affiliated_family_member', '$g_talk_tr
oop'), (1073741854, 72057594037927936L, 1), (540, 'trp_player', 30, '$g_talk_tro
op'), (2133, ':is_close', 1), 5, (30, '$g_talk_troop_faction_relation', 0), (30,
'$g_talk_troop_relation', 50), 4, (1073741857, '$g_talk_troop', 'trp_npc1', 'tr
p_kingdom_1_lord'), (33, '$g_talk_troop', 'trp_kingdom_1_pretender', 'trp_knight
_1_1_wife'), (2147484188L, '$g_talk_troop', 82, :cool:, (2133, ':is_close', 1), 5, (
1, 'script_troop_get_family_relation_to_troop', '$g_talk_troop', 'trp_player'),
(30, 72057594037927936L, 2), (2133, ':is_close', 1), 3, 3, 4, (1073742364, 'trp_
player', 31, '$g_talk_troop'), (1073742364, 'trp_player', 32, '$g_talk_troop'),
(1073742366, '$g_talk_troop_faction', 11, '$g_talk_troop'), (542, '$g_talk_troop
_faction', 8, '$g_talk_troop'), (2133, ':nominal_superior', 1), 5, (520, 7205759
4037927936L, '$g_talk_troop', 7), (2107, 72057594037927936L, 3), (2108, 72057594
037927936L, 4), (2133, ':save_reg0', 72057594037927936L), 4, (2147483678L, '$g_d
isable_condescending_comments', 0), (2147483679L, 72057594037928001L, '$characte
r_gender'), (2147484208L, '$g_talk_troop', 52, :cool:, (2147484188L, '$g_talk_troop'
, 52, 4), (2147484188L, '$g_talk_troop', 52, 6), (2147483681L, '$g_talk_troop',
'trp_npc1', 'trp_kingdom_1_lord'), (1, 'script_cf_dplmc_faction_has_bias_against
_gender', '$g_talk_troop_faction', 'trp_player'), (2107, ':save_reg0', 2), 3, (2
133, 72057594037927936L, ':save_reg0'), (2147484208L, 'trp_player', 7, 720575940
37927936L), (2133, ':nominal_superior', 1), 5, (520, ':player_spouse', 'trp_play
er', 30), (33, ':player_spouse', 'trp_npc1', 'trp_heroes_end'), (1073742364, ':p
layer_spouse', 31, '$g_talk_troop'), (540, ':player_spouse', 32, '$g_talk_troop'
), (2133, ':nominal_superior', 1), 3, (2133, ':matched_any', 0), 4, (1073741854,
':is_close', 1), (30, ':nominal_superior', 1), (1073741855, '$random_quest_no',
'qst_deliver_message_to_prisoner_lord'), (1073741855, '$random_quest_no', 'qst_
meet_spy_in_enemy_town'), (1073741855, '$random_quest_no', 'qst_deliver_message'
), (1073741855, '$random_quest_no', 'qst_collect_taxes'), (1073741855, '$random_
quest_no', 'qst_follow_spy'), (31, '$random_quest_no', 'qst_capture_prisoners'),
(2133, ':matched_any', 1), 5, (30, ':is_close', 1), (1073741855, '$random_quest
_no', 'qst_kill_local_merchant'), (31, '$random_quest_no', 'qst_incriminate_loya
l_commander'), (2133, ':matched_any', 1), 3, (31, ':matched_any', 0), 4, (214748
4190L, '$g_talk_troop_faction', 11, '$g_talk_troop'), (520, 72057594037927936L,
'trp_player', 30), (1073742366, '$g_talk_troop_faction', 11, 'trp_player'), (542
, '$g_talk_troop_faction', 11, 72057594037927936L), (1073742366, '$g_talk_troop_
faction', 11, 'trp_player'), (30, 72057594037927936L, 1), (2133, 720575940379279
36L, 1), 5, (2133, 72057594037927936L, 0), 3], 'There are some minor errands whi
ch I need completed, but it would be more appropriate to give them to one of my
own {reg65?servants:men}, not to {reg0?my sworn liege:a sworn vassal of the real
m}.', 'lord_tell_mission_sworn_vassal', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_tell_mission', [(31, '$random_quest_no', 'qst_escort_lady')], "Ther
e is a small thing... My {s17} {s13} is due for a visit to {reg4?her:his} relati
ves at {s14}. The visit has been postponed several times already with all the tr
ouble on the roads, but this time {reg4?he:she} is adamant about going. So, I wa
nt to at least make sure {reg4?she:he}'s well-guarded. I trust you well, {player
name} so I would be very grateful if you could escort {reg4?her:him} to {s14} an
d make sure {reg4?she:he} arrives safe and sound.", 'lord_mission_told', [(526,
':quest_object_troop', '$random_quest_no', 4), (526, ':quest_target_center', '$r
andom_quest_no', 1), (1, 'script_dplmc_troop_get_family_relation_to_troop', ':qu
est_object_troop', '$g_talk_troop'), 4, (3221225504L, 72057594037927937L, 'str_E
RROR_string'), (2147483678L, 72057594037927936L, 1), (2133, 72057594037927937L,
'str_dplmc_friend'), 3, (2320, 17, 72057594037927937L), (1, 'script_dplmc_cap_tr
oop_describes_troop_to_troop_s1', 1, '$g_talk_troop', ':quest_object_troop', 'tr
p_player'), (2341, 11, '$g_talk_troop'), (2341, 13, ':quest_object_troop'), (234
2, 14, ':quest_target_center'), (1290, '$random_quest_no'), (1, 'script_dplmc_st
ore_troop_is_female', ':quest_object_troop'), (2133, 72057594037927940L, 7205759
4037927936L), (2320, 2, '@{s11} asked you to escort {reg65?her:his} {s17} {s13}
to {s14}.')]]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'lord_tell_mission', [(31, '$random_quest_no', 'qst_raise_troops'), 4, (1
, 'script_cf_dplmc_faction_has_bias_against_gender', '$g_encountered_party_facti
on', 0), (2133, 72057594037927936L, 1), 5, (2133, 72057594037927936L, 0), 3], "N
o lord should have to admit this, {playername}, but I was inspecting my soldiers
the other day and there are {reg0?{reg65?women:soldiers}:{reg65?soldiers:men}}
here who don't know which end of a sword to hold. {s43} You are a warrior of ren
own, {playername}. Will you train some troops for me? I would be grateful to you
.", 'lord_tell_mission_raise_troops', [(1, 'script_lord_comment_to_s43', '$g_tal
k_troop', 'str_troop_train_request_default')]]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'spouse_organize_feast', [(2133, ':is_coruler', 0), 4, (33, '$players_kin
gdom', 'fac_kingdom_1', 'fac_kingdom_12'), (1, 'script_dplmc_get_troop_standing_
in_faction', 'trp_player', '$players_kingdom'), (30, 72057594037927936L, 50), (2
133, ':is_coruler', 1), 3, (1073741855, ':is_coruler', 1), (31, '$players_kingdo
m', 'fac_player_supporters_faction'), (2147483681L, '$g_player_court', 'p_town_1
', 'p_salt_mine'), (1, 'script_dplmc_print_player_spouse_says_my_husband_wife_to
_s0', '$g_talk_troop', 0)], 'A splendid idea, {s0}. However, we must establish a
court before hosting a feast.', 'spouse_pretalk', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'spouse_organize_feast', [(2133, ':is_coruler', 0), 4, (33, '$players_kin
gdom', 'fac_kingdom_1', 'fac_kingdom_12'), (1, 'script_dplmc_get_troop_standing_
in_faction', 'trp_player', '$players_kingdom'), (30, 72057594037927936L, 50), (2
133, ':is_coruler', 1), 3, (1073741855, ':is_coruler', 1), (31, '$players_kingdo
m', 'fac_player_supporters_faction'), (2270, ':hours_since_last_feast'), (522, '
:last_feast_time', '$players_kingdom', 94), (2106, ':hours_since_last_feast', ':
last_feast_time'), 4, (30, '$cheat_mode', 1), (2133, 72057594037927940L, ':hours
_since_last_feast'), (2335, 4, '$players_kingdom'), (1106, '@{!}DEBUG -- {reg4}
hours since last feast for {s4}'), 3, (2147483678L, ':hours_since_last_feast', 1
20), (2121, ':days_to_wait', 168, ':hours_since_last_feast'), (2108, ':days_to_w
ait', 24), (2133, 72057594037927939L, ':days_to_wait'), (1, 'script_dplmc_print_
player_spouse_says_my_husband_wife_to_s0', '$g_talk_troop', 0)], 'A splendid ide
a, {s0}. However, our realm has recently had a feast. Perhaps we should wait ano
ther {reg3} days before we organize another one.', 'spouse_pretalk', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'start', [(31, '$talk_context', 0), (542, '$g_encountered_party_faction',
51, '$g_talk_troop'), (2133, ':is_coruler', 0), 4, (31, '$g_encountered_party_f
action', '$players_kingdom'), (33, '$players_kingdom', 'fac_kingdom_1', 'fac_kin
gdom_12'), (1, 'script_dplmc_get_troop_standing_in_faction', 'trp_player', '$pla
yers_kingdom'), (30, 72057594037927936L, 50), (2133, ':is_coruler', 1), 3, (1073
741855, ':is_coruler', 1), (1073741855, '$g_encountered_party_faction', 'fac_pla
yer_supporters_faction'), (541, '$g_encountered_party', 7, 'trp_player'), (1, 's
cript_dplmc_print_subordinate_says_sir_madame_to_s0')], 'Good day, {s0}. Will yo
u be visiting the prison?', 'prison_guard_players', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'start', [(31, '$talk_context', 0), (542, '$g_encountered_party_faction',
52, '$g_talk_troop'), (2133, ':is_coruler', 0), 4, (31, '$g_encountered_party_f
action', '$players_kingdom'), (33, '$players_kingdom', 'fac_kingdom_1', 'fac_kin
gdom_12'), (1, 'script_dplmc_get_troop_standing_in_faction', 'trp_player', '$pla
yers_kingdom'), (30, 72057594037927936L, 50), (2133, ':is_coruler', 1), 3, (1073
741855, ':is_coruler', 1), (1073741855, '$g_encountered_party_faction', 'fac_pla
yer_supporters_faction'), (541, '$g_encountered_party', 7, 'trp_player')], 'Your
orders, {Lord/Lady}?', 'castle_guard_players', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'ransom_broker_sell_prisoners_all', [(1, 'script_dplmc_sell_all_prisoners
', 0, 0), (2159, 72057594037927938L), (2106, 72057594037927938L, 1)], "Let's see
...  I'll give you {reg0} denars for your {reg1} {reg2?prisoners:prisoner}.  Do
we have a deal?", 'ransom_broker_sell_prisoners_all_2', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[69631, 'ransom_broker_sell_prisoners_all_2', [], 'We have a deal.', 'ransom_bro
ker_sell_prisoners_2', [(1, 'script_dplmc_sell_all_prisoners', 1, 0)]]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[4095, 'start', [(31, '$talk_context', 14), (31, '$g_talk_troop', 'trp_farmer_fr
om_bandit_village'), (2147483848L, 'qst_eliminate_bandits_infesting_village'), (
2147483848L, 'qst_deal_with_bandits_at_lords_village'), (2133, ':end_cond', 'p_s
alt_mine'), (6, ':cur_village', 'p_village_1', ':end_cond'), (541, ':cur_village
', 120, '$g_encountered_party'), (561, ':cur_village', 39, 1), (2147484189L, ':c
ur_village', 39, 'trp_peasant_woman'), (2330, 1, ':cur_village'), (506, 'qst_eli
minate_bandits_infesting_village', 1, ':cur_village'), (506, 'qst_eliminate_band
its_infesting_village', 11, 0), (521, ':village_elder', ':cur_village', 25), (50
6, 'qst_eliminate_bandits_infesting_village', 6, ':village_elder'), (506, 'qst_e
liminate_bandits_infesting_village', 12, ':cur_village'), (2133, ':end_cond', 0)
, 3, (1, 'script_dplmc_get_troop_standing_in_faction', 'trp_player', '$g_encount
ered_party_faction'), (1073741856, 72057594037927936L, 10), (560, 'trp_player',
7, 600), (2133, '$temp', ':cur_village'), (2133, '$temp_2', 1), (1, 'script_dplm
c_print_commoner_at_arg1_says_sir_madame_to_s0', '$g_encountered_party'), (2106,
72057594037927936L, 2), (2111, 72057594037927936L, 0), (2319, 0)], '{reg0?Your
highness:My {lord/lady}}, we are in dire need of assistance.  Will you hear my p
lea?', 'farmer_from_bandit_village_1', []]
Error was: 'int' object has no attribute 'lower'

Error in dialog line:
[69631, 'lord_ask_leave_service_verify_again', [(2147484188L, 'trp_player', 30,
'$g_talk_troop'), (2147484188L, '$g_talk_troop', 30, 'trp_player'), (2147484190L
, '$g_talk_troop_faction', 11, 'trp_player'), (1, 'script_dplmc_get_troop_standi
ng_in_faction', 'trp_player', '$g_talk_troop_faction'), (2147483678L, 7205759403
7927936L, 50), (2133, ':has_walled_center', 'p_village_1'), (6, ':center_no', 'p
_town_1', ':has_walled_center'), (541, ':center_no', 7, 'trp_player'), (2133, ':
has_walled_center', ':center_no'), 3, (33, ':has_walled_center', 'p_town_1', 'p_
village_1')], 'I have no intention of losing my lands, {s65}.', 'dplmc_lord_ask_
leave_service_rebellion', []]
Error was: 'int' object has no attribute 'lower'

hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Checking global variable usages...
WARNING: Global variable never used: g_dplmc_auto_sell_price_limit
Imported 51 global variables for saved-game compatability that are not used.
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

Also, any particular place that you would recommend that I place the whole    (item_set_slot, "itm_bec_de_corbin_a", slot_item_alternate, "itm_bec_de_corbin_alt"), part in? Outside or within the two game_starts, once or twice? I have been thinking that perhaps the position messes with Diplomacy codes.
Edit: Switching the position did actually get rid of the massive Dialogue errors but there are still the other errors along with a change at the end.
checking for bec_de_corbin
Checking global variable usages...
WARNING: Global variable never used: g_jrider_reset_selected_on_faction
WARNING: Global variable never used: g_latest_character_relation_entry
WARNING: Global variable never used: g_give_advantage_to_original_faction
Imported 77 global variables for saved-game compatability that are not used.
Exporting postfx_params...
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Rename Native's itm_bec_de_corbin_a into itm_bec_de_corbin.
("init_item_slots", set_item_score()), is another script, and should be placed at the end of the list of scripts. You then call it as you would have called script_alternate_weapon_modes earlier. Because that breaks the script, it also breaks a number of other things once the game doesn't have a valid script file to compile.
 

GunFred

Squire
Best answers
0
So should I do the following switch?..
  ("game_quick_start",
    [
.........................
  #Somebody's Alternate
(call_script, "script_init_item_slots"),
 
    ]),

.........................

  ("game_start",
  [
.........................
  #Somebody's Alternate
(call_script, "script_init_item_slots"),
 
    ]),

I still get the following errors...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Initializing...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Compiling all global variables...
Error in script:
(1, 'script_init_item_slots')
Error in script:
(507, 'itm_sarranid_two_handed_pick_b', 62, 'itm_sarranid_two_handed_axe_b')
Error in script:
(507, 'itm_sarranid_two_handed_axe_b', 62, 'itm_sarranid_two_handed_pick_b')
Error in script:
(507, 'itm_bec_de_corbin_alt', 62, 'itm_bec_de_corbin_a')
Error in script:
(507, 'itm_bec_de_corbin_a', 62, 'itm_bec_de_corbin_alt')
Error in script:
(507, 'itm_pick_alt', 62, 'itm_pickaxe')
Error in script:
(507, 'itm_pickaxe', 62, 'itm_pick_alt')
Error in script:
(507, 'itm_fp_alt', 62, 'itm_fighting_pick')
Error in script:
(507, 'itm_fighting_pick', 62, 'itm_fp_alt')
Error in script:
(507, 'itm_mp_alt', 62, 'itm_military_pick')
Error in script:
(507, 'itm_military_pick', 62, 'itm_mp_alt')
Error in script:
(507, 'itm_h_alt', 62, 'itm_hammer')
Error in script:
(507, 'itm_hammer', 62, 'itm_h_alt')
Error in script:
(507, 'itm_ih_alt', 62, 'itm_military_hammer')
Error in script:
(507, 'itm_military_hammer', 62, 'itm_ih_alt')
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin

pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting scene data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting troops data
Exporting particle data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting scene props...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting tableau materials data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting presentations...
Exporting party_template data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting parties
Exporting quest data...
Exporting info_page data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting scripts...
Traceback (most recent call last):
  File "process_scripts.py", line 47, in <module>
    save_python_header()
  File "process_scripts.py", line 41, in save_python_header
    file.write("script_%s = %d\n"%(convert_to_identifier(scripts[i_script][0]),i
_script))
  File "C:\Users\GunFred\Desktop\A\process_common.py", line 5, in convert_to_ide
ntifier
    s1 = string.replace(s0," ","_")
  File "C:\Python27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'int' object has no attribute 'replace'
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting mission_template data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Exporting game menus data...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
exporting simple triggers...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
exporting triggers...
exporting dialogs...
hammer362 has alternate 363
checking for h
military_hammer367 has alternate 368
checking for ih
pickaxe372 has alternate 373
checking for pick
fighting_pick375 has alternate 376
checking for fp
military_pick377 has alternate 378
checking for mp
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
bec_de_corbin_a500 has alternate 501
checking for bec_de_corbin
Checking global variable usages...
WARNING: Global variable never used: g_jrider_reset_selected_on_faction
WARNING: Global variable never used: g_latest_character_relation_entry
WARNING: Global variable never used: g_give_advantage_to_original_faction
Imported 77 global variables for saved-game compatability that are not used.
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
Removing "_a" does not change much if anything. It still searches for two different "bec_de_corbin".
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Re-name all the alternate versions to be exactly the same item reference name, with an
Code:
_alt
at the end. Post the bec-de-corbin item entry if you're still having problems.
 

GunFred

Squire
Best answers
0
Renaming the items got them to seemingly pair up properly but I still get the script errors.
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Initializing...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Compiling all global variables...
Error in script:
(1, 'script_init_item_slots')
Error in script:
(507, 'itm_sarranid_two_handed_axe_b_alt', 62, 'itm_sarranid_two_handed_axe_b')
Error in script:
(507, 'itm_sarranid_two_handed_axe_b', 62, 'itm_sarranid_two_handed_axe_b_alt')
Error in script:
(507, 'itm_bec_de_corbin_alt', 62, 'itm_bec_de_corbin')
Error in script:
(507, 'itm_bec_de_corbin', 62, 'itm_bec_de_corbin_alt')
Error in script:
(507, 'itm_pickaxe_alt', 62, 'itm_pickaxe')
Error in script:
(507, 'itm_pickaxe', 62, 'itm_pickaxe_alt')
Error in script:
(507, 'itm_fighting_pick_alt', 62, 'itm_fighting_pick')
Error in script:
(507, 'itm_fighting_pick', 62, 'itm_fighting_pick_alt')
Error in script:
(507, 'itm_military_pick_alt', 62, 'itm_military_pick')
Error in script:
(507, 'itm_military_pick', 62, 'itm_military_pick_alt')
Error in script:
(507, 'itm_hammer_alt', 62, 'itm_hammer')
Error in script:
(507, 'itm_hammer', 62, 'itm_hammer_alt')
Error in script:
(507, 'itm_military_hammer_alt', 62, 'itm_military_hammer')
Error in script:
(507, 'itm_military_hammer', 62, 'itm_military_hammer_alt')

Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting tableau materials data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting presentations...
Exporting party_template data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting parties
Exporting quest data...
Exporting info_page data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting scripts...
Traceback (most recent call last):
  File "process_scripts.py", line 47, in <module>
    save_python_header()
  File "process_scripts.py", line 41, in save_python_header
    file.write("script_%s = %d\n"%(convert_to_identifier(scripts[i_script][0]),i
_script))
  File "C:\Users\GunFred\Desktop\A\process_common.py", line 5, in convert_to_ide
ntifier
    s1 = string.replace(s0," ","_")
  File "C:\Python27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'int' object has no attribute 'replace'

hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting mission_template data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Exporting game menus data...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
exporting simple triggers...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
exporting triggers...
exporting dialogs...
hammer362 has alternate 363
checking for hammer
Hammer (Pick) has been paired with Hammer
military_hammer367 has alternate 368
checking for military_hammer
Military Hammer (pick) has been paired with Military Hammer
pickaxe372 has alternate 373
checking for pickaxe
Pickaxe (Hammer) has been paired with Pickaxe
fighting_pick375 has alternate 376
checking for fighting_pick
Fighting Pick (Hammer) has been paired with Fighting Pick
military_pick377 has alternate 378
checking for military_pick
Military Pick (Hammer) has been paired with Military Pick
long_axe423 has alternate 424
checking for long_axe
Long Axe has been paired with Long Axe
long_axe_b425 has alternate 426
checking for long_axe_b
Long War Axe has been paired with Long War Axe
long_axe_c427 has alternate 428
checking for long_axe_c
Great Long Axe has been paired with Great Long Axe
sarranid_two_handed_axe_b471 has alternate 472
checking for sarranid_two_handed_axe_b
Sarranid War Axe (Pick) has been paired with Sarranid War Axe
bec_de_corbin500 has alternate 501
checking for bec_de_corbin
War Hammer has been paired with War Hammer (Spike)
Checking global variable usages...
WARNING: Global variable never used: g_jrider_reset_selected_on_faction
WARNING: Global variable never used: g_latest_character_relation_entry
WARNING: Global variable never used: g_give_advantage_to_original_faction
Imported 77 global variables for saved-game compatability that are not used.

Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

Constants...
########################################################
##  ITEM SLOTS            #############################
########################################################

slot_item_is_checked              = 0
slot_item_food_bonus              = 1
slot_item_book_reading_progress    = 2

.........................................

slot_item_multiplayer_item_class  = 60 #temporary, can be moved to higher values
slot_item_multiplayer_availability_linked_list_begin = 61 #temporary, can be moved to higher values

slot_item_alternate = 62 # Somebody's Alternate Weapon Modes
slot_item_swing_damage = 63
slot_item_thrust_damage = 64


########################################################
##  AGENT SLOTS            #############################
########################################################

slot_agent_target_entry_point    = 0
slot_agent_target_x_pos          = 1
slot_agent_target_y_pos          = 2
...........................................
slot_agent_in_duel_with          = 21
slot_agent_duel_start_time        = 22

slot_agent_walker_occupation      = 25

slot_agent_last_weapon_toggled = 26 # Somebody's Alternate Weapon Modes

All my Scripts...
####################################################################################################################
# scripts is a list of script records.
# Each script record contns the following two fields:
# 1) Script id: The prefix "script_" will be inserted when referencing scripts.
# 2) Operation block: This must be a valid operation block. See header_operations.py for reference.
####################################################################################################################
def set_item_score():
  item_score = []
  for i_item in xrange(len(items)):   
    type = items[i_item][3] & 0x000000ff
    name = items[i_item][0]
    if (type >= itp_type_one_handed_wpn and type <= itp_type_thrown and type != itp_type_shield) or (type >= itp_type_pistol and type <= itp_type_bullets):
      item_score.append((item_set_slot, i_item, slot_item_thrust_damage, get_thrust_damage(items[i_item][6])))
      item_score.append((item_set_slot, i_item, slot_item_swing_damage, get_swing_damage(items[i_item][6])))
      if (items[i_item][3] & itp_next_item_as_melee == itp_next_item_as_melee) and type != itp_type_thrown: #toggleable weapons
        item_score.append((item_set_slot, i_item, slot_item_alternate, i_item + 1))
        item_score.append((item_set_slot, i_item + 1, slot_item_alternate, i_item))
        print items[i_item][0] + str(i_item) + " has alternate " + str(i_item+1)
      elif name.endswith("_alt"):
        name = name.rstrip('_alt')
        print "checking for " + name
        for x_item in xrange(i_item-1,0,-1):
          if items[x_item][0] == name:
            item_score.append((item_set_slot, i_item, slot_item_alternate, x_item))
            item_score.append((item_set_slot, x_item, slot_item_alternate, i_item))
            print items[i_item][1] + " has been paired with " + items[x_item][1]
            break

  return item_score[:]

 
scripts = [


  #script_game_start:
  # This script is called when a new game is started
  # INPUT: none
  ("game_start",
  [
  ("game_quick_start",
    [
.........................
  #Somebody's Alternate
  (call_script, "script_init_item_slots"),

 
    ]),

.........................

  ("game_start",
  [
.........................
  #Somebody's Alternate
  (call_script, "script_init_item_slots"),

 
    ]),
(call_script, "script_init_item_slots"),

    (item_set_slot, "itm_sarranid_two_handed_axe_b_alt", slot_item_alternate, "itm_sarranid_two_handed_axe_b"),
    (item_set_slot, "itm_sarranid_two_handed_axe_b", slot_item_alternate, "itm_sarranid_two_handed_axe_b_alt"),
    (item_set_slot, "itm_bec_de_corbin_alt", slot_item_alternate, "itm_bec_de_corbin"),
    (item_set_slot, "itm_bec_de_corbin", slot_item_alternate, "itm_bec_de_corbin_alt"),
   
    (item_set_slot, "itm_pickaxe_alt", slot_item_alternate, "itm_pickaxe"),
    (item_set_slot, "itm_pickaxe", slot_item_alternate, "itm_pickaxe_alt"),
    (item_set_slot, "itm_fighting_pick_alt", slot_item_alternate, "itm_fighting_pick"),
    (item_set_slot, "itm_fighting_pick", slot_item_alternate, "itm_fighting_pick_alt"),
    (item_set_slot, "itm_military_pick_alt", slot_item_alternate, "itm_military_pick"),   
    (item_set_slot, "itm_military_pick", slot_item_alternate, "itm_military_pick_alt"),
   
    (item_set_slot, "itm_hammer_alt", slot_item_alternate, "itm_hammer"),
    (item_set_slot, "itm_hammer", slot_item_alternate, "itm_hammer_alt"),
    (item_set_slot, "itm_military_hammer_alt", slot_item_alternate, "itm_military_hammer"),
    (item_set_slot, "itm_military_hammer", slot_item_alternate, "itm_military_hammer_alt"),

#Somebody's Alternate
("init_item_slots", set_item_score()),

<-- ABSOLUTE END OF MODULE SCRIPTS

Perhaps the fault lies with the mission_template...
common_siege_check_defeat_condition = (
  1, 4,
##diplomacy begin
0,
##diplomacy end
  [
    (main_hero_fallen)
    ],
  [
    ##diplomacy begin
    (try_begin),
      (eq, "$g_dplmc_battle_continuation", 0),
      (assign, ":num_allies", 0),
      (try_for_agents, ":agent"),
      (agent_is_ally, ":agent"),
      (agent_is_alive, ":agent"),
      (val_add, ":num_allies", 1),
      (try_end),
      (gt, ":num_allies", 0),
      (try_begin),
        (eq, "$g_dplmc_cam_activated", 0),
        #(store_mission_timer_a, "$g_dplmc_main_hero_fallen_seconds"),
        (assign, "$g_dplmc_cam_activated", 1),
        (display_message, "@You have been knocked out by the enemy. Watch your men continue the fight without you or press Tab to retreat."),
        (display_message, "@To watch the fight you can use 'w, a, s, d, numpad_+/numpad_-' to move and 'numpad_1,2,3,4,6,8' to rotate the cam."),
      (try_end),
    (else_try),
    ##diplomacy end
    (assign, "$pin_player_fallen", 1),
    (get_player_agent_no, ":player_agent"),
    (agent_get_team, ":agent_team", ":player_agent"),
    (try_begin),
      (neq, "$attacker_team", ":agent_team"),
      (neq, "$attacker_team_2", ":agent_team"),
      (str_store_string, s5, "str_siege_continues"),
      (call_script, "script_simulate_retreat", 8, 15, 0),
    (else_try),
      (str_store_string, s5, "str_retreat"),
      (call_script, "script_simulate_retreat", 5, 20, 0),
    (try_end),
    (assign, "$g_battle_result", -1),
    (set_mission_result,-1),
    (call_script, "script_count_mission_casualties_from_agents"),
    (finish_mission,0),
    ##diplomacy begin
    (try_end),
    ##diplomacy end
    ])

# Somebody's Alternate

common_ai_order_toggle = (ti_on_order_issued, 0, 0, [
  (store_trigger_param_1, ":eek:rder_no"),
  (this_or_next|eq, ":eek:rder_no", mordr_use_any_weapon),
  (eq, ":eek:rder_no", mordr_use_blunt_weapons),
  ],
  [
  (store_trigger_param_1, ":eek:rder_no"),
  (store_trigger_param_2, ":agent_id"), #probably the player
  (agent_get_team, ":team_id", ":agent_id"),

  (try_for_agents, ":agent_no"),

    (agent_is_active, ":agent_no"),
    (agent_is_human, ":agent_no"),
    (agent_is_non_player, ":agent_no"),
    (agent_is_alive, ":agent_no"),
    (agent_get_team, ":team_no", ":agent_no"),
    (eq, ":team_no", ":team_id"),
    (agent_get_class, ":class_no", ":agent_no"),
    (class_is_listening_order, ":team_no", ":class_no"),
    (agent_get_wielded_item, ":item_no", ":agent_no", 0),
    # (assign, reg10, ":agent_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (try_begin),
      # (le, ":item_no", 0),
      # (str_store_string, s2, "@nothing"),
    # (else_try),
      # (str_store_item_name, s2, ":item_no"),
    # (try_end),
    # (str_store_string, s1, "@{reg10}:{s1} holding {s2}:"),
    # (try_for_range, ":item_slot", ek_item_0, ek_head),
      # (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
      # (gt, ":item_id", 0),
      # (neq, ":item_id", ":item_no"),
      # (str_store_item_name, s0, ":item_id"),
      # (str_store_string, s1, "@{s1}, {s0}"),
    # (try_end),
    # (display_message, s1),


    (gt, ":item_no", 0),
    (assign, ":swap_no", 0),

    #here we assume a weapon with alternate mode has been found already - it is rare that two item types will be equipped that can be swapped with different damage modes
    (try_begin), #make use of the other item slots
      (eq, ":eek:rder_no", mordr_use_any_weapon), #just plain swapping
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
      (gt, ":swap_no", 1),
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no", 0),
      # (store_mission_timer_a, ":timer_a"),
      # (val_add, ":timer_a", 1000),
      # (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":timer_a"),
    (else_try),
      (eq, ":eek:rder_no", mordr_use_blunt_weapons), #switching to blunt modes only
      (neg|item_slot_ge, ":item_no", slot_item_swing_damage, 513), #not already holding blunt
      #check inventory to see if weapon can be toggled
      (assign, ":end", ek_head),
      # (str_store_agent_name, s10, ":agent_no"),
      # (assign, reg10, ":agent_no"),
      # (str_store_string, s10, "@{reg10}={s10}:blunt"),
      (try_for_range, ":item_slot", ek_item_0, ":end"),
        (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
        (gt, ":item_id", 0),

        (item_get_type, ":item_itp", ":item_id"),
        (is_between, ":item_itp", itp_type_one_handed_wpn, itp_type_arrows),
        (neg|item_slot_ge, ":item_id", slot_item_swing_damage, 513), #let engine set wielded
        # (str_store_item_name, s1, ":item_id"),
        # (item_get_slot, reg9, ":item_id", slot_item_swing_damage),
        # (str_store_string, s10, "@{s10},checking {s1} with {reg9} dmg"),
        (item_get_slot, ":swap_id", ":item_id", slot_item_alternate),
        (gt, ":swap_id", 1),
        # (str_store_string, s10, "@{s10} and alt"),

        (try_begin),
          # (item_get_slot, ":damage", ":swap_id", slot_item_swing_damage),
          # (gt, ":damage", 512),
          (item_slot_ge, ":swap_id", slot_item_swing_damage, 513),
          (item_get_slot, ":damage", ":item_id", slot_item_thrust_damage),
          (this_or_next|eq, ":damage", 0), #no thrust capability
          (this_or_next|eq, ":damage", 256), #defined as (0, flag)
          (gt, ":damage", 512),

          # (assign, ":item_no", ":item_id"),
          (assign, ":end", -1),
          (agent_unequip_item, ":agent_no", ":item_id"),
          (agent_equip_item, ":agent_no", ":swap_id"),
          (agent_force_rethink, ":agent_no"),
        (try_end),
      (try_end),
      # (try_begin),
        # (eq, ":end", ek_head),
        # (assign, ":swap_no", -1),
        # (assign, ":item_no", -1),
        # (assign, ":color", 0xFF0000),
        # (display_message, "@{reg10}: switch to nothing", ":color"),
      # (else_try),
        # (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
        # (assign, ":color", 0x00FF00),
        # (str_store_item_name, s2, ":swap_no"),
        # (display_message, "@{reg10}: switch to {s2}", ":color"),
      # (try_end),
    # (else_try), #exclude them
      # (assign, ":swap_no", 0),
    (try_end),
    # (gt, ":item_no", 0),
    # (gt, ":swap_no", 0),
    # (agent_unequip_item, ":agent_no", ":item_no"),
    # (agent_unequip_item, ":agent_no", ":swap_no"),
    # (agent_equip_item, ":agent_no", ":swap_no"),
    # #(agent_set_wielded_item, ":agent_no", ":swap_no"),
    # (str_store_item_name, s3, ":item_no"),
    # (str_store_item_name, s2, ":swap_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (display_message, "@{reg10}:{s1} switching to {s2} from {s3}", ":color"),
    # (agent_force_rethink, ":agent_no"),
  (try_end),
  ]
)
common_ai_sanity_check = (
  ti_on_item_wielded, 0, 0, [
  (store_trigger_param_2, ":item_no"),
  (eq, ":item_no", 0),
  ],
  [
  (store_trigger_param_1, ":agent_no"),
  # (str_store_agent_name, s11, ":agent_no"),
  # (assign, reg11, ":agent_no"),
  # (str_store_string, s11, "@{reg11}+{s11}"),
  # (try_for_range, ":item_slot", 0, ek_head),
    # (agent_get_item_slot, reg11, ":agent_no", ":item_slot"),
    # (str_store_string, s11, "@{s11}; {reg11}"),
  # (try_end),
  # (display_message, s11),
  (agent_unequip_item, ":agent_no", 0),
  (agent_force_rethink, ":agent_no"),

  ]
)
common_ai_random_toggle = (1, 0, 0,
  [],
  [
    (store_mission_timer_a, ":timer_a"),
    (try_for_agents, ":agent_no"),
      (assign, ":swap_no", -1),
      #check valid agent candidates
      (agent_is_active, ":agent_no"),
      (agent_is_human, ":agent_no"),
      (agent_is_non_player, ":agent_no"),
      (agent_is_alive, ":agent_no"),
      (agent_get_combat_state, ":cs", ":agent_no"),
      (this_or_next|eq, ":cs", 0), #cs_free
      (this_or_next|eq, ":cs", 7), #cs_still
      (eq, ":cs", 3), #cs_wield

      (agent_get_team, ":agent_team", ":agent_no"),
      (agent_get_class, ":agent_class", ":agent_no"),
      #should probably cache this inside team slots
      (team_get_weapon_usage_order, ":eek:rder_no", ":agent_team",  ":agent_class"),
      (neq, ":eek:rder_no", wordr_use_blunt_weapons),
      #check validity of weapon
      (agent_get_wielded_item, ":item_no", ":agent_no", 0),
      (gt, ":item_no", 1),
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),

      (gt, ":swap_no", 1),
      (item_get_type, ":itp", ":item_no"),
      (is_between, ":itp", itp_type_one_handed_wpn, itp_type_arrows),
      #weapon mastery increases chance of toggling
      (agent_get_troop_id, ":troop_no", ":agent_no"),
      (store_skill_level, ":skill", "skl_weapon_master", ":troop_no"),
      (store_random_in_range, ":random_no", 0, 100),

      #most native troops do NOT have weapon mastery - adjust as needed
      (ge, ":skill", ":random_no"),

      (store_mission_timer_a, ":timer_a"),
      #check timing
      (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggled),
      (lt, ":last_switched", ":timer_a"),

      (store_sub, ":wpt", ":itp", 2),
      (store_proficiency_level, ":prof", ":troop_no", ":wpt"),
      (assign, reg9, ":prof"),
      #proficiency decreases time between toggle
      (val_mul, ":random_no", :cool:, #from 0 to 160
      (val_add, ":random_no", 1600), #delay
      (store_sub, ":prof", ":random_no", ":prof"), #between 1500 to 600 usually
      (val_div, ":prof", 80), #between 12s to 7.5s

      #store timing
      (store_add, ":last_switched", ":timer_a", ":prof"),
      (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":last_switched"),

      #actual switching
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no"),

      # (assign, reg10, ":last_switched"),
      # (str_store_item_name, s3, ":item_no"),
      # (str_store_item_name, s2, ":swap_no"),
      # (str_store_agent_name, s1, ":agent_no"),
      # (display_message, "@{reg10}:{s1} with {reg9} wpx switching to {s2} from {s3}"),
    (try_end),
  ]
)
common_player_toggle = (0,0,1, [
        (neg|main_hero_fallen),
        (game_key_clicked, gk_toggle_weapon_mode),
        (get_player_agent_no, "$g_player_agent"),
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (gt, ":item", 0),
        (item_slot_ge, ":item", slot_item_alternate, 1),
      ],
      #side effects may include cleaning the weapon automatically, improper carry positions, and items not corresponding to stats when switched between trigger checks using native behaviour
      [
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (item_get_slot, ":alternate", ":item", slot_item_alternate),
        (gt, ":alternate", 1),
        (agent_unequip_item, "$g_player_agent", ":alternate"),
        (agent_unequip_item, "$g_player_agent", ":item"),
        (agent_equip_item, "$g_player_agent", ":alternate"),
        (agent_set_wielded_item, "$g_player_agent", ":alternate"),
      ],
    )
common_wpn_swapping = [common_ai_order_toggle,common_ai_sanity_check,common_ai_random_toggle,common_player_toggle]


# Somebody's Alternate END




common_battle_order_panel = (
  0, 0, 0, [],
  [
    (game_key_clicked, gk_view_orders),
    ##diplomacy begin
    (neg|main_hero_fallen),
    ##diplomacy end
    (neg|is_presentation_active, "prsnt_battle"),
    (start_presentation, "prsnt_battle"),
    ])

common_battle_order_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle"),
    (call_script, "script_update_order_panel_statistics_and_map"),
    ])

common_battle_inventory = (
  ti_inventory_key_pressed, 0, 0, [],
  [
    (display_message,"str_use_baggage_for_inventory"),
    ])

common_inventory_not_available = (
  ti_inventory_key_pressed, 0, 0,
  [
    (display_message, "str_cant_use_inventory_now"),
    ], [])

common_siege_init_ai_and_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_siege_init_ai_and_belfry"),
    ], [])

common_siege_move_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_move_belfry"),
    ], [])

common_siege_rotate_belfry = (
  0, 2, ti_once,
  [
    (call_script, "script_cf_siege_rotate_belfry_platform"),
    ],
  [
    (assign, "$belfry_positioned", 3),
    ])

common_siege_assign_men_to_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_assign_men_to_belfry"),
    ], [])

# Somebody's Alternate Weapon Modes
common_player_weapon_toggle = (0,0,1, [
    (neg|main_hero_fallen),
    (game_key_clicked, gk_toggle_weapon_mode),
    (get_player_agent_no, ":player_agent"),
    (agent_get_wielded_item, ":item", ":player_agent", 0),
    (gt, ":item", 0),
    (item_slot_ge, ":item", slot_item_alternate, 1),
  ],
  [
    (get_player_agent_no, ":player_agent"),
    (agent_get_wielded_item, ":item", ":player_agent", 0),
    (item_get_slot, ":alternate", ":item", slot_item_alternate),
    (gt, ":alternate", 1),
    (agent_unequip_item, ":player_agent", ":item"),
    (agent_equip_item, ":player_agent", ":alternate"),
    (agent_set_wielded_item, ":player_agent", ":alternate"),
  ],
)
common_ai_order_toggle = (ti_on_order_issued, 0, 0, [
  (store_trigger_param_1, ":eek:rder_no"),
  (this_or_next|eq, ":eek:rder_no", mordr_use_any_weapon),
  (eq, ":eek:rder_no", mordr_use_blunt_weapons),
  ],
[
  (store_trigger_param_1, ":eek:rder_no"),
  (store_trigger_param_2, ":agent_id"), #probably the player
  (agent_get_team, ":team_id", ":agent_id"),
 
  (try_for_agents, ":agent_no"),
    (agent_is_active, ":agent_no"),
    (agent_is_human, ":agent_no"),
    (agent_is_non_player, ":agent_no"),
    (agent_is_alive, ":agent_no"),
    (agent_get_team, ":team_no", ":agent_no"),
    (eq, ":team_no", ":team_id"),
    (agent_get_class, ":class_no", ":agent_no"),
    (class_is_listening_order, ":team_no", ":class_no"),
    (agent_get_wielded_item, ":item_no", ":agent_no", 0),
    (try_begin), #could be using fists
      (gt, ":item_no", 0),
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
    (else_try),
      (assign, ":swap_no", 0),
    (try_end),
   
    (try_begin), #none found on wielded item
      (eq, ":swap_no", 0), #
      (assign, ":end", ek_head),
      (try_for_range, ":item_slot", ek_item_0, ":end"),
        (agent_get_item_slot, ":item_no", ":agent_no", ":item_slot"),
        (gt, ":item_no", 0),
        (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
        (gt, ":swap_no", 0),
        (assign, ":end", -1),
      (try_end),
    (try_end),
    (gt, ":swap_no", 0),
    (try_begin), #make use of the other item slots
      (eq, ":eek:rder_no", mordr_use_any_weapon), #too lazy to re-set, just plain swapping
    (else_try),
      (eq, ":eek:rder_no", mordr_use_blunt_weapons), #switching to blunt modes only
      #check inventory to see if weapon can be toggled
      (try_begin),
       
        (try_for_range, ":item_slot", ek_item_0, ":end"),
          (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
          (this_or_next|eq, ":item_id", "itm_hammer_alt"),
          (this_or_next|eq, ":item_id", "itm_military_hammer_alt"),
          (this_or_next|eq, ":item_id", "itm_bec_de_corbin"),
          (this_or_next|eq, ":item_id", "itm_pickaxe"),
          (is_between, ":item_id", "itm_fighting_pick", "itm_morningstar"),
          (assign, ":item_no", ":item_id"),
          (assign, ":end", ek_item_0),
          (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
         
        (try_end),
      (try_end),
      #these are piercing weapons
      (this_or_next|eq, ":item_no", "itm_hammer_alt"),
      (this_or_next|eq, ":item_no", "itm_military_hammer_alt"),
      (this_or_next|eq, ":item_no", "itm_bec_de_corbin"),
      (this_or_next|eq, ":item_no", "itm_pickaxe"),
      (is_between, ":item_no", "itm_fighting_pick", "itm_morningstar"),
    (else_try), #exclude them
      (assign, ":swap_no", 0),
    (try_end),
    (gt, ":swap_no", 0),
    (agent_unequip_item, ":agent_no", ":item_no"),
    (agent_equip_item, ":agent_no", ":swap_no"),
    (agent_set_wielded_item, ":agent_no", ":swap_no"),
  (try_end),
])
# Somebody's Alternate Weapon Modes END



tournament_triggers = [
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
You have a duplicated set of mission template triggers - remove the older one(s).
Get rid of all this stuff, since the python code at the top will be generating it for you.
Code:
  (call_script, "script_init_item_slots"),
   
    (item_set_slot, "itm_sarranid_two_handed_axe_b_alt", slot_item_alternate, "itm_sarranid_two_handed_axe_b"),
    (item_set_slot, "itm_sarranid_two_handed_axe_b", slot_item_alternate, "itm_sarranid_two_handed_axe_b_alt"),
    (item_set_slot, "itm_bec_de_corbin_alt", slot_item_alternate, "itm_bec_de_corbin"),
    (item_set_slot, "itm_bec_de_corbin", slot_item_alternate, "itm_bec_de_corbin_alt"),
    
    (item_set_slot, "itm_pickaxe_alt", slot_item_alternate, "itm_pickaxe"),
    (item_set_slot, "itm_pickaxe", slot_item_alternate, "itm_pickaxe_alt"),
    (item_set_slot, "itm_fighting_pick_alt", slot_item_alternate, "itm_fighting_pick"),
    (item_set_slot, "itm_fighting_pick", slot_item_alternate, "itm_fighting_pick_alt"),
    (item_set_slot, "itm_military_pick_alt", slot_item_alternate, "itm_military_pick"),    
    (item_set_slot, "itm_military_pick", slot_item_alternate, "itm_military_pick_alt"),
    
    (item_set_slot, "itm_hammer_alt", slot_item_alternate, "itm_hammer"),
    (item_set_slot, "itm_hammer", slot_item_alternate, "itm_hammer_alt"),
    (item_set_slot, "itm_military_hammer_alt", slot_item_alternate, "itm_military_hammer"),
    (item_set_slot, "itm_military_hammer", slot_item_alternate, "itm_military_hammer_alt"),
Your problem when compiling results from that script not being closed. Remember, to the compiler, init_item_slots IS just another script but you have it lumped inside another one.
 

GunFred

Squire
Best answers
0
Thanks to your last post I finally do not get any errors in the build... :grin:
But the meshes still do not switch ingame. I removed the script code above and...

I disabled the red part and kept the blue part in mission_template. Should that have been enough or was it supposed to be done another way?
common_siege_check_defeat_condition = (
  1, 4,
##diplomacy begin
0,
##diplomacy end
  [
    (main_hero_fallen)
    ],
  [
    ##diplomacy begin
    (try_begin),
      (eq, "$g_dplmc_battle_continuation", 0),
      (assign, ":num_allies", 0),
      (try_for_agents, ":agent"),
      (agent_is_ally, ":agent"),
      (agent_is_alive, ":agent"),
      (val_add, ":num_allies", 1),
      (try_end),
      (gt, ":num_allies", 0),
      (try_begin),
        (eq, "$g_dplmc_cam_activated", 0),
        #(store_mission_timer_a, "$g_dplmc_main_hero_fallen_seconds"),
        (assign, "$g_dplmc_cam_activated", 1),
        (display_message, "@You have been knocked out by the enemy. Watch your men continue the fight without you or press Tab to retreat."),
        (display_message, "@To watch the fight you can use 'w, a, s, d, numpad_+/numpad_-' to move and 'numpad_1,2,3,4,6,8' to rotate the cam."),
      (try_end),
    (else_try),
    ##diplomacy end
    (assign, "$pin_player_fallen", 1),
    (get_player_agent_no, ":player_agent"),
    (agent_get_team, ":agent_team", ":player_agent"),
    (try_begin),
      (neq, "$attacker_team", ":agent_team"),
      (neq, "$attacker_team_2", ":agent_team"),
      (str_store_string, s5, "str_siege_continues"),
      (call_script, "script_simulate_retreat", 8, 15, 0),
    (else_try),
      (str_store_string, s5, "str_retreat"),
      (call_script, "script_simulate_retreat", 5, 20, 0),
    (try_end),
    (assign, "$g_battle_result", -1),
    (set_mission_result,-1),
    (call_script, "script_count_mission_casualties_from_agents"),
    (finish_mission,0),
    ##diplomacy begin
    (try_end),
    ##diplomacy end
    ])
 
# Somebody's Alternate

common_ai_order_toggle = (ti_on_order_issued, 0, 0, [
  (store_trigger_param_1, ":eek:rder_no"),
  (this_or_next|eq, ":eek:rder_no", mordr_use_any_weapon),
  (eq, ":eek:rder_no", mordr_use_blunt_weapons),
  ],
  [
  (store_trigger_param_1, ":eek:rder_no"),
  (store_trigger_param_2, ":agent_id"), #probably the player
  (agent_get_team, ":team_id", ":agent_id"),

  (try_for_agents, ":agent_no"),

    (agent_is_active, ":agent_no"),
    (agent_is_human, ":agent_no"),
    (agent_is_non_player, ":agent_no"),
    (agent_is_alive, ":agent_no"),
    (agent_get_team, ":team_no", ":agent_no"),
    (eq, ":team_no", ":team_id"),
    (agent_get_class, ":class_no", ":agent_no"),
    (class_is_listening_order, ":team_no", ":class_no"),
    (agent_get_wielded_item, ":item_no", ":agent_no", 0),
    # (assign, reg10, ":agent_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (try_begin),
      # (le, ":item_no", 0),
      # (str_store_string, s2, "@nothing"),
    # (else_try),
      # (str_store_item_name, s2, ":item_no"),
    # (try_end),
    # (str_store_string, s1, "@{reg10}:{s1} holding {s2}:"),
    # (try_for_range, ":item_slot", ek_item_0, ek_head),
      # (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
      # (gt, ":item_id", 0),
      # (neq, ":item_id", ":item_no"),
      # (str_store_item_name, s0, ":item_id"),
      # (str_store_string, s1, "@{s1}, {s0}"),
    # (try_end),
    # (display_message, s1),


    (gt, ":item_no", 0),
    (assign, ":swap_no", 0),

    #here we assume a weapon with alternate mode has been found already - it is rare that two item types will be equipped that can be swapped with different damage modes
    (try_begin), #make use of the other item slots
      (eq, ":eek:rder_no", mordr_use_any_weapon), #just plain swapping
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
      (gt, ":swap_no", 1),
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no", 0),
      # (store_mission_timer_a, ":timer_a"),
      # (val_add, ":timer_a", 1000),
      # (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":timer_a"),
    (else_try),
      (eq, ":eek:rder_no", mordr_use_blunt_weapons), #switching to blunt modes only
      (neg|item_slot_ge, ":item_no", slot_item_swing_damage, 513), #not already holding blunt
      #check inventory to see if weapon can be toggled
      (assign, ":end", ek_head),
      # (str_store_agent_name, s10, ":agent_no"),
      # (assign, reg10, ":agent_no"),
      # (str_store_string, s10, "@{reg10}={s10}:blunt"),
      (try_for_range, ":item_slot", ek_item_0, ":end"),
        (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
        (gt, ":item_id", 0),

        (item_get_type, ":item_itp", ":item_id"),
        (is_between, ":item_itp", itp_type_one_handed_wpn, itp_type_arrows),
        (neg|item_slot_ge, ":item_id", slot_item_swing_damage, 513), #let engine set wielded
        # (str_store_item_name, s1, ":item_id"),
        # (item_get_slot, reg9, ":item_id", slot_item_swing_damage),
        # (str_store_string, s10, "@{s10},checking {s1} with {reg9} dmg"),
        (item_get_slot, ":swap_id", ":item_id", slot_item_alternate),
        (gt, ":swap_id", 1),
        # (str_store_string, s10, "@{s10} and alt"),

        (try_begin),
          # (item_get_slot, ":damage", ":swap_id", slot_item_swing_damage),
          # (gt, ":damage", 512),
          (item_slot_ge, ":swap_id", slot_item_swing_damage, 513),
          (item_get_slot, ":damage", ":item_id", slot_item_thrust_damage),
          (this_or_next|eq, ":damage", 0), #no thrust capability
          (this_or_next|eq, ":damage", 256), #defined as (0, flag)
          (gt, ":damage", 512),

          # (assign, ":item_no", ":item_id"),
          (assign, ":end", -1),
          (agent_unequip_item, ":agent_no", ":item_id"),
          (agent_equip_item, ":agent_no", ":swap_id"),
          (agent_force_rethink, ":agent_no"),
        (try_end),
      (try_end),
      # (try_begin),
        # (eq, ":end", ek_head),
        # (assign, ":swap_no", -1),
        # (assign, ":item_no", -1),
        # (assign, ":color", 0xFF0000),
        # (display_message, "@{reg10}: switch to nothing", ":color"),
      # (else_try),
        # (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
        # (assign, ":color", 0x00FF00),
        # (str_store_item_name, s2, ":swap_no"),
        # (display_message, "@{reg10}: switch to {s2}", ":color"),
      # (try_end),
    # (else_try), #exclude them
      # (assign, ":swap_no", 0),
    (try_end),
    # (gt, ":item_no", 0),
    # (gt, ":swap_no", 0),
    # (agent_unequip_item, ":agent_no", ":item_no"),
    # (agent_unequip_item, ":agent_no", ":swap_no"),
    # (agent_equip_item, ":agent_no", ":swap_no"),
    # #(agent_set_wielded_item, ":agent_no", ":swap_no"),
    # (str_store_item_name, s3, ":item_no"),
    # (str_store_item_name, s2, ":swap_no"),
    # (str_store_agent_name, s1, ":agent_no"),
    # (display_message, "@{reg10}:{s1} switching to {s2} from {s3}", ":color"),
    # (agent_force_rethink, ":agent_no"),
  (try_end),
  ]
)
common_ai_sanity_check = (
  ti_on_item_wielded, 0, 0, [
  (store_trigger_param_2, ":item_no"),
  (eq, ":item_no", 0),
  ],
  [
  (store_trigger_param_1, ":agent_no"),
  # (str_store_agent_name, s11, ":agent_no"),
  # (assign, reg11, ":agent_no"),
  # (str_store_string, s11, "@{reg11}+{s11}"),
  # (try_for_range, ":item_slot", 0, ek_head),
    # (agent_get_item_slot, reg11, ":agent_no", ":item_slot"),
    # (str_store_string, s11, "@{s11}; {reg11}"),
  # (try_end),
  # (display_message, s11),
  (agent_unequip_item, ":agent_no", 0),
  (agent_force_rethink, ":agent_no"),

  ]
)
common_ai_random_toggle = (1, 0, 0,
  [],
  [
    (store_mission_timer_a, ":timer_a"),
    (try_for_agents, ":agent_no"),
      (assign, ":swap_no", -1),
      #check valid agent candidates
      (agent_is_active, ":agent_no"),
      (agent_is_human, ":agent_no"),
      (agent_is_non_player, ":agent_no"),
      (agent_is_alive, ":agent_no"),
      (agent_get_combat_state, ":cs", ":agent_no"),
      (this_or_next|eq, ":cs", 0), #cs_free
      (this_or_next|eq, ":cs", 7), #cs_still
      (eq, ":cs", 3), #cs_wield

      (agent_get_team, ":agent_team", ":agent_no"),
      (agent_get_class, ":agent_class", ":agent_no"),
      #should probably cache this inside team slots
      (team_get_weapon_usage_order, ":eek:rder_no", ":agent_team",  ":agent_class"),
      (neq, ":eek:rder_no", wordr_use_blunt_weapons),
      #check validity of weapon
      (agent_get_wielded_item, ":item_no", ":agent_no", 0),
      (gt, ":item_no", 1),
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),

      (gt, ":swap_no", 1),
      (item_get_type, ":itp", ":item_no"),
      (is_between, ":itp", itp_type_one_handed_wpn, itp_type_arrows),
      #weapon mastery increases chance of toggling
      (agent_get_troop_id, ":troop_no", ":agent_no"),
      (store_skill_level, ":skill", "skl_weapon_master", ":troop_no"),
      (store_random_in_range, ":random_no", 0, 100),

      #most native troops do NOT have weapon mastery - adjust as needed
      (ge, ":skill", ":random_no"),

      (store_mission_timer_a, ":timer_a"),
      #check timing
      (agent_get_slot, ":last_switched", ":agent_no", slot_agent_last_weapon_toggled),
      (lt, ":last_switched", ":timer_a"),

      (store_sub, ":wpt", ":itp", 2),
      (store_proficiency_level, ":prof", ":troop_no", ":wpt"),
      (assign, reg9, ":prof"),
      #proficiency decreases time between toggle
      (val_mul, ":random_no", :cool:, #from 0 to 160
      (val_add, ":random_no", 1600), #delay
      (store_sub, ":prof", ":random_no", ":prof"), #between 1500 to 600 usually
      (val_div, ":prof", 80), #between 12s to 7.5s

      #store timing
      (store_add, ":last_switched", ":timer_a", ":prof"),
      (agent_set_slot, ":agent_no", slot_agent_last_weapon_toggled, ":last_switched"),

      #actual switching
      (agent_unequip_item, ":agent_no", ":item_no"),
      (agent_equip_item, ":agent_no", ":swap_no"),
      (agent_set_wielded_item, ":agent_no", ":swap_no"),

      # (assign, reg10, ":last_switched"),
      # (str_store_item_name, s3, ":item_no"),
      # (str_store_item_name, s2, ":swap_no"),
      # (str_store_agent_name, s1, ":agent_no"),
      # (display_message, "@{reg10}:{s1} with {reg9} wpx switching to {s2} from {s3}"),
    (try_end),
  ]
)
common_player_toggle = (0,0,1, [
        (neg|main_hero_fallen),
        (game_key_clicked, gk_toggle_weapon_mode),
        (get_player_agent_no, "$g_player_agent"),
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (gt, ":item", 0),
        (item_slot_ge, ":item", slot_item_alternate, 1),
      ],
      #side effects may include cleaning the weapon automatically, improper carry positions, and items not corresponding to stats when switched between trigger checks using native behaviour
      [
        (agent_get_wielded_item, ":item", "$g_player_agent", 0),
        (item_get_slot, ":alternate", ":item", slot_item_alternate),
        (gt, ":alternate", 1),
        (agent_unequip_item, "$g_player_agent", ":alternate"),
        (agent_unequip_item, "$g_player_agent", ":item"),
        (agent_equip_item, "$g_player_agent", ":alternate"),
        (agent_set_wielded_item, "$g_player_agent", ":alternate"),
      ],
    )
common_wpn_swapping = [common_ai_order_toggle,common_ai_sanity_check,common_ai_random_toggle,common_player_toggle]


# Somebody's Alternate END

 
 

common_battle_order_panel = (
  0, 0, 0, [],
  [
    (game_key_clicked, gk_view_orders),
    ##diplomacy begin
    (neg|main_hero_fallen),
    ##diplomacy end
    (neg|is_presentation_active, "prsnt_battle"),
    (start_presentation, "prsnt_battle"),
    ])

common_battle_order_panel_tick = (
  0.1, 0, 0, [],
  [
    (is_presentation_active, "prsnt_battle"),
    (call_script, "script_update_order_panel_statistics_and_map"),
    ])

common_battle_inventory = (
  ti_inventory_key_pressed, 0, 0, [],
  [
    (display_message,"str_use_baggage_for_inventory"),
    ])

common_inventory_not_available = (
  ti_inventory_key_pressed, 0, 0,
  [
    (display_message, "str_cant_use_inventory_now"),
    ], [])

common_siege_init_ai_and_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_siege_init_ai_and_belfry"),
    ], [])

common_siege_move_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_move_belfry"),
    ], [])

common_siege_rotate_belfry = (
  0, 2, ti_once,
  [
    (call_script, "script_cf_siege_rotate_belfry_platform"),
    ],
  [
    (assign, "$belfry_positioned", 3),
    ])

common_siege_assign_men_to_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_assign_men_to_belfry"),
    ], [])

# Somebody's Alternate Weapon Modes
common_player_weapon_toggle = (0,0,1, [
    (neg|main_hero_fallen),
    (game_key_clicked, gk_toggle_weapon_mode),
    (get_player_agent_no, ":player_agent"),
    (agent_get_wielded_item, ":item", ":player_agent", 0),
    (gt, ":item", 0),
    (item_slot_ge, ":item", slot_item_alternate, 1),
  ],
  [
    (get_player_agent_no, ":player_agent"),
    (agent_get_wielded_item, ":item", ":player_agent", 0),
    (item_get_slot, ":alternate", ":item", slot_item_alternate),
    (gt, ":alternate", 1),
    (agent_unequip_item, ":player_agent", ":item"),
    (agent_equip_item, ":player_agent", ":alternate"),
    (agent_set_wielded_item, ":player_agent", ":alternate"),
  ],
)
common_ai_order_toggle = (ti_on_order_issued, 0, 0, [
  (store_trigger_param_1, ":eek:rder_no"),
  (this_or_next|eq, ":eek:rder_no", mordr_use_any_weapon),
  (eq, ":eek:rder_no", mordr_use_blunt_weapons),
  ],
[
  (store_trigger_param_1, ":eek:rder_no"),
  (store_trigger_param_2, ":agent_id"), #probably the player
  (agent_get_team, ":team_id", ":agent_id"),
 
  (try_for_agents, ":agent_no"),
    (agent_is_active, ":agent_no"),
    (agent_is_human, ":agent_no"),
    (agent_is_non_player, ":agent_no"),
    (agent_is_alive, ":agent_no"),
    (agent_get_team, ":team_no", ":agent_no"),
    (eq, ":team_no", ":team_id"),
    (agent_get_class, ":class_no", ":agent_no"),
    (class_is_listening_order, ":team_no", ":class_no"),
    (agent_get_wielded_item, ":item_no", ":agent_no", 0),
    (try_begin), #could be using fists
      (gt, ":item_no", 0),
      (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
    (else_try),
      (assign, ":swap_no", 0),
    (try_end),
   
    (try_begin), #none found on wielded item
      (eq, ":swap_no", 0), #
      (assign, ":end", ek_head),
      (try_for_range, ":item_slot", ek_item_0, ":end"),
        (agent_get_item_slot, ":item_no", ":agent_no", ":item_slot"),
        (gt, ":item_no", 0),
        (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
        (gt, ":swap_no", 0),
        (assign, ":end", -1),
      (try_end),
    (try_end),
    (gt, ":swap_no", 0),
    (try_begin), #make use of the other item slots
      (eq, ":eek:rder_no", mordr_use_any_weapon), #too lazy to re-set, just plain swapping
    (else_try),
      (eq, ":eek:rder_no", mordr_use_blunt_weapons), #switching to blunt modes only
      #check inventory to see if weapon can be toggled
      (try_begin),
       
        (try_for_range, ":item_slot", ek_item_0, ":end"),
          (agent_get_item_slot, ":item_id", ":agent_no", ":item_slot"),
          (this_or_next|eq, ":item_id", "itm_hammer_alt"),
          (this_or_next|eq, ":item_id", "itm_military_hammer_alt"),
          (this_or_next|eq, ":item_id", "itm_bec_de_corbin"),
          (this_or_next|eq, ":item_id", "itm_pickaxe"),
          (is_between, ":item_id", "itm_fighting_pick", "itm_morningstar"),
          (assign, ":item_no", ":item_id"),
          (assign, ":end", ek_item_0),
          (item_get_slot, ":swap_no", ":item_no", slot_item_alternate),
         
        (try_end),
      (try_end),
      #these are piercing weapons
      (this_or_next|eq, ":item_no", "itm_hammer_alt"),
      (this_or_next|eq, ":item_no", "itm_military_hammer_alt"),
      (this_or_next|eq, ":item_no", "itm_bec_de_corbin"),
      (this_or_next|eq, ":item_no", "itm_pickaxe"),
      (is_between, ":item_no", "itm_fighting_pick", "itm_morningstar"),
    (else_try), #exclude them
      (assign, ":swap_no", 0),
    (try_end),
    (gt, ":swap_no", 0),
    (agent_unequip_item, ":agent_no", ":item_no"),
    (agent_equip_item, ":agent_no", ":swap_no"),
    (agent_set_wielded_item, ":agent_no", ":swap_no"),
  (try_end),
])
# Somebody's Alternate Weapon Modes END
 
 
tournament_triggers = [
 

Somebody

Code Pope
Baron
WBWF&S
Best answers
1
Now makes sure you actually include common_wpn_swapping in whatever mission template you want weapon switching to be enabled in.
 

GunFred

Squire
Best answers
0
Good news! It works for me now!  :grin:
I made it a little easier for me for now by adding it to a Diplomacy trigger which means it will work in most combat areas. I should be able to tweak things now or later to work in all areas and with new weapons.
dplmc_battle_mode_triggers = [
    dplmc_horse_speed,
    dplmc_death_camera,
horses_spook,
oliphant_init,
oliphant_damage,
common_ai_order_toggle,
common_ai_sanity_check,
common_ai_random_toggle,
common_player_toggle,
  ]
Thanks a lot for your help, your stuff is great as always. I wish though it had not taken so much of your effort and time to help me. But hopefully others of lesser experience and knowledge like myself should have higher chance of implementing this feature into their mods now.
 

TheMasteroDeath

Regular
Best answers
0
Yes I'm an idiot, but I'm getting this error:

SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\Ali\Desktop\Warband modding\Module_system 1.171\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Ali\Desktop\Warband modding\Module_system 1.171\module_scripts.py", line 1492
    (item_set_slot, "itm_bastard_sword_b", slot_item_alternate "greatsword_flipped")

And I have no Idea what do do with it. I am extremely new to modding and I defenitely need some help..