+ Reply to Thread
Results 1 to 12 of 12

Thread: Setting up an event trigger based on Non-Core Provinces Owned

  1. #1

    Setting up an event trigger based on Non-Core Provinces Owned

    Hey all, I'm hoping to create a very simple mod that is a bit more difficult. The idea is that for every non-core province owned by the player's country, their max stability is reduced by one.

    For example, if I am playing England, an English event would be scripted that if I meet the conditions of owning 1 noncore province and have 3 stability, a -1 stability event will trigger.

    Is it possible to use that type of trigger?

  2. #2
    Digging around the event triggers, maybe the easiest way would be to use nationalism?

    Triggers:
    1. Player country owns
    2. nationalism = yes
    3. stability = 3

    Effect: -1 stability

    There would need to be a separate event for each province, but that wouldn't necessarily be hard to set up.

    The question would then be, is there a way to count provinces? The events above would prevent anyone from achieving 3 stability with a province that contains nationalism, but what about creating an event that prevents both 2 and 3 stability for a country owning two provinces with nationalism?

  3. #3
    One problem is that you can't use effects in triggered modifiers -- only modifiers. So stability = -1 won't work there. (very frustrating, I know...)

    But I'm sure this could be done in another way. But whenever I try and write a solution to someone's question like this, someone like dharper shows up and delivers a solution ten times as brilliant using a tenth of the code... So I'm gonna let him go first this time.

  4. #4
    General orwell's Avatar
    EU3 OwnerNapoleonic MarshalDeus Vult!Europa Universalis: RomeEuropa Universalis: Rome (Collectors Edition)
    Hearts of Iron 2: ArmageddonVictoria: RevolutionsEuropa Universalis III: In NomineRome: Vae VictisSupreme Ruler 2020
    Hearts of Iron IIIHeir to the ThroneMount & Blade: WarbandSemper FiVictoria 2
    Divine WindCrusader Kings IIFor the MotherlandVictoria II: A House DividedCrusader Kings II Holy Knight

    Join Date
    Sep 2006
    Location
    Washington
    Posts
    2,218
    Blog Entries
    8
    Could you explain why you want to institute a max stability at -1 per non-core province? Are you just trying to destabilize a country if they expand without justified reason to? Is there a way to forge cores? Do you want an extremely static map? It seems like this would really be a harmful policy that wouldn't limit anyone but maybe the player, I doubt the AI would ever understand this without a very large mass of AI scripting. If you want to penalize someone for expanding without justification, I'd suggest something instead along the lines of raising stability cost in every non-core province which I'm pretty sure you can achieve just editing the static modifiers. If you could explain WHY you want a cap on max stability I'd appreciate it, because I just can't see how it makes sense when you only have 7 levels.

    To count provinces I would suggest setting a flag for a counted province, a variable to count the province, and then a country event to set the modifier you want rather than going through triggered modifiers. Make sure to have a clean up event too so a flag doesn't get abandoned there when it serves no purpose.
    Even an ignorant, paranoid, cowardly, ugly, corrupt, unsociable, aristocratic thug can conquer large parts of the world, kill thousands of people and be celebrated as the saviour of the Republic.

  5. #5
    Sort of kind of back dharper's Avatar
    EU3 Collectors Edition OwnerNapoleonic MarshalEuropa Universalis: RomeVictoria: RevolutionsEuropa Universalis III: In Nomine
    EU3 CompleteRome: Vae VictisHearts of Iron IIISupreme Ruler 2020 GoldFor The Glory
    Heir to the ThroneSemper FiVictoria 2Divine WindCrusader Kings II
    Pride of NationsFor the MotherlandVictoria II: A House Divided

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    Quote Originally Posted by pigglet82 View Post
    But I'm sure this could be done in another way. But whenever I try and write a solution to someone's question like this, someone like dharper shows up and delivers a solution ten times as brilliant using a tenth of the code... So I'm gonna let him go first this time.
    I can't think of any easy way.

    The easiest way I can imagine is still pretty complicated. You'd take an event and have it fire every year or so for an AI country, with the following code:
    Code:
    any_country = { 
    	set_variable = { which = "occupied_provinces" value = 0 }
    	any_owned = { 
    		limit = { nationalism = 0.1 }
    		owner = { change_variable = { which = "occupied_provinces" value = 1 } }
    		}
    	}
    Then, you could have an event that would fire for any country based on their stability and this variable.

    If you wanted to have a similar effect, you could add "stability_investment = -1" to the effects of nationalism in static_modifiers (you might have to juggle this number around to get values you wanted); this would have the effect of making it harder to raise stability the more occupied provinces you had.

    A mod for EU3: In Nomine and EU3: Complete that enhances religion
    Religious Minorities - More Religions - Religious Fervor - New Graphics - Hundreds of Events and Decisions
    New In Nomine version released December 31, 2011 (less than a month ago)

    Still playing EU3: Complete? Get my Magna Mundi Platinum 2 bugfix for religion and the Sengoku.

    Honor of Lancaster: A Magna Mundi IV AAR (finished)




  6. #6
    Quote Originally Posted by orwell View Post
    Could you explain why you want to institute a max stability at -1 per non-core province? Are you just trying to destabilize a country if they expand without justified reason to? Is there a way to forge cores? Do you want an extremely static map? It seems like this would really be a harmful policy that wouldn't limit anyone but maybe the player, I doubt the AI would ever understand this without a very large mass of AI scripting. If you want to penalize someone for expanding without justification, I'd suggest something instead along the lines of raising stability cost in every non-core province which I'm pretty sure you can achieve just editing the static modifiers. If you could explain WHY you want a cap on max stability I'd appreciate it, because I just can't see how it makes sense when you only have 7 levels.

    To count provinces I would suggest setting a flag for a counted province, a variable to count the province, and then a country event to set the modifier you want rather than going through triggered modifiers. Make sure to have a clean up event too so a flag doesn't get abandoned there when it serves no purpose.
    The idea is that the event would only apply to the player, not the AI. I'd want to do this only because that would create a significant incentive not to quickly expand without imposing a house rule to never do so.

    I can also justify it somewhat--provinces are huge chunks of territory, and to conquer one would be destabilizing for quite some time in ways that a few rebels popping up really don't replicate.

  7. #7
    Quote Originally Posted by pigglet82 View Post
    One problem is that you can't use effects in triggered modifiers -- only modifiers. So stability = -1 won't work there. (very frustrating, I know...)

    But I'm sure this could be done in another way. But whenever I try and write a solution to someone's question like this, someone like dharper shows up and delivers a solution ten times as brilliant using a tenth of the code... So I'm gonna let him go first this time.
    Wow--I'm not sure I understand. This is the first time I've tried scripting an event with EU3, and though I've done so with prior paradox games, it has been years.

    I know there are going to be some errors here and there, but what would this event do:

    country_event = {

    id = 9999

    trigger = {
    Country = England
    Stability = 3
    Owns = 1234 [a province number]
    Province 1234, Nationalism = .1
    }

    title = "EVTNAME9999"
    desc = "EVTDESC9999"

    option = {
    name = "EVTOPTA9999" # Kiss Stability Goodbye
    ai_chance = { factor = 55 }
    stability = -1
    }
    option = {
    name = "EVTOPTB9999" # I bet you wish there was Op. B
    ai_chance = { factor = 45 }
    stability = -1
    }
    }

  8. #8
    Quote Originally Posted by dharper View Post
    I can't think of any easy way.

    The easiest way I can imagine is still pretty complicated. You'd take an event and have it fire every year or so for an AI country, with the following code:
    Code:
    any_country = { 
    	set_variable = { which = "occupied_provinces" value = 0 }
    	any_owned = { 
    		limit = { nationalism = 0.1 }
    		owner = { change_variable = { which = "occupied_provinces" value = 1 } }
    		}
    	}
    Then, you could have an event that would fire for any country based on their stability and this variable.

    If you wanted to have a similar effect, you could add "stability_investment = -1" to the effects of nationalism in static_modifiers (you might have to juggle this number around to get values you wanted); this would have the effect of making it harder to raise stability the more occupied provinces you had.
    The stability investment is a good idea, but I don't want to mess around with the static modifiers as they would also hit the AI countries.

  9. #9
    You know what I think I'll do, which might even be easier? Script a cheat that gives -1 stability and just play this way manually. I hate to ask this, but does anyone know where to find a guide on creating cheats? I've been looking around the forum and the wiki guide but can't find anything.

  10. #10
    Sort of kind of back dharper's Avatar
    EU3 Collectors Edition OwnerNapoleonic MarshalEuropa Universalis: RomeVictoria: RevolutionsEuropa Universalis III: In Nomine
    EU3 CompleteRome: Vae VictisHearts of Iron IIISupreme Ruler 2020 GoldFor The Glory
    Heir to the ThroneSemper FiVictoria 2Divine WindCrusader Kings II
    Pride of NationsFor the MotherlandVictoria II: A House Divided

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    Quote Originally Posted by Alfred Russel View Post
    I know there are going to be some errors here and there, but what would this event do:
    Try this instead, in the same spirit:

    country_event = {

    id = 9999

    trigger = {
    ai = no
    Stability = 3
    any_owned_province = { nationalism = 0.1 }
    }

    mean_time_to_happen = { months = 1 }

    title = "EVTNAME9999"
    desc = "EVTDESC9999"

    option = {
    name = "EVTOPTA9999" # Kiss Stability Goodbye
    ai_chance = { factor = 55 }
    stability = -1
    }
    option = {
    name = "EVTOPTB9999" # I bet you wish there was Op. B
    ai_chance = { factor = 45 }
    stability = -1
    }
    }

    A mod for EU3: In Nomine and EU3: Complete that enhances religion
    Religious Minorities - More Religions - Religious Fervor - New Graphics - Hundreds of Events and Decisions
    New In Nomine version released December 31, 2011 (less than a month ago)

    Still playing EU3: Complete? Get my Magna Mundi Platinum 2 bugfix for religion and the Sengoku.

    Honor of Lancaster: A Magna Mundi IV AAR (finished)




  11. #11
    Quote Originally Posted by dharper View Post
    Try this instead, in the same spirit:
    Thanks--so it looks like that is for any player controlled country only? (ai=no)

  12. #12
    Sort of kind of back dharper's Avatar
    EU3 Collectors Edition OwnerNapoleonic MarshalEuropa Universalis: RomeVictoria: RevolutionsEuropa Universalis III: In Nomine
    EU3 CompleteRome: Vae VictisHearts of Iron IIISupreme Ruler 2020 GoldFor The Glory
    Heir to the ThroneSemper FiVictoria 2Divine WindCrusader Kings II
    Pride of NationsFor the MotherlandVictoria II: A House Divided

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    Quote Originally Posted by Alfred Russel View Post
    Thanks--so it looks like that is for any player controlled country only? (ai=no)
    Yes, that's right.

    A mod for EU3: In Nomine and EU3: Complete that enhances religion
    Religious Minorities - More Religions - Religious Fervor - New Graphics - Hundreds of Events and Decisions
    New In Nomine version released December 31, 2011 (less than a month ago)

    Still playing EU3: Complete? Get my Magna Mundi Platinum 2 bugfix for religion and the Sengoku.

    Honor of Lancaster: A Magna Mundi IV AAR (finished)




+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts