rubik
Squire
Incidentally I found that when a NPC do as the commander in battles, you can export/import him/her just like the player in my MOD Custom Commander.
There is some code below to implement it in a menu, no need to enter a scene any more.
I just insert the menu option in the menu "camp_action", in fact you can insert it in any menu you like.
These two menus below can be added anywhere.
There is some code below to implement it in a menu, no need to enter a scene any more.
I just insert the menu option in the menu "camp_action", in fact you can insert it in any menu you like.
........................
........................
("action_read_book",[],"Select a book to read.",
[(jump_to_menu, "mnu_camp_action_read_book"),
]
),
#### export/import NPCs begin ####
("action_export_import",[],"Export/import NPCs.",
[
(jump_to_menu, "mnu_export_import_npcs"),
]
),
#### export/import NPCs end ####
("action_modify_banner",[(eq, "$cheat_mode", 1)],"Cheat: Modify your banner.",
[
(start_presentation, "prsnt_banner_selection"),
#(start_presentation, "prsnt_custom_banner"),
]
),
........................
........................
These two menus below can be added anywhere.
#### export/import NPCs begin ####
("export_import_npcs", mnf_enable_hot_keys,
"Please choose an NPC, then press key C to view and export/import this character.^^You choose {reg0?{s0}:none}.",
"none",
[
(assign, reg0, "$g_player_troop"),
(str_store_troop_name, s0, "$g_player_troop"),
],
[
("export_import_back",[],"Go back",
[
(assign, "$g_player_troop", "trp_player"),
(set_player_troop, "$g_player_troop"),
(jump_to_menu, "mnu_camp_action"),
]
),
]+[("export_import_npc"+str(x+1),
[
(store_add, ":dest_npc", "trp_npc1", x),
(str_store_troop_name, s0, ":dest_npc"),
], "{s0}",
[
(store_add, ":dest_npc", "trp_npc1", x),
(assign, "$g_player_troop", ":dest_npc"),
(set_player_troop, "$g_player_troop"),
]) for x in range(0, 8)]+[
("export_import_next",[],"Next page", [(jump_to_menu, "mnu_export_import_npcs_2")]),
]
),
("export_import_npcs_2", mnf_enable_hot_keys,
"Please choose an NPC, then press key C to view and export/import this character.^^You choose {reg0?{s0}:none}.",
"none",
[
(assign, reg0, "$g_player_troop"),
(str_store_troop_name, s0, "$g_player_troop"),
],
[
("export_import_prev",[],"Previous page", [(jump_to_menu, "mnu_export_import_npcs")]),
]+[("export_import_npc"+str(x+1),
[
(store_add, ":dest_npc", "trp_npc1", x),
(str_store_troop_name, s0, ":dest_npc"),
], "{s0}",
[
(store_add, ":dest_npc", "trp_npc1", x),
(assign, "$g_player_troop", ":dest_npc"),
(set_player_troop, "$g_player_troop"),
]) for x in range(8, 16)]
),
#### export/import NPCs end ####