8
« on: September 04, 2010, 08:18:00 pm »
I have an extremely annoying problem with a modification that I am working on. It seems to be an error with the "troop_get_upgrade_troop" operation. I am trying to use the 1st and 2nd nodes of that operation, but I do not get the proper return values. The string register is not given the correct value. I have tried outputting the register values at different key points in the game and I added new registers to avoid conflicts. All I can figure out is that it likes to store the 2nd node troop for the first node and then the first node is stored as my player name. If there is one node choice then I get the player name for both menu choices.
Here is the code that I narrowed the problem down to.
#excerpt from a script
(try_begin),
(eq, "$commander's_faction", fac_kingdom_1),
(assign, "$player_cur_troop", "trp_swadian_recruit"),
(else_try),
(eq, "$commander's_faction", fac_kingdom_2),
(assign, "$player_cur_troop", "trp_vaegir_recruit"),
(else_try),
(eq, "$commander's_faction", fac_kingdom_3),
(assign, "$player_cur_troop", "trp_khergit_tribesman"),
(else_try),
(eq, "$commander's_faction", fac_kingdom_4),
(assign, "$player_cur_troop", "trp_nord_recruit"),
(else_try),
(eq, "$commander's_faction", fac_kingdom_5),
(assign, "$player_cur_troop", "trp_rhodok_tribesman"),
(try_end),
#menu_upgrade_path
(
"upgrade_path",0,
"In recognition of your excellent service, you have been promoted.",
"none",
[
(troop_get_upgrade_troop, "$path_1", "$player_cur_troop", 1),
(troop_get_upgrade_troop, "$path_2", "$player_cur_troop", 2),
#string register to output troop name
(str_store_troop_name, s66, "$path_1"),
(str_store_troop_name, s67, "$path_2"),
],
[
("upgrade_path_1",[(neq, "$path_1", -1)],
"{s66}",
[
(assign, "$menu_upgrade_path_response", "$path_1"),
(call_script, "script_cf_event_player_promotion", "$menu_upgrade_path_response"),
(change_screen_map),
]),
("upgrade_path_2",[(neq, "$path_2", -1)],
"{s67}",
[
(assign, "$menu_upgrade_path_response", "$path_2"),
(call_script, "script_cf_event_player_promotion", "$menu_upgrade_path_response"),
(change_screen_map),
]),
]
),