Quote from Bug Thread[]
SCRIPT ERROR ON OPCODE 2322: Invalid Troop ID: -1; LINE NO: 52:
At script: generate_extended_troop_relation_information_string.
At script: generate_extended_troop_relation_information_string.
At script: generate_extended_troop_relation_information_string.
SCRIPT ERROR ON OPCODE 520: Invalid Troop ID: -1; LINE NO: 1:
At script: troop_get_player_relation.
At script: troop_get_player_relation.
SCRIPT ERROR ON OPCODE 520: Invalid Troop ID: -1; LINE NO: 2:
At script: troop_get_player_relation.
At script: troop_get_player_relation.
Status[]
Brute force fix in place for 2.52
Didn't see why jrider's system would be returning troop IDs of -1 to test, so added a simple (ge, "$character_info_id", 0) to the presentation before it calls troop-specific scripts. Caba 22:21, April 4, 2012 (UTC)
Update[]
A conditional is needed to verify that the player has joined a faction, otherwise we will make it not show, avoiding Invalid Troop ID: -1.
In module_scripts, generate_extended_troop_relation_information_string
- replace this code
# Current liege and relation (faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader), (str_store_troop_name, s46, ":liege"), (try_begin), (eq, ":liege", ":troop_no"), (assign, reg46, 0), (else_try), (assign, reg46, ":liege"), (str_clear, s47), (str_clear, s60), # Relation to liege (call_script, "script_get_troop_relation_to_player_string", s47, ":liege"), (end_try),
- for this
# Current liege and relation (try_begin), (is_between, "$players_kingdom", kingdoms_begin, kingdoms_end), (faction_slot_eq, "$players_kingdom", slot_faction_state, sfs_active), #conditions end (try_begin), (faction_get_slot, ":liege", "$players_kingdom", slot_faction_leader), (str_store_troop_name, s46, ":liege"), (try_begin), (eq, ":liege", ":troop_no"), (assign, reg46, 0), (else_try), (assign, reg46, ":liege"), (str_clear, s47), (str_clear, s60), # Relation to liege (call_script, "script_get_troop_relation_to_player_string", s47, ":liege"), (try_end), (try_end), (try_end),
DjFRedy (talk) 08:32, July 4, 2018 (UTC)