Opcode 1718 invalid Agent ID

Users who are viewing this thread

Hello, I have this red code that appears when I start a new game, can you help me to solve this problem? thank you.
Mount&Blade Warband 1174
WSE Lua
Module: Warband Explorer.

Code:
SCRIPT WARNING ON OPCODE 1718: Invalid Agent ID: 4009; LINE NO: 1
At mission Template mst_town trigger no:3 consequences.
At mission Template mst_town trigger no:3 consequences.



Mount&Blade Warband 1174
WSE Lua
Module: Warband Explorer.
 
Solution
This is the solution: (line 23 - 39) mission_template.py

Code:
kill_animal_agent =     (ti_on_agent_dismount, 0,0,[ #Kill animal invisible riders
    ],
    [
    (store_trigger_param_1, ":agent"),
    (agent_get_troop_id, ":troop", ":agent"),
    (is_between, ":troop", "trp_merchant_horse", "trp_musican_male"),
  (set_show_messages,0),
        # (set_show_messages,1),
        # (display_message, "@T11"),
    # (assign, "$kill_dismount", 1),
    # (store_trigger_param_1, "$pack_rider"),
    # (store_trigger_param_2, "$pack_animal"),
    (store_trigger_param_1, ":rider"),
  #  (store_trigger_param_2, ":animal"),
      (agent_deliver_damage_to_agent, ":rider", ":rider", 9999),
    (set_show_messages,1),
    ])
Look up in header_operations which operation is OPCODE 1718.
Here is the code of header_operations.py
Code:
agent_get_troop_id                       = 1718  # (agent_get_troop_id, <destination>, <agent_id>),
# Retrieves the troop type of the specified agent. Returns -1 for horses (because horses are items, not troops).

Code of mission_template.py

Code:
(ti_on_agent_dismount, 0,0,[ #Kill animal invisible riders
    (store_trigger_param_1, ":agent"),
    (agent_get_troop_id, ":troop", ":agent"),
    (is_between, ":troop", "trp_merchant_horse", "trp_musican_male"),
    ],
    [
    # (set_show_messages,1),
    # (display_message, "@T11"),
    (assign, "$kill_dismount", 1),
    (store_trigger_param_1, "$pack_rider"),
    (store_trigger_param_2, "$pack_animal"),
    ]),
Can you help me?
Thanks
 
Last edited:
Upvote 0
Consider adding checks whether the agent is a) active and b) alive before using the :agent variable you get as a trigger parameter.
I'm not sure how it would not be either of those considering it just called this trigger, but this is Warband sooo...
 
Upvote 0
This is the solution: (line 23 - 39) mission_template.py

Code:
kill_animal_agent =     (ti_on_agent_dismount, 0,0,[ #Kill animal invisible riders
    ],
    [
    (store_trigger_param_1, ":agent"),
    (agent_get_troop_id, ":troop", ":agent"),
    (is_between, ":troop", "trp_merchant_horse", "trp_musican_male"),
  (set_show_messages,0),
        # (set_show_messages,1),
        # (display_message, "@T11"),
    # (assign, "$kill_dismount", 1),
    # (store_trigger_param_1, "$pack_rider"),
    # (store_trigger_param_2, "$pack_animal"),
    (store_trigger_param_1, ":rider"),
  #  (store_trigger_param_2, ":animal"),
      (agent_deliver_damage_to_agent, ":rider", ":rider", 9999),
    (set_show_messages,1),
    ])
 
Upvote 0
Solution
Back
Top Bottom