Spawn_army will absolutely 're-emerge' a previously defeated faction. If the spawned army captures the target settlement, the faction will emerge. If you want, you can use auto-win to ensure the settlement is captured or perhaps only auto-win if the settlement is AI controlled. Or don't auto-win and only emerge if the spawned army wins the battle.
I do remember the Baron's Alliance script in Britannia. CA must have wanted the barons to emerge at the settlement with lowest public order. But it seems everyone in this thread is going to lengths to circumvent that behavior and get the faction to emerge at a specific location instead. Even with buildings and public order commands it's still not guaranteed and in fact not even likely to work for localized settlements (based on what has been said about SSHIP, etc.). So why not use spawn_army?
I don't know what script they were using in the Warhammer mod but the simple spawn_army script I'm talking about is not limited to a single faction any more than the faction_emerge script in the OP. In fact, a spawn_army script is significantly shorter and simpler. Using spawn_army does not require dead_until_emerged or anything else special in DS or horde tags in descr_sm_factions. You can use completely run of the mill DS and descr_sm_factions tags for the faction and they will emerge normally using spawn_army + capture settlement. Yes, the spawned army will need to capture a settlement before their turn or the faction won't survive (army goes rebel) but I don't see how that would put off players any more than the faction_emerge script where there isn't even a chance for a battle and the region is just given to the emerged faction outright.
Here is a test script to demonstrate what I mean by spawn_army + capture settlement.
Code:
declare_counter t_presses
monitor_event ShortcutTriggered ShortcutTriggered strat_ui test_button ;SHIFT + T shortcut to test effects
if I_CompareCounter t_presses == 1
spawn_army
faction milan
character random_name, named character, age 26, x 250, y 249, direction W, label rohan_reemergence_1
traits GoodManRace 1
unit Rohan Royal Spearmen exp 4 armour 0 weapon_lvl 1
unit Rohan Riders exp 2 armour 0 weapon_lvl 1
unit Rohan Medium Spearmen exp 1 armour 0 weapon_lvl 0
unit Rohan Militia Archers exp 0 armour 0 weapon_lvl 0
unit Rohan Riders exp 2 armour 0 weapon_lvl 1
unit Rohan Medium Spearmen exp 1 armour 0 weapon_lvl 0
unit Rohan Militia Archers exp 0 armour 0 weapon_lvl 0
unit Rohan Riders exp 2 armour 0 weapon_lvl 1
unit Rohan Medium Spearmen exp 1 armour 0 weapon_lvl 0
unit Rohan Militia Archers exp 0 armour 0 weapon_lvl 0
unit Rohan Riders exp 2 armour 0 weapon_lvl 1
unit Rohan Medium Spearmen exp 1 armour 0 weapon_lvl 0
unit Rohan Militia Archers exp 0 armour 0 weapon_lvl 0
unit Rohan Riders exp 2 armour 0 weapon_lvl 1
unit Rohan Medium Spearmen exp 1 armour 0 weapon_lvl 0
unit Rohan Militia Archers exp 0 armour 0 weapon_lvl 0
unit Westron Catapult exp 0 armour 0 weapon_lvl 0
end
console_command auto_win attacker
siege_settlement rohan_reemergence_1, Kings_Land, attack
terminate_monitor
end_if
if I_CompareCounter t_presses == 0
inc_counter t_presses 1
console_command surrender_regions milan
end_if
end_monitor
As you can see, the first time the shortcut is triggered, the faction is destroyed using surrender_regions. This is confirmed by the "Faction Destroyed" message and the rankings scroll showing all stats go to 0. Then, an arbitrary number of turns later, I can use the shortcut a second time to re-emerge the faction with spawn_army + capture settlement. The character does not need a specific name. The character does not need to be a family member (he will become one, as well as faction leader, when he spawns). The stats in the faction rankings scroll will jump up again from 0 and the faction will be very much alive henceforth. The emerged faction's AI works normally. The emerged faction retains all of the diplomacy it had before it was killed (although our mod has a script that sets all diplomacy to neutral when any faction dies to fix the dead faction diplomacy bug).
Here are the DS tags for this faction.
Code:
faction milan, balanced genghis
ai_label default
denari 10000
denari_kings_purse 1000
Nothing out of the ordinary. Here is the descr_sm_factions entry.
Code:
faction milan
culture northern_european
religion northmen
symbol models_strat/symbol_milan.CAS
rebel_symbol models_strat/symbol_rebels.CAS
primary_colour red 80, green 62, blue 0
secondary_colour red 193, green 193, blue 118
loading_logo loading_screen/symbols/symbol128_milan.tga
standard_index 11
logo_index FACTION_LOGO_MILAN
small_logo_index SMALL_FACTION_LOGO_MILAN
triumph_value 5
custom_battle_availability yes
can_sap no
prefers_naval_invasions no
can_have_princess no
has_family_tree yes
Not a horde. So, given that this faction emerges at a settlement of our choice without issue, what am I missing? Is there something in our mod that makes this work but isn't present in other mods? Or is there some other reason to use faction_emerge?