Can faction re-emerge once I have destroyed them /the AI destroyed them?
and what is neccessary for them to re-emerge? low order in their capital regions? I could see myself maybe provoking them to re-emerge...
Can faction re-emerge once I have destroyed them /the AI destroyed them?
and what is neccessary for them to re-emerge? low order in their capital regions? I could see myself maybe provoking them to re-emerge...
"See, when you carry the two over, it turns out you owe me another hundred florins."
Yes, re-emergence (unlike hording) is forever. As long as there's unrest in those historically-important provinces, a "dead" faction can return.
I had a weird thing happen when an Epirote army re-emerged from Dyrrhachion (an independent held settlement at the time). Their army spawned, didn't siege Dyrrachion and just marched off, so I followed with a spy. Turns out they were heading to... I think it was Alexandreia Arachosias where they already held the settlement. Looking back in my saves, it seems that they held it ever since they re-emerged. Not sure how to think about that one.
The code is wonky, but unfixable. Sometimes on second and susequent re-emergences, the game chooses the Rebel settlement with the lowest order, regardless of where that is.
I have noticed something similar, as if the re emerging faction somehow "needs" at least one settlement to be considered a faction, so the AI gives it a rebel one. I doubt the same would happen to factions that can "horde", as in the game recognizes they can be settlement-less. Just speculation though.
Perhaps the way the script works could be changed. Instead of scripting an army from the faction directly, if it occured like a natural revolt, like adding a lot of unrest in a few turns, the rebels would emerge with less issues? Like, instead of telling the game you want faction X to appear there, just make it so the settlement has faction owner X, so naturally it should turn to that faction by having high unrest.
Yeah, both QS and b0gia, the original script creator, have tried many times to fix this bug, but to no avail. Essentially it seems to be a "like it or lump it" situation. I think the script adds too much nuance to a campaign to toss out at this point.
I spent a load of time on this subject:
http://www.twcenter.net/forums/showt...-not-shadowing
See the part 3 on false shadowing, and you will see you don't even need any spawn to make the faction_emerge work.
My research on beating the odds at any time, even at the extremes of 500% PO target settlement vs various 0% across the map:
http://www.twcenter.net/forums/showt...1#post15478199
It's probably not very well written, especially for novices on the matter, but it is working. I am soon gonna write a simpler addendum on 'how to do' for novices in my tutorial, (not that Quintus is one) when I am finish with tests on a other way to handle the chain of PO bonus, which are essential but can be a pain to handle in complex-multi ownership switching scripts. I think I found how to make it a lot less painful and complicated in the scripts.
The spawn is not the problem, the army always turns up where it was supposed to. The problem is the ownership of the settlement, which seems to be semi-random. Sometimes they get the one the script assigned to them, other times some other Rebel settlement halfway across the map.
Is this the script model used in EBII? I know things change as the development goes on and the post is two years old but I can't download the mod now.
http://www.twcenter.net/forums/showt...1#post14813416
If this is still roughly the same script model, then it's normal that the ownership switching get mix-up sometimes, as there is no proper use of the PO bonus building chain, or similar method, nor are there failsafes against potential good governors. Trying to not make a novel of words, here is one of my 'model', following the principles from the other links:
C_S:
EDCT, the hidden temporary trait to counter the possible presence of a too positive PO governor:Code:monitor_event CharacterTurnEnd if I_EventCounter parthia_emerge < 1 and I_TurnNumber >= 0 if I_EventCounter hekatompylos_parthia_switch < 1 and not I_SettlementOwner Hekatompylos = timurids and not I_SettlementUnderSiege Hekatompylos set_event_counter hekatompylos_parthia_switch 1 end_if end_if end_monitor monitor_event SettlementTurnEnd ;;;;; Parthian empire start if I_EventCounter parthia_emerge < 1 and I_TurnNumber >= 0 if I_EventCounter hekatompylos_parthia_switch > 0 set_event_counter ros_bonus 1 ;;;;OR console_command create_building Adiacium ros_po_bonusconsole_command create_building Agrigentum ros_po_bonus console_command create_building Aleksandreia ros_po_bonus ;;;; ect for each settlements, see notes below on using either the chain or one simple event_counter, achieving the same result. console_command create_building Hekatompylos ros_target if I_SettlementOwner Hekatompylos = england faction_emerge timurids england 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = france faction_emerge timurids france 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = aztecs faction_emerge timurids aztecs 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = hre faction_emerge timurids hre 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = spain faction_emerge timurids spain 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = romani faction_emerge timurids romani 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = sicily faction_emerge timurids sicily 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = milan faction_emerge timurids milan 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = byzantium faction_emerge timurids byzantium 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = russia faction_emerge timurids russia 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = moors faction_emerge timurids moors 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = turks faction_emerge timurids turks 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = egypt faction_emerge timurids egypt 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = denmark faction_emerge timurids denmark 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = poland faction_emerge timurids poland 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = mongols faction_emerge timurids mongols 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = normans faction_emerge timurids normans 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = saxons faction_emerge timurids saxons 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = ellenobaktrioi faction_emerge timurids ellenobaktrioi 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = iliret faction_emerge timurids iliret 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = carnaites faction_emerge timurids carnaites 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = aksum faction_emerge timurids aksum 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = skuoa faction_emerge timurids skuoa 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = sarumatah faction_emerge timurids sarumatah 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = akni faction_emerge timurids akni 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = portugal faction_emerge timurids portugal 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = papal_states faction_emerge timurids papal_states 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = scotland faction_emerge timurids scotland 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = hungary faction_emerge timurids hungary 1 500.0 0.0 1.2 town false end_if if I_SettlementOwner Hekatompylos = slave faction_emerge timurids slave 1 500.0 0.0 1.2 town false end_if ;;;;;;;ect, ect if I_SettlementOwner Hekatompylos = timurids destroy_buildings akni ros_temp_buildings false destroy_buildings england ros_temp_buildings false destroy_buildings france ros_temp_buildings false destroy_buildings sicily ros_temp_buildings false destroy_buildings milan ros_temp_buildings false destroy_buildings ellenobaktrioi ros_temp_buildings false destroy_buildings moors ros_temp_buildings false destroy_buildings portugal ros_temp_buildings false destroy_buildings spain ros_temp_buildings false destroy_buildings egypt ros_temp_buildings false destroy_buildings normans ros_temp_buildings false destroy_buildings sarumatah ros_temp_buildings false destroy_buildings byzantium ros_temp_buildings false destroy_buildings turks ros_temp_buildings false destroy_buildings iliret ros_temp_buildings false destroy_buildings romani ros_temp_buildings false destroy_buildings hre ros_temp_buildings false destroy_buildings aztecs ros_temp_buildings false destroy_buildings russia ros_temp_buildings false destroy_buildings poland ros_temp_buildings false destroy_buildings carnaites ros_temp_buildings false destroy_buildings papal_states ros_temp_buildings false destroy_buildings saxons ros_temp_buildings false destroy_buildings timurids ros_temp_buildings false destroy_buildings aksum ros_temp_buildings false destroy_buildings skuoa ros_temp_buildings false destroy_buildings mongols ros_temp_buildings false destroy_buildings denmark ros_temp_buildings false destroy_buildings scotland ros_temp_buildings false destroy_buildings hungary ros_temp_buildings false destroy_buildings slave ros_temp_buildings false set_event_counter ros_bonus 0 set_event_counter hekatompylos_parthia_switch 0 log always destroy test end_if end_if end_if
Then all you have to worry about is the possible remaining effect of a too powerful garrison. I reduced it to 0.5 max effect, half the vanilla value, which so far don't seem to have badly affected the balance of my mod but the said balance might depend on other values within the settlement_mechanics of course, and the general balance of bonus/malus from the mod buildings/characters traits, so there might be variables/debates on this particular point.Code:;------------------------------------------ Trait BadGovernorT Characters family Hidden Level BadGovernorT Description SummerCampaigning_desc EffectsDescription SummerCampaigning_effects_desc Threshold 1 Effect Law -5 Effect Unrest 50 Effect Squalor 40 Effect LocalPopularity -10 Effect Health -10 ;------------------------------------------ Trigger GiveBGTHekatompylosParthia WhenToTest CharacterTurnEnd Condition EndedInSettlement and SettlementName Hekatompylos and I_EventCounter hekatompylos_parthia_switch > 0 and Trait BadGovernorT < 1 Affects BadGovernorT 1 Chance 100 ;------------------------------------------ Trigger RemoveBGTHekatompylosParthia WhenToTest CharacterTurnStart Condition I_EventCounter hekatompylos_parthia_switch < 1 and Trait BadGovernorT > 0 Affects BadGovernorT -1 Chance 100
Still, with covering at least the two points of PO buildings bonus chain, and the governor hidden trait, ownership mix-up will already be much less frequent, if at all happening.
Notes on the building chain, alternatives:
I know that building the entire chain of ros_po_bonus each time is a big pain that push some to just ignore this essential aspect of targeting a specific settlement for the faction_emerge, but it's a mistake and the add_settlement_turmoil command is a very bad alternative, in my opinion.
My most recent way of dealing with the problem has been to use a non destroyable hinterland building, present from turn 0 in each settlement, and attributing it the capability of the ros_po_bonus:
Hence how a simple event_counter can replace the entire chain within the scripts, making things far less of a mess to read and organize for the scripter. This building have other effects and is also a gameplay building for me, the above is just a simpler example, so it can cumulate roles and take the technical place of the ros_po_bonus when needed. I guess that depending on the mod start, whether there is village or not, or if every settlements have a level of roads/farms, or other existing hinterland, these buildings or the settlements core walls could be use instead of a new building for example.Code:building hinterland_mercenary { levels mercenary_camp { mercenary_camp requires factions { northern_european, mesoamerican, middle_eastern, eastern_european, greek, roman, southern_european, } { capability { law_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target population_health_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target happiness_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target } material stone construction 1 cost 10000 settlement_min village upgrades { } } } plugins { } }
I am still testing a other alternative, which is to write the entire chain of ros_po_bonus only once in the monitor, but it has at least one flaw that I can't overcome so far. Ah, and a final note, when you destroy the ros_temp_buildings, if you created the chain of ros_po_bonus, then you would better destroy them twice, which is a other inconvenience for the scripter.
It was very important for my various uses of faction_emerge to remove any uncertainty from the ownership switching, and making it flexible to the point of changing half the map state in one turn if necessary, which is why I became a little crazy with it, but I am not sure for what purposes you guys use it, beside re-emergence, so feel free to ignore my advices if it take too much extra work or the like.
This little explanation will still help me to improve my tutorial later.
edit, forgot, I didn't include any extra spaw_army since I don't need them with my shadowing slave method
Last edited by selv; June 13, 2018 at 11:03 AM.
It's moved on quite a bit since then:
Spoiler Alert, click show to read:
We're only using it for faction re-emergence, no shadowing or anything else (we don't have faction slots available for that).
There is no need for extra factions slots in order to make the false shadowing work, all you need is a 'shadowing slave' after the factions names in descr_sm_factions:
faction england, shadowing slave
The only things that change are that you don't get normal destroyed faction event messages anymore, instead you get those from event_titles and event_strings:
{shadow_faction_appears}
{shadow_faction_destroyed}
All it takes is changing the external texts to something suitable enough. There is no other effect of shadowing, since the special slave don't revolt or riot on itself.
And I really feel that it make the all processing of faction_emerge easier, however I gave a try at rewritting your script, without being able to test on your mod:
I really need to learn how to make the writting red or something one day, you would see my changes and comments more clearly...Code:monitor_event SettlementTurnStart IsSettlementRioting and SettlementName sett_040 and I_NumberOfSettlements f_rome < 1 and I_IsFactionAIControlled f_rome and not I_SettlementUnderSiege sett_040 inc_counter f_rome_emerge 1 set_counter f_rome_building 0 end_monitor ;;;;;; I changed the monitor to a SettlementTurnStart with IsSettlementRioting here, so that the triggers in EDCT for the bad governor hidden trait can fire, because CityRiots happen after the CharacterTurnEnd monitor_event FactionTurnEnd FactionType slave if I_CompareCounter f_rome_emerge > 1 console_command create_building sett_01 ros_po_bonus console_command create_building sett_02 ros_po_bonus console_command create_building sett_03 ros_po_bonus ;;;;ect console_command create_building sett_040 ros_po_bonus ;;;;;ect console_command create_building sett_199 ros_po_bonus console_command create_building sett_040 ros_target set_counter sett_040_riot 1 ;;;;; Don't finish this first if block with a end_if, save it for the end of the rome emerge script if I_EventCounter ecCamillanEra > 0 spawn_army faction f_rome character random_name, named character, age 30, x 128, y 163, family traits NaturalIntelligence 4 , NaturalCharisma 4 , NaturalEnergy 5 , Temperament 2 , Selflessness 4 , LoyaltyLevel 4 , Plebeian 1 , RomanMilitaryService 3 , RomanRank 3 , MilitaryTribune 2 , PlebeianTribune 2 , PlebeianAedile 3 , GoodLeader 1 , PoliticsSkill 2 , GoodAdministrator 3 , CommandExperience 2 , GensAtilia 2 , AtilivsRegvlvs 1 , EthnoDetermined 1 , Nobile 1 unit roman cavalry equites consulares exp 4 armour 0 weapon_lvl 0 unit roman cavalry equites camillan exp 0 armour 0 weapon_lvl 0 unit italic cavalry sabellian exp 1 armour 0 weapon_lvl 0 unit roman infantry triarii camillan exp 1 armour 0 weapon_lvl 0 unit roman infantry triarii camillan exp 0 armour 0 weapon_lvl 0 unit roman infantry principes camillan exp 1 armour 0 weapon_lvl 0 unit roman infantry principes camillan exp 0 armour 0 weapon_lvl 0 unit roman infantry principes camillan exp 0 armour 0 weapon_lvl 0 unit roman infantry hastati camillan exp 1 armour 0 weapon_lvl 0 unit roman infantry hastati camillan exp 0 armour 0 weapon_lvl 0 unit roman infantry hastati camillan exp 0 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 1 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 0 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 1 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 0 armour 0 weapon_lvl 0 unit italic infantry etruscan exp 1 armour 0 weapon_lvl 0 unit italic infantry etruscan exp 0 armour 0 weapon_lvl 0 unit roman infantry leves exp 1 armour 0 weapon_lvl 0 unit roman infantry leves exp 0 armour 0 weapon_lvl 0 unit roman infantry leves exp 0 armour 0 weapon_lvl 0 end inc_counter unitlimit_f_rome 20 end_if if I_EventCounter ecPolybianEra > 0 spawn_army faction f_rome character random_name, named character, age 30, x 128, y 163, family traits NaturalIntelligence 4 , NaturalCharisma 4 , NaturalEnergy 5 , Temperament 2 , Selflessness 4 , LoyaltyLevel 4 , Plebeian 1 , RomanMilitaryService 3 , RomanRank 3 , MilitaryTribune 2 , PlebeianTribune 2 , PlebeianAedile 3 , GoodLeader 1 , PoliticsSkill 2 , GoodAdministrator 3 , CommandExperience 2 , GensAtilia 2 , AtilivsRegvlvs 1 , EthnoDetermined 1 , Nobile 1 unit roman cavalry equites consulares exp 4 armour 0 weapon_lvl 0 unit roman cavalry equites polybian exp 0 armour 0 weapon_lvl 0 unit italic cavalry sabellian exp 1 armour 0 weapon_lvl 0 unit roman infantry triarii polybian exp 1 armour 0 weapon_lvl 0 unit roman infantry triarii polybian exp 0 armour 0 weapon_lvl 0 unit roman infantry principes polybian exp 1 armour 0 weapon_lvl 0 unit roman infantry principes polybian exp 0 armour 0 weapon_lvl 0 unit roman infantry principes polybian exp 0 armour 0 weapon_lvl 0 unit roman infantry hastati polybian exp 1 armour 0 weapon_lvl 0 unit roman infantry hastati polybian exp 0 armour 0 weapon_lvl 0 unit roman infantry hastati polybian exp 0 armour 0 weapon_lvl 0 unit italic infantry cohors sociorum exp 0 armour 0 weapon_lvl 0 unit italic infantry cohors sociorum exp 0 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 1 armour 0 weapon_lvl 0 unit italic infantry samnites spearmen exp 0 armour 0 weapon_lvl 0 unit italic infantry etruscan exp 1 armour 0 weapon_lvl 0 unit italic infantry etruscan exp 0 armour 0 weapon_lvl 0 unit roman infantry velites exp 1 armour 0 weapon_lvl 0 unit roman infantry velites exp 0 armour 0 weapon_lvl 0 unit hellenistic infantry sphendonitai exp 1 armour 0 weapon_lvl 0 end inc_counter unitlimit_f_rome 20 end_if if I_EventCounter ecMarianEra > 0 spawn_army faction f_rome character random_name, named character, age 30, x 128, y 163, family traits NaturalIntelligence 4 , NaturalCharisma 4 , NaturalEnergy 5 , Temperament 2 , Selflessness 4 , LoyaltyLevel 4 , Plebeian 1 , RomanMilitaryService 3 , RomanRank 3 , MilitaryTribune 2 , PlebeianTribune 2 , PlebeianAedile 3 , GoodLeader 1 , PoliticsSkill 2 , GoodAdministrator 3 , CommandExperience 2 , GensAtilia 2 , AtilivsRegvlvs 1 , EthnoDetermined 1 , Nobile 1 unit roman cavalry equites consulares exp 4 armour 0 weapon_lvl 0 unit roman cavalry equites polybian exp 0 armour 0 weapon_lvl 0 unit roman cavalry equites auxilium exp 1 armour 0 weapon_lvl 0 unit roman infantry cohors evocatae exp 1 armour 0 weapon_lvl 0 unit roman infantry cohors evocatae exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors evocatae exp 1 armour 0 weapon_lvl 0 unit roman infantry reformata first exp 0 armour 0 weapon_lvl 0 unit roman infantry reformata first exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 1 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 1 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 1 armour 0 weapon_lvl 0 unit roman infantry cohors reformata exp 0 armour 0 weapon_lvl 0 unit roman infantry antesignani exp 1 armour 0 weapon_lvl 0 unit roman infantry antesignani exp 0 armour 0 weapon_lvl 0 unit roman infantry antesignani exp 1 armour 0 weapon_lvl 0 end inc_counter unitlimit_f_rome 20 end_if if I_SettlementOwner sett_040 = f_pergamon faction_emerge f_rome f_pergamon 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_carthage faction_emerge f_rome f_carthage 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_makedonia faction_emerge f_rome f_makedonia 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_epeiros faction_emerge f_rome f_epeiros 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_kh faction_emerge f_rome f_kh 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_seleukid faction_emerge f_rome f_seleukid 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_ptolemaioi faction_emerge f_rome f_ptolemaioi 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_baktria faction_emerge f_rome f_baktria 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_hayasdan faction_emerge f_rome f_hayasdan 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_parthia faction_emerge f_rome f_parthia 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_aedui faction_emerge f_rome f_aedui 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_arverni faction_emerge f_rome f_arverni 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_casse faction_emerge f_rome f_casse 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_lusotannan faction_emerge f_rome f_lusotannan 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_sweboz faction_emerge f_rome f_sweboz 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_getai faction_emerge f_rome f_getai 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_saba faction_emerge f_rome f_saba 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_saka faction_emerge f_rome f_saka 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_sauromatae faction_emerge f_rome f_sauromatae 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_numidia faction_emerge f_rome f_numidia 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_pontos faction_emerge f_rome f_pontos 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_gandhara faction_emerge f_rome f_gandhara 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_lugia faction_emerge f_rome f_lugia 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_bosporan faction_emerge f_rome f_bosporan 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_arevaci faction_emerge f_rome f_arevaci 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_boii faction_emerge f_rome f_boii 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = f_nabatu faction_emerge f_rome f_nabatu 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_SettlementOwner sett_040 = slave faction_emerge f_rome slave 1 400.0 0.0 1.2 town true unused_label1 unused_name 30 end_if if I_NumberOfSettlements f_rome > 0 ;;;;;; Destroy the ros_temp_buildings for all factions, too lazy to change my internal names to yours but you know the drill ;;;;;; For the romans or whatever factions just emerged, destroy the buildings twice, or you will likely have a leftover destroy_buildings akni ros_temp_buildings false destroy_buildings england ros_temp_buildings false destroy_buildings france ros_temp_buildings false destroy_buildings sicily ros_temp_buildings false destroy_buildings milan ros_temp_buildings false destroy_buildings ellenobaktrioi ros_temp_buildings false destroy_buildings moors ros_temp_buildings false destroy_buildings portugal ros_temp_buildings false destroy_buildings spain ros_temp_buildings false destroy_buildings egypt ros_temp_buildings false destroy_buildings normans ros_temp_buildings false destroy_buildings sarumatah ros_temp_buildings false destroy_buildings byzantium ros_temp_buildings false destroy_buildings turks ros_temp_buildings false destroy_buildings iliret ros_temp_buildings false destroy_buildings romani ros_temp_buildings false destroy_buildings romani ros_temp_buildings false destroy_buildings hre ros_temp_buildings false destroy_buildings aztecs ros_temp_buildings false destroy_buildings russia ros_temp_buildings false destroy_buildings poland ros_temp_buildings false destroy_buildings carnaites ros_temp_buildings false destroy_buildings papal_states ros_temp_buildings false destroy_buildings saxons ros_temp_buildings false destroy_buildings timurids ros_temp_buildings false destroy_buildings aksum ros_temp_buildings false destroy_buildings skuoa ros_temp_buildings false destroy_buildings mongols ros_temp_buildings false destroy_buildings denmark ros_temp_buildings false destroy_buildings scotland ros_temp_buildings false destroy_buildings hungary ros_temp_buildings false destroy_buildings slave ros_temp_buildings false historic_event HE_ROMANI_REBORN set_counter f_rome_emerge 0 set_counter sett_040_riot 0 add_money f_rome 40000 set_counter RomeAtPeace 0 set_counter f_rome_emerge_lt 0 wait 1;; why is there a wait here? destroy_buildings f_rome govallied true end_if ;;;;;;;;failsafe for destroying buildings in case of failures, I don't need it anymore but I am unsure of EB2 specifics ;;;;;;;;here you need the destroy_buildings command twice for each factions, if you use the full ros_po_bonus and not the event_counter shortcut if I_NumberOfSettlements f_rome < 1 destroy_buildings akni ros_temp_buildings false destroy_buildings akni ros_temp_buildings false destroy_buildings england ros_temp_buildings false destroy_buildings england ros_temp_buildings false destroy_buildings france ros_temp_buildings false destroy_buildings france ros_temp_buildings false destroy_buildings sicily ros_temp_buildings false destroy_buildings sicily ros_temp_buildings false destroy_buildings milan ros_temp_buildings false destroy_buildings milan ros_temp_buildings false destroy_buildings ellenobaktrioi ros_temp_buildings false destroy_buildings ellenobaktrioi ros_temp_buildings false destroy_buildings moors ros_temp_buildings false destroy_buildings moors ros_temp_buildings false destroy_buildings portugal ros_temp_buildings false destroy_buildings portugal ros_temp_buildings false destroy_buildings spain ros_temp_buildings false destroy_buildings spain ros_temp_buildings false destroy_buildings egypt ros_temp_buildings false destroy_buildings egypt ros_temp_buildings false destroy_buildings normans ros_temp_buildings false destroy_buildings normans ros_temp_buildings false destroy_buildings sarumatah ros_temp_buildings false destroy_buildings sarumatah ros_temp_buildings false destroy_buildings byzantium ros_temp_buildings false destroy_buildings byzantium ros_temp_buildings false destroy_buildings turks ros_temp_buildings false destroy_buildings turks ros_temp_buildings false destroy_buildings iliret ros_temp_buildings false destroy_buildings iliret ros_temp_buildings false destroy_buildings romani ros_temp_buildings false destroy_buildings romani ros_temp_buildings false destroy_buildings hre ros_temp_buildings false destroy_buildings hre ros_temp_buildings false destroy_buildings aztecs ros_temp_buildings false destroy_buildings aztecs ros_temp_buildings false destroy_buildings russia ros_temp_buildings false destroy_buildings russia ros_temp_buildings false destroy_buildings poland ros_temp_buildings false destroy_buildings poland ros_temp_buildings false destroy_buildings carnaites ros_temp_buildings false destroy_buildings carnaites ros_temp_buildings false destroy_buildings papal_states ros_temp_buildings false destroy_buildings papal_states ros_temp_buildings false destroy_buildings saxons ros_temp_buildings false destroy_buildings saxons ros_temp_buildings false destroy_buildings timurids ros_temp_buildings false destroy_buildings timurids ros_temp_buildings false destroy_buildings aksum ros_temp_buildings destroy_buildings aksum ros_temp_buildings destroy_buildings skuoa ros_temp_buildings false destroy_buildings skuoa ros_temp_buildings false destroy_buildings mongols ros_temp_buildings false destroy_buildings mongols ros_temp_buildings false destroy_buildings denmark ros_temp_buildings false destroy_buildings denmark ros_temp_buildings false destroy_buildings scotland ros_temp_buildings false destroy_buildings scotland ros_temp_buildings false destroy_buildings hungary ros_temp_buildings false destroy_buildings hungary ros_temp_buildings false destroy_buildings slave ros_temp_buildings false destroy_buildings slave ros_temp_buildings false end_if ;;;;;second end_if finishing the I_CompareCounter f_rome_emerge loop end_if ;;;;;Proceed with a other faction re_emerge script end_monitor
Anyway, you need to make use of the ros_bonus, not just the ros_target or you will always have big chances of a wrong settlement being transfered.
See my other example from the other post with the ros_bonus event_counter, and try to think of a gameplay permanent building in all settlements if you don't want to be forced to build/destroy a entire chain (twice in the case of the destroy part) of ros_po_bonus each time a emerge script must fire.
Then nailing the nail with the temporary bad governor hidden trait, and the garrison max value but this last one is less obvious maybe, depending on the mod and I can't say for EB2.
I don't see the need of calling the ros_po_bonus in the post PreFactionTurnStart? For me the artificial malus/bonus from before disapear as soon that the buildings are destroyed, or the ros_ bonus event_counter reseted.
Well, good luck if you decide it's worth to pursue. Let me know if you find me unclear on some points, it's always possible.
I can see the value in changing the monitor condition (to remove the sequencing gap), but why are you making a ros_po_bonus building in every settlement, then destroying them all? That seems a terribly inelegant method of doing it.
Because in the words of Withwnar:
ros_po_bonus is built in all settlements, including the Target Settlement. As a result they get a 100% boost to these three bonuses which translates to about a +250% PO bonus.
ros_target is built only in the Target Settlement. The "not building_present_min_level" conditions of ros_po_bonus mean that the Target Settlement will NOT get its bonuses. i.e. The Target Settlement has both buildings but the presence of ros_target prevents the bonuses of ros_po_bonus from happening there. Additionally, ros_target itself reduces public order by having -100% on these bonuses. This counters any of these bonuses that the settlement has from other buildings, governor traits, etc., dropping them to zero.
e.g. If a settlement has +150% PO including +30% from law/happiness/population_health then with ros_target it will drop it to +120%.
So by giving the Target Settlement this ros_target building its PO will/might drop a bit. All other settlements will get something like a +250% PO boost.
This should make the Target Settlement the one with the lowest PO in the faction.
(An alternative to using these "not building_present_min_level" conditions would be to simply NOT build ros_po_bonus in the Target Settlement. But this would add more script - potentially hundreds of lines - because each "build ros_po_bonus" call would need to be wrapped in an "if not target settlement" check.)
You need to to temporary boost up the PO of every settlement, just the time of the script in order to drastically reduce the chances of a other settlement, which isn't the target, happenning to have a lower PO than your target, as it seem to be happening to you.
However there is a other safe way, which I am converting my scripts to, now that I know it achieve the same result for sure, the one I pointed before so in my words:
I know that building the entire chain of ros_po_bonus each time is a big pain that push some to just ignore this essential aspect of targeting a specific settlement for the faction_emerge, but it's a mistake and the add_settlement_turmoil command is a very bad alternative, in my opinion.
My most recent way of dealing with the problem has been to use a non destroyable hinterland building, present from turn 0 in each settlement, and attributing it the capability of the ros_po_bonus:Code:building hinterland_mercenary { levels mercenary_camp { mercenary_camp requires factions { northern_european, mesoamerican, middle_eastern, eastern_european, greek, roman, southern_european, } { capability { law_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target population_health_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target happiness_bonus bonus 20 requires event_counter ros_bonus 1 and not building_present_min_level ros_temp_buildings ros_target } material stone construction 1 cost 10000 settlement_min village upgrades { } } } plugins { } }
Hence how a simple event_counter can replace the entire chain within the scripts, making things far less of a mess to read and organize for the scripter. This building have other effects and is also a gameplay building for me, the above is just a simpler example, so it can cumulate roles and take the technical place of the ros_po_bonus when needed. I guess that depending on the mod start, whether there is village or not, or if every settlements have a level of roads/farms, or other existing hinterland, these buildings or the settlements core walls could be use instead of a new building for example.
Then the script beginning simply become:
You then reset the event_counter ros_bonus or whatever you want to call it during the destroy phase/resetting counters ect, and you can spare yourself the double lines during the destroying since there is only the ros_target building to destroy. The point is you need a method, elegant or not to temporary boost up every settlements except your target.Code:if I_CompareCounter f_rome_emerge > 1 set_event_counter ros_bonus 1 console_command create_building sett_040 ros_target ;;;;move on
I find my new approach elegant enough for my mod, but for EB2, it depend on whether or not you can find a hinterland building with it's minimal level already built everywhere at turn 0, and which have a gameplay purpose fitting your mod, beside it's technical purpose of replacing the ros_po_bonus inelegant scripting chain.
And you have this, from Withwnar again:
The linked post 58 is the same I linked earlier on my ways to effectively remove even the slightest chance of the wrong settlement being targeted, but the all concept of using the faction_emerge in a so accurate way to target specific settlements already being a complex workaround in the first place, well you know how it is, there is no real 'easy' way, even more if you seek to beat all the odds anytime.Public Order : Wrong SettlementIf, despite all of the PO adjustments from the buildings, another settlement has a lower PO than our target settlement then that settlement will be transferred instead. The script handles that outcome - giving it back to the original owner - but its characters and units will now be standing outside. Not a game-breaking result but another faction could then walk in and take it before the player/AI can move them back in.
The likely cause of this is PO due to garrison. There is no way to counter this PO bonus with negative building bonuses.
A way to further reduce the target settlement's PO is via a governor trait that adds things like Squalor, Unrest, and perhaps negative LocalPopularity and Health. However, giving him the trait at the desired time could be tricky and it's possible that the settlement has no governor.
UPDATE: some ideas on garrison and governor are in post 58.
You might not use the same ways as me at the end, due to some EB2 specifics things or something else, but it might help you to think of other ways that suit you better maybe.
Last edited by selv; June 13, 2018 at 07:35 PM.
There's potential in using the province buildings (since there's one in every settlement, and they're indestructible) for the permanent, switch-on-able "ros_po_bonus" capability. It could be permanently on for Eremos, perhaps. If that's what it takes to stop the new settlement wandering, and it simplifies the script, that's to the good.
Combine that with changing the monitor condition to one closer to the riots, and that might just about do it.
Do they still need to shadow the slave faction?
Last edited by QuintusSertorius; June 14, 2018 at 05:26 AM.
Ah, the false shadowing... To be honest, any sort of faction_emerge use on a dead faction has been a living hell for me, until I discover that every 'normal' factions can safely shadow the slave, and my scripting life quite improved after that.
For your scripts, if they were bringing back dead factions without the false shadowing trick before, they should continue to do so after rewritting, I didn't change that much to your current script in my example.
But since there is some mystery to me in a re-emergence script working more than once when I try to not use my false shadowing trick, the only way I could be sure would be to try again without it, and, euh, well I don't want to go back in that hell of uncertitude, so to speak. Beside it save me the pain of having to spawn characters before the faction_emerge part.