+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: Immigration events

  1. #1

    Immigration events

    These events are no longer being updated. To get the latest version download the latest version of Terra Nova here and copy the events from the mod/Terra Nova/events/TN Random.txt file.

    here is a event to give another reason/benefit to get to +3 stability and be peacefull while punishing your warmongering neighbors.

    This event is now inlcuded in my Variable mini-mod, you can find the link in my signature.

    if you do not use my variable system then you need to replace the dark green code with code that uses flags to allow the immigration to happen. If somebody fixes this so that it doesnt need my variable system please post it here so others can use it. if anyone wants to make a minimod of the VARiable system feel free, i can even host it and answer questions, if i ever get time ill do it myself.

    Any code in red is not needed and should not be used unless you know what it does or need it. for the sake of having a exact copy here of my functional event, i have posted it.

    if you use this event system in your mod please give me credit by mentioning me or my mod, thank you.

    Finaly, let me explain why the variable system is better for this event than normal flags. with this code, (if the variable system is set up right) any time a emmigration happens it gets loged into the VAR country 2 times. when a immigration happens it only uses 1/2 of those peasants and only reduces the VAR data by 1. this is a more dynamic method that ensures that the world population remains the same but only moves around while also ensuring that all the emmigrants do not go to the same country (unless only a few nations qaulify for Immigration).

    Code:
    #Emigration
    province_event = {
    
    	id = 17900
    
    	trigger = {
    		owner = {
    			NOT = { 
    				has_country_flag = Disable  #disables the event if player disabled custom events
    				has_country_flag = Emigration
    				stability = -2
    				religion = shinto  #prevents Japanese Sengoku mod interferance
    			}
    			war = yes
    		}
    		citysize = 12000
    	}
    	
    	mean_time_to_happen = {
    		months = 5000
    
    		modifier = {
    			factor = 1.2
    			owner = { luck = yes }
    		}
    		modifier = {
    			factor = 2.0
    			owner = { has_country_flag = Maintanence }   #keeps this event from spamming
    		}
    		modifier = {
    			factor = 0.5
    			owner = { has_country_flag = Maintanence_No }  #nulifies maintanence to disable it
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				NOT = { culture_group = THIS }
    			}
    		}
    		modifier = {
    			factor = 1.2
    			owner = {
    				culture_group = THIS
    			}
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				is_bankrupt = yes
    			}
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				idea = bureaucracy
    			}
    		}
    		modifier = {
    			factor = 5.0
    			owner = {
    				tag = BUC
    			}
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				idea = vice_roys
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = bill_of_rights
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = humanist_tolerance
    			}
    		}
    		modifier = {
    			factor = 2.0
    			owner = {
    				idea = quest_for_the_new_world
    			}
    		}
    	}
    	
    	title = "Emigration"
    	desc = "Some peasants think that conditions are bad in our country and now want to leave."
    
    	option = {
    		name = "ok"
    		ai_chance = { factor = 80 }
    		citysize = -10000
    		owner = { set_country_flag = Maintanence }  #reduces spam of this event
    		VAR = { centralization_decentralization = 2 }	
    	}
    
    	option = {
    		name = "Kill them to prevent this again!"
    		ai_chance = { factor = 5 }
    		citysize = -10000
    		owner = { 
    			badboy = 5
    			set_country_flag = Maintanence #reduces spam of this event
    			set_country_flag = Emigration 
    		}
    	}
    
    	option = {
    		name = "Help the peasants"
    		ai_chance = { factor = 15 }
    		owner = { 
    
    			treasury = -100
    			set_country_flag = Maintanence  #reduces spam of this event
    		}
    	}
    
    	option = {
    		name = "Do only animals Migrate?"    #this is a cheat option
    		ai_chance = { factor = 0 }
    		VAR = { aristocracy_plutocracy = 1 }
    		owner = {
    			set_country_flag = Maintanence
    		}
    	}
    }
    
    #Immigration
    province_event = {
    
    	id = 17901
    
    	trigger = {
    		owner = {
    			NOT = { 
    				has_country_flag = Disable
    				has_country_flag = Immigration
    			}
    			stability = 3
    			war = no
    		}
    		VAR = { centralization_decentralization = -4 }
    	}
    	
    	mean_time_to_happen = {
    		months = 500
    
    		modifier = {
    			factor = 0.4
    			owner = { luck = yes }
    		}
    		modifier = {
    			factor = 2.0
    			owner = { has_country_flag = Maintanence }
    		}
    		modifier = {
    			factor = 0.5
    			owner = { has_country_flag = Maintanence_No }
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				is_bankrupt = yes
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = bureaucracy
    			}
    		}
    		modifier = {
    			factor = 5.0
    			owner = {
    				tag = BUC
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = vice_roys
    			}
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				idea = bill_of_rights
    			}
    		}
    		modifier = {
    			factor = 0.4
    			owner = {
    				idea = humanist_tolerance
    			}
    		}
    	}
    	
    	title = "Immigration"
    	desc = "Some peasants think that conditions are good in our country and now want to live here. Make a example if you no longer want Immigrants."
    
    	option = {
    		name = "ok"
    		ai_chance = { factor = 80 }
    		citysize = 5000
    		VAR = { centralization_decentralization = -1 }	
    	}
    
    	option = {
    		name = "Send them back!"
    		ai_chance = { factor = 5 }
    		owner = { 
    			badboy = 1
    			set_country_flag = Maintanence 
    			set_country_flag = Immigration 
    		}
    	}
    
    	option = {
    		name = "Find them a different country"
    		ai_chance = { factor = 15 }
    		owner = { 
    			treasury = -50
    			set_country_flag = Maintanence
    			set_country_flag = Immigration 
    		}
    	}
    }
    Last edited by Darken; 21-12-2007 at 01:51.
    Shalom
    John F. Kennedy
    "For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covert means for expanding its sphere of influence--on infiltration instead of invasion, on subversion instead of elections, on intimidation instead of free choice, on guerrillas by night instead of armies by day."

    John 8:32
    "And ye shall know the truth, and the truth shall make you free."
    Martin Luther King
    "A nation that continues year after year to spend more money on military defense than on programs of social uplift is aproaching spiritual death."

  2. #2
    i have edited the event so that it cannot fire for a nation with a stability of anything other than -3. no idea why i had to do this but countries with -2 or higher stability were getting it even though the trigger was -3. Emmigration now fires correctly and as intended.

    Immigration is NOT firing. i fired it manualy and it failed but i just realized i was at war, so i will fire it manualy again when i am not at war. if it fails while not at war (which i suspect) then i think i have a problem with having the OR statement with all the VAR checks.

  3. #3
    Charlatan or Mystic? Cagliostro's Avatar
    Crusader Kings IIDeus VultDivine WindEU3 Napoleon's AmbitionEuropa Universalis: Rome
    Victoria 2Victoria II: A House DividedVictoria II: Heart of Darkness

    Join Date
    Apr 2002
    Location
    NYC
    Posts
    2,602
    FYI, it's "Emigration" - only one m there, as opposed to "immigration", which has two.

    Also, using CODE instead of QUOTE on the forum will get your indents all in the right places.

  4. #4
    Quote Originally Posted by Cagliostro
    FYI, it's "Emigration" - only one m there, as opposed to "immigration", which has two.

    Also, using CODE instead of QUOTE on the forum will get your indents all in the right places.

    well as they say, you learn something new every day.....ill change both things. thanks.

    BTW, Immigration is still not firing and it is not because of the OR/VAR code. i have no idea whats wrong. i even lowerd the MTTH and manualy fired it and nothing.

    i have other events that fire reliably with VAR as a trigger, there has to be something else. its seems i have proven that stability has issues as far as being a trigger....the problem is that stability is my key trigger in this whole event chain.
    Last edited by Darken; 15-07-2007 at 10:39.

  5. #5
    Dagneau, the Ultimate Diplomat gigau's Avatar
    75 games registered

    75

    200k clubAchtung PanzerA Game of DwarvesHoI AnthologyCities in Motion 2
    Crusader Kings IICommander: Conquest of the AmericasDarkest HourDiplomacyDungeonland
    East India Company CollectionElven Legacy CollectionEuropa Universalis: ChroniclesFor The GloryGalactic Assault
    GettysburgHearts of Iron III CollectionImpireIron CrossKing Arthur II
    LegioLeviathan: WarshipsThe Kings CrusadeLost Empire - ImmortalsMagicka
    Majesty II CollectionMarch of the EaglesNaval War: Arctic CirclePenumbra - Black PlaguePirates of Black Cove
    SengokuShip Simulator ExtremesSword of the Stars IISupreme Ruler 2020 GoldSupreme Ruler: Cold War
    StarvoidThe Showdown EffectVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneMount & Blade: With Fire and SwordWar of the RosesHearts of Iron: The Card GamePride of Nations
    Rise of PrussiaCK Holy KnightEU Rome Collectors EditionEU3 Collectors EditionKnights of Pen and Paper +1 Edition

    Join Date
    May 2005
    Location
    In the Lion's Den... looking for my shiny 500k icon...
    Posts
    18,169
    Blog Entries
    9
    Quote Originally Posted by Darken
    i have edited the event so that it cannot fire for a nation with a stability of anything other than -3. no idea why i had to do this but countries with -2 or higher stability were getting it even though the trigger was -3. Emmigration now fires correctly and as intended.
    In fact, it's quite logical.

    Code:
    	stability = -3
    will fire the event when the stability is higher or equal to -3, therefore whatever the stability is.

    Hence, for the event to fire for a stability of -3, you just need to write :
    Code:
    	NOT = { stability = -2 }
    No need to add other "NOT = { stab", they are useless.
    Auretus Ornithorhynchus anatinus, in hoc signo vinces. In honorem Paradox!Awarded the SAS Award for Forum Dedication<:3 )~~~ Mice over Rabbits
    • Crusader Kings II --- Planning a map mod, the name of which remains to be determined
    • Europa Universalis III : Divine Wind --- The EUIII Master Mod List (last update 7-March-2013)
    MEIOU:Tokgawa's Destiny, a mod giving you a new map, a new experience,... - Quezako ?
    If you have zero infamy, then you're wasting everybody's forgiveness. - Zzzzz... •
    MEIOU Subforum in english --- Enfillade MEIOU en Français --- MEIOU auf Deutsch
    My AAR : Aragón and its Place in European History
    • Mount & Blade Warband : Draper in the Noble Order of the Platypus - Impatient archer, reckless infantry and ridiculous cavalier
    • Werewolf, come join the hunt here --- Wins : as seer 1/1, as villager 2/10, as wolf 1/5 - Hosted 2 WWLite,

  6. #6
    Quote Originally Posted by gigau
    In fact, it's quite logical.

    Code:
    	stability = -3
    will fire the event when the stability is higher or equal to -3, therefore whatever the stability is.

    Hence, for the event to fire for a stability of -3, you just need to write :
    Code:
    	NOT = { stability = -2 }
    No need to add other "NOT = { stab", they are useless.
    i understand what you are saying but my tired little wishes that the code only looked for -3 and not 'anything above -3 also'. ill give what you said a go. thanks

    just a note.....still havent gotten Immigration to work, i verified in my save files that VAR is saving data properly. I tried changing Immigration to a country event and it still failed a manual fire.

    also i tried seperating Immigration into ten events that each only had one VAR trigger to eliminate any problems with the OR/VAR commands....didnt fix it.
    Last edited by Darken; 15-07-2007 at 13:07.
    Shalom
    John F. Kennedy
    "For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covert means for expanding its sphere of influence--on infiltration instead of invasion, on subversion instead of elections, on intimidation instead of free choice, on guerrillas by night instead of armies by day."

    John 8:32
    "And ye shall know the truth, and the truth shall make you free."
    Martin Luther King
    "A nation that continues year after year to spend more money on military defense than on programs of social uplift is aproaching spiritual death."

  7. #7
    Dagneau, the Ultimate Diplomat gigau's Avatar
    75 games registered

    75

    200k clubAchtung PanzerA Game of DwarvesHoI AnthologyCities in Motion 2
    Crusader Kings IICommander: Conquest of the AmericasDarkest HourDiplomacyDungeonland
    East India Company CollectionElven Legacy CollectionEuropa Universalis: ChroniclesFor The GloryGalactic Assault
    GettysburgHearts of Iron III CollectionImpireIron CrossKing Arthur II
    LegioLeviathan: WarshipsThe Kings CrusadeLost Empire - ImmortalsMagicka
    Majesty II CollectionMarch of the EaglesNaval War: Arctic CirclePenumbra - Black PlaguePirates of Black Cove
    SengokuShip Simulator ExtremesSword of the Stars IISupreme Ruler 2020 GoldSupreme Ruler: Cold War
    StarvoidThe Showdown EffectVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneMount & Blade: With Fire and SwordWar of the RosesHearts of Iron: The Card GamePride of Nations
    Rise of PrussiaCK Holy KnightEU Rome Collectors EditionEU3 Collectors EditionKnights of Pen and Paper +1 Edition

    Join Date
    May 2005
    Location
    In the Lion's Den... looking for my shiny 500k icon...
    Posts
    18,169
    Blog Entries
    9
    Quote Originally Posted by Darken
    i understand what you are saying but my tired little wishes that the code only looked for -3 and not 'anything above -3 also'. ill give what you said a go. thanks

    just a note.....still havent gotten Immigration to work, i verified in my save files that VAR is saving data properly. I tried changing Immigration to a country event and it still failed a manual fire.

    At your service.

    By the way, forgot to say that i like your events. I was planning to do something like that for immigration to the colonies.
    Auretus Ornithorhynchus anatinus, in hoc signo vinces. In honorem Paradox!Awarded the SAS Award for Forum Dedication<:3 )~~~ Mice over Rabbits
    • Crusader Kings II --- Planning a map mod, the name of which remains to be determined
    • Europa Universalis III : Divine Wind --- The EUIII Master Mod List (last update 7-March-2013)
    MEIOU:Tokgawa's Destiny, a mod giving you a new map, a new experience,... - Quezako ?
    If you have zero infamy, then you're wasting everybody's forgiveness. - Zzzzz... •
    MEIOU Subforum in english --- Enfillade MEIOU en Français --- MEIOU auf Deutsch
    My AAR : Aragón and its Place in European History
    • Mount & Blade Warband : Draper in the Noble Order of the Platypus - Impatient archer, reckless infantry and ridiculous cavalier
    • Werewolf, come join the hunt here --- Wins : as seer 1/1, as villager 2/10, as wolf 1/5 - Hosted 2 WWLite,

  8. #8
    Quote Originally Posted by gigau
    At your service.

    By the way, forgot to say that i like your events. I was planning to do something like that for immigration to the colonies.
    thanks
    Shalom
    John F. Kennedy
    "For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covert means for expanding its sphere of influence--on infiltration instead of invasion, on subversion instead of elections, on intimidation instead of free choice, on guerrillas by night instead of armies by day."

    John 8:32
    "And ye shall know the truth, and the truth shall make you free."
    Martin Luther King
    "A nation that continues year after year to spend more money on military defense than on programs of social uplift is aproaching spiritual death."

  9. #9
    Dagneau, the Ultimate Diplomat gigau's Avatar
    75 games registered

    75

    200k clubAchtung PanzerA Game of DwarvesHoI AnthologyCities in Motion 2
    Crusader Kings IICommander: Conquest of the AmericasDarkest HourDiplomacyDungeonland
    East India Company CollectionElven Legacy CollectionEuropa Universalis: ChroniclesFor The GloryGalactic Assault
    GettysburgHearts of Iron III CollectionImpireIron CrossKing Arthur II
    LegioLeviathan: WarshipsThe Kings CrusadeLost Empire - ImmortalsMagicka
    Majesty II CollectionMarch of the EaglesNaval War: Arctic CirclePenumbra - Black PlaguePirates of Black Cove
    SengokuShip Simulator ExtremesSword of the Stars IISupreme Ruler 2020 GoldSupreme Ruler: Cold War
    StarvoidThe Showdown EffectVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneMount & Blade: With Fire and SwordWar of the RosesHearts of Iron: The Card GamePride of Nations
    Rise of PrussiaCK Holy KnightEU Rome Collectors EditionEU3 Collectors EditionKnights of Pen and Paper +1 Edition

    Join Date
    May 2005
    Location
    In the Lion's Den... looking for my shiny 500k icon...
    Posts
    18,169
    Blog Entries
    9
    Quote Originally Posted by Darken
    just a note.....still havent gotten Immigration to work, i verified in my save files that VAR is saving data properly. I tried changing Immigration to a country event and it still failed a manual fire.

    also i tried seperating Immigration into ten events that each only had one VAR trigger to eliminate any problems with the OR/VAR commands....didnt fix it.
    Don't think that'll solve your problem (i'll continue looking into it) but, as for stability, you needn't write

    Code:
    		OR = {
    			VAR = { centralization_decentralization = -4 }
    			VAR = { centralization_decentralization = -3 }
    			VAR = { centralization_decentralization = -2 }
    			VAR = { centralization_decentralization = -1 }
    			VAR = { centralization_decentralization = 0 }
    			VAR = { centralization_decentralization = 1 }
    			VAR = { centralization_decentralization = 2 }
    			VAR = { centralization_decentralization = 3 }
    			VAR = { centralization_decentralization = 4 }
    			VAR = { centralization_decentralization = 5 }
    		}
    You just need

    Code:
    		VAR = { centralization_decentralization = -4 }
    It'll check if the slider is equal to or over -4
    Auretus Ornithorhynchus anatinus, in hoc signo vinces. In honorem Paradox!Awarded the SAS Award for Forum Dedication<:3 )~~~ Mice over Rabbits
    • Crusader Kings II --- Planning a map mod, the name of which remains to be determined
    • Europa Universalis III : Divine Wind --- The EUIII Master Mod List (last update 7-March-2013)
    MEIOU:Tokgawa's Destiny, a mod giving you a new map, a new experience,... - Quezako ?
    If you have zero infamy, then you're wasting everybody's forgiveness. - Zzzzz... •
    MEIOU Subforum in english --- Enfillade MEIOU en Français --- MEIOU auf Deutsch
    My AAR : Aragón and its Place in European History
    • Mount & Blade Warband : Draper in the Noble Order of the Platypus - Impatient archer, reckless infantry and ridiculous cavalier
    • Werewolf, come join the hunt here --- Wins : as seer 1/1, as villager 2/10, as wolf 1/5 - Hosted 2 WWLite,

  10. #10
    hmmmm, i see

    i suppose it will accomplish the same thing, i will change it. thanks. gonna test immigration again tomarow, as of right now it dont work and i doubt the stability/var changes will fix it but who knows

  11. #11
    Dagneau, the Ultimate Diplomat gigau's Avatar
    75 games registered

    75

    200k clubAchtung PanzerA Game of DwarvesHoI AnthologyCities in Motion 2
    Crusader Kings IICommander: Conquest of the AmericasDarkest HourDiplomacyDungeonland
    East India Company CollectionElven Legacy CollectionEuropa Universalis: ChroniclesFor The GloryGalactic Assault
    GettysburgHearts of Iron III CollectionImpireIron CrossKing Arthur II
    LegioLeviathan: WarshipsThe Kings CrusadeLost Empire - ImmortalsMagicka
    Majesty II CollectionMarch of the EaglesNaval War: Arctic CirclePenumbra - Black PlaguePirates of Black Cove
    SengokuShip Simulator ExtremesSword of the Stars IISupreme Ruler 2020 GoldSupreme Ruler: Cold War
    StarvoidThe Showdown EffectVictoria II: Heart of DarknessRome: Vae VictisMount & Blade: Warband
    Warlock: Master of the ArcaneMount & Blade: With Fire and SwordWar of the RosesHearts of Iron: The Card GamePride of Nations
    Rise of PrussiaCK Holy KnightEU Rome Collectors EditionEU3 Collectors EditionKnights of Pen and Paper +1 Edition

    Join Date
    May 2005
    Location
    In the Lion's Den... looking for my shiny 500k icon...
    Posts
    18,169
    Blog Entries
    9
    Quote Originally Posted by Darken
    hmmmm, i see

    i suppose it will accomplish the same thing, i will change it. thanks. gonna test immigration again tomarow, as of right now it dont work and i doubt the stability/var changes will fix it but who knows
    Well, could the problem be that you wrote
    Code:
    		OR = {
    			VAR = { centralization_decentralization = -4 }
    			VAR = { centralization_decentralization = -3 }
    			VAR = { centralization_decentralization = -2 }
    			VAR = { centralization_decentralization = -1 }
    			VAR = { centralization_decentralization = 0 }
    			VAR = { centralization_decentralization = 1 }
    			VAR = { centralization_decentralization = 2 }
    			VAR = { centralization_decentralization = 3 }
    			VAR = { centralization_decentralization = 4 }
    			VAR = { centralization_decentralization = 5 }
    		}
    instead of
    Code:
    		VAR = {
    			OR = {
    				centralization_decentralization = -4
    				centralization_decentralization = -3
    				centralization_decentralization = -2
    				centralization_decentralization = -1
    				centralization_decentralization = 0
    				centralization_decentralization = 1
    				centralization_decentralization = 2
    				centralization_decentralization = 3
    				centralization_decentralization = 4
    				centralization_decentralization = 5
    			}
    		}
    If so, my previous recommandation could solve the problem.

    Not linked to the problem, but i' would
    • lower the MTTH of the Immigration event... 3000 months seems long for people to settle down... i'd put it to 120 months (my opinion)
    • limit the endpoint of the migration to an area culturally linked to point of origine, or at least based on religions.
    Auretus Ornithorhynchus anatinus, in hoc signo vinces. In honorem Paradox!Awarded the SAS Award for Forum Dedication<:3 )~~~ Mice over Rabbits
    • Crusader Kings II --- Planning a map mod, the name of which remains to be determined
    • Europa Universalis III : Divine Wind --- The EUIII Master Mod List (last update 7-March-2013)
    MEIOU:Tokgawa's Destiny, a mod giving you a new map, a new experience,... - Quezako ?
    If you have zero infamy, then you're wasting everybody's forgiveness. - Zzzzz... •
    MEIOU Subforum in english --- Enfillade MEIOU en Français --- MEIOU auf Deutsch
    My AAR : Aragón and its Place in European History
    • Mount & Blade Warband : Draper in the Noble Order of the Platypus - Impatient archer, reckless infantry and ridiculous cavalier
    • Werewolf, come join the hunt here --- Wins : as seer 1/1, as villager 2/10, as wolf 1/5 - Hosted 2 WWLite,

  12. #12
    When you have problems with a specific event, it is a good idea to put the event in a file all by itself. Sometimes, the problem comes from the events preceding the troubled event in the event file. I did not look at your events in "compiler" mode but at first glance they look ok. The first thing I would do to debug this is to put each event in a different file.

    Hope this helps.

  13. #13
    Six-star scriptmaster
    Deus VultEuropa Universalis 3Europa Universalis III: In NomineEU3 Napoleon's Ambition

    Join Date
    Mar 2003
    Location
    Betanzos, A Coruña, España
    Posts
    3,317
    In the second event, the chances are 85+5+15 = 105. They must be 100. Maybe this is the problem.
    MIEMBRO DEL MagnaMundi TEAM.
    Descargate la ultima version de MMP aqui
    Visita nuestro foro en Terranova.dk o nuestro sub-foro en los foros Paradox

    EU3+NA+IN+MagnaMundi Platinum+VariProject
    Traducciones de los archivos de comandos para eventos y pequeña guia

    EU2: parche 1.09 + WATK 1.3
    El bAAR del duque , mi AAR del EU2 con Lorena

  14. #14
    Quote Originally Posted by JaxomCA
    The first thing I would do to debug this is to put each event in a different file.

    Hope this helps.
    ill try this, thanks.

    In the second event, the chances are 85+5+15 = 105. They must be 100. Maybe this is the problem.
    i just changed those last night, so i know its not it, but i will change it to 100%, thank you.
    Shalom
    John F. Kennedy
    "For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covert means for expanding its sphere of influence--on infiltration instead of invasion, on subversion instead of elections, on intimidation instead of free choice, on guerrillas by night instead of armies by day."

    John 8:32
    "And ye shall know the truth, and the truth shall make you free."
    Martin Luther King
    "A nation that continues year after year to spend more money on military defense than on programs of social uplift is aproaching spiritual death."

  15. #15
    In one last ditch effort, i will show my complete code. the reason i did not show it before was because i know others wouldnt want to use it. Also, embarassingly, i thought my code was sound, so i just assumed i didnt need to post it all.

    i will show red code as being things that others wont need and i iwll explain why:

    The tag 'Disable' is used in my mod to disable custom events if the player chooses this.

    'Maintanence' flags are used to increase the MTTH so the player doesnt get spammed while 'maintanence_no' reduces the MTTH to nulify the maintanence tag in case the player chose to disable the use of the maintanence event system.

    the BUC modifier is only needed if you use the BUC mod, this is intended to keep the Buccaneers from getting this event.

    I also changed the loss of peasants to 10000 in emigration and the change in the VAR data to +2 with 2 5000 peasant immigrations, this should be more efficient when this event works.

    Code:
    #Immigration
    province_event = {
    
    	id = 17901
    
    	trigger = {
    		owner = {
    			NOT = { 
    				has_country_flag = Disable
    				has_country_flag = Immigration
    			}
    			stability = 3
    			war = no
    		}
    		VAR = { centralization_decentralization = -4 }
    	}
    	
    	mean_time_to_happen = {
    		months = 500
    
    		modifier = {
    			factor = 0.2
    			owner = { luck = yes }
    		}
    		modifier = {
    			factor = 2.0
    			owner = { has_country_flag = Maintanence }
    		}
    		modifier = {
    			factor = 0.5
    			owner = { has_country_flag = Maintanence_No }
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				is_bankrupt = yes
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = bureaucracy
    			}
    		}
    		modifier = {
    			factor = 5.0
    			owner = {
    				tag = BUC
    			}
    		}
    		modifier = {
    			factor = 1.5
    			owner = {
    				idea = vice_roys
    			}
    		}
    		modifier = {
    			factor = 0.2
    			owner = {
    				idea = bill_of_rights
    			}
    		}
    		modifier = {
    			factor = 0.2
    			owner = {
    				idea = humanist_tolerance
    			}
    		}
    	}
    	
    	title = "Immigration"
    	desc = "Some peasants think that conditions are good in our country and now want to live here."
    
    	option = {
    		name = "ok"
    		ai_chance = { factor = 80 }
    		citysize = 2500
    		VAR = { centralization_decentralization = -1 }	
    	}
    
    	option = {
    		name = "Send them back!"
    		ai_chance = { factor = 5 }
    		owner = { 
    			badboy = 2
    			set_country_flag = Maintanence 
    			set_country_flag = Immigration 
    		}
    	}
    
    	option = {
    		name = "Find them a different country"
    		ai_chance = { factor = 15 }
    		owner = { 
    			treasury = -100
    			set_country_flag = Maintanence
    			set_country_flag = Immigration 
    		}
    	}
    }
    Last edited by Darken; 15-07-2007 at 22:56.
    Shalom
    John F. Kennedy
    "For we are opposed around the world by a monolithic and ruthless conspiracy that relies primarily on covert means for expanding its sphere of influence--on infiltration instead of invasion, on subversion instead of elections, on intimidation instead of free choice, on guerrillas by night instead of armies by day."

    John 8:32
    "And ye shall know the truth, and the truth shall make you free."
    Martin Luther King
    "A nation that continues year after year to spend more money on military defense than on programs of social uplift is aproaching spiritual death."

  16. #16
    Sort of kind of back dharper's Avatar
    Crusader Kings IIEU3 CompleteDivine WindFor The GloryFor the Motherland
    Hearts of Iron IIIHeir to the ThroneEuropa Universalis III: In NomineEU3 Napoleon's AmbitionVictoria: Revolutions
    Europa Universalis: RomeSemper FiSupreme Ruler 2020 GoldVictoria 2Victoria II: A House Divided
    Rome: Vae Victis

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    The immigration code looks sound to me. When testing, I usually put each new event in its own file and reduce mean time to 1 month. That helps me a lot.

    As to the actual effects...why would any sane person pick options B (gain badboy) or C (lose 100 ducats) when they could get more population? After all, it's not as if this population is anything but loyal, hard-working people of your own culture and religion.

    Perhaps if you were to add a static modifier that gave some tension to the province? That's how I make my own immigration event less of a gold mine for the player (although it's still nice). Well, that and a minor relations hit with the country doing the expulsion. Or perhaps you could give a static modifier that serves only as a trigger for events that could lead to the culture changing or religion changing, making it chancy for the player. You could even set up this event so it's contextual - have it only fire for provinces with a relatively low population and this modfier, suggesting that the locals have gotten replaced by immigrants. Having immigrants in your capital should be fine, but having immigrants arrive in your colonies will cause problems...

    Here's the text for mine - note that nothing will happen unless another country has expelled its people:
    Code:
    province_event = { #Religious Refugees arrive in $PROVINCENAME$ (any)
    
    id = 2040 #Replaces nonexistent Paradox event
    
    trigger = { 
      OR = {
        AND = { 
          REB = { has_country_flag = fleeing_catholics2 }
          owner = { religion = catholic }
          religion = catholic
          NOT = { owner = { has_country_flag = spread_reformation } }
          NOT = { owner = { has_country_flag = introduce_reformation } }
          }
        AND = { 
          REB = { has_country_flag = fleeing_calvinists2 }
          owner = { religion = reformed }
          religion = reformed
          }
        AND = { 
          REB = { has_country_flag = fleeing_muslims2 }
          owner = { religion_group = muslim }
          religion_group = muslim
          }
        AND = { 
          REB = { has_country_flag = fleeing_protestants2 }
          religion = protestant
          OR = { 
            owner = { religion = protestant }
            AND = { owner = { religion = catholic } owner = { has_country_flag = spread_reformation } }
            AND = { owner = { religion = catholic } owner = { has_country_flag = introduce_reformation } }
            }
          }
        }
      }
    
    mean_time_to_happen = { 
    
      months = 60
    
      modifier = { 
        port = yes
        factor = 0.5
        }
      modifier = { 
        is_colony = yes
        factor = 0.5
        }
      modifier = { 
        continent = europe
        factor = 0.5
        }
      modifier = { 
        COT = yes
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = reformed value = 40 } }
          religion = reformed
          }
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = reformed value = 20 } }
          religion = reformed
          }
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = reformed value = 60 } }
          religion = reformed
          }
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = protestant value = 60 } }
          religion = protestant
          }
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = protestant value = 40 } }
          religion = protestant
          }
        factor = 0.5
        }
      modifier = { 
        AND = { 
          NOT = { num_of_religion = { religion = protestant value = 20 } }
          religion = protestant
          }
        factor = 0.5
        }
      }
    
    title = "NEWNAME2040"
    desc = "NEWDESC2040"
    
    option = { 
      name = "NEWOPTA2040"
      ai_chance = { factor = 80 }
      citysize = +1000
      base_tax = +1
      change_manpower = +0.5
      add_province_modifier = { 
        name = "cultural_tensions"
        duration = 1825
        }
      owner = { 
        random_owned = { 
          limit = { owner = { religion = reformed } }
          owner = { any_country = { limit = { has_country_flag = fleeing_calvinists } relation = { who = THIS value = -50 } } }
          any_country = { clr_country_flag = fleeing_calvinists }
          any_country = { clr_country_flag = fleeing_calvinists2 }
          }
        random_owned = {
          limit = { owner = { religion_group = muslim } }
          owner = { any_country = { limit = { has_country_flag = fleeing_muslims } relation = { who = THIS value = -50 } } }
          any_country = { clr_country_flag = fleeing_muslims }
          any_country = { clr_country_flag = fleeing_muslims2 }
          }
        random_owned = { 
          limit = { 
            owner = { 
              religion = catholic 
              NOT = { has_country_flag = introduce_reformation }
              NOT = { has_country_flag = spread_reformation } 
              }
            }
          owner = { any_country = { limit = { has_country_flag = fleeing_catholics } relation = { who = THIS value = -50 } } }
          any_country = { clr_country_flag = fleeing_catholics }
          any_country = { clr_country_flag = fleeing_catholics2 }
          }
        random_owned = { 
          limit = { 
            OR = { 
              owner = { religion = protestant }
              AND = { owner = { religion = catholic } owner = { has_country_flag = introduce_reformation } }
              AND = { owner = { religion = catholic } owner = { has_country_flag = spread_reformation } }
              }
            }
          owner = { any_country = { limit = { has_country_flag = fleeing_protestants } relation = { who = THIS value = -50 } } }
          any_country = { clr_country_flag = fleeing_protestants }
          any_country = { clr_country_flag = fleeing_protestants2 }
          }
        }
      }
    option = { 
      name = "NEWOPTB2040"
      ai_chance = { factor = 20 }
      owner = {
        random_owned = { 
          limit = { 
            OR = { 
              owner = { religion = protestant }
              AND = { owner = { religion = catholic } owner = { has_country_flag = introduce_reformation } }
              AND = { owner = { religion = catholic } owner = { has_country_flag = spread_reformation } }
              }
            }
          owner = { any_country = { limit = { has_country_flag = fleeing_protestants } relation = { who = THIS value = 50 } } }
          }
        }
      }
    }
    The code is complex only because one event has to distinguish between religious refugees of three faiths and decide where they want to go - Protestants may go to countries that are in the process of converting, but haven't yet broken from Rome.

    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)




  17. #17
    Quote Originally Posted by dharper
    The immigration code looks sound to me. When testing, I usually put each new event in its own file and reduce mean time to 1 month. That helps me a lot.
    Just seperated them and the code works!!!!!!!!!! thanks guys, now i am going to combine them again and test it. i also need to increase the MTTH on Immigration as it happens way too much if you qaulify for the modifiers.

    As to the actual effects...why would any sane person pick options B (gain badboy) or C (lose 100 ducats) when they could get more population? After all, it's not as if this population is anything but loyal, hard-working people of your own culture and religion.
    my purpose was so the player/AI could stop getting the annoying peasants. i will change this to less punishing things.

    The code is complex only because one event has to distinguish between religious refugees of three faiths and decide where they want to go - Protestants may go to countries that are in the process of converting, but haven't yet broken from Rome.
    i wanted to make my peasants only go to religions that they came from but i knew it would take tons of events....ill look at your code, thank you. does this mean that i do not need tons of additional events to get peasants to care what religions they go to (havent studied your code yet)?

  18. #18
    Sort of kind of back dharper's Avatar
    Crusader Kings IIEU3 CompleteDivine WindFor The GloryFor the Motherland
    Hearts of Iron IIIHeir to the ThroneEuropa Universalis III: In NomineEU3 Napoleon's AmbitionVictoria: Revolutions
    Europa Universalis: RomeSemper FiSupreme Ruler 2020 GoldVictoria 2Victoria II: A House Divided
    Rome: Vae Victis

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    Quote Originally Posted by Darken
    my purpose was so the player/AI could stop getting the annoying peasants. i will change this to less punishing things.
    Oh, I see. Alright, then.
    i wanted to make my peasants only go to religions that they came from but i knew it would take tons of events....ill look at your code, thank you. does this mean that i do not need tons of additional events to get peasants to care what religions they go to (havent studied your code yet)?
    I use four events total to deal with emigration/immigration. Three of them are emigration, one for each religion. As soon as a country expels Catholics (for example) from a province, the REB nation gets a flag mentioning this - and nobody else can expel Catholics until the flag gets removed.

    Then, the one immigration event kicks in (with a short mean time). A Catholic country would get the event and immigrants would arrive in a province (with preference for ports, colonies, neighboring countries and centers of trade). This erases all the flags, allowing Catholics to be expelled somewhere else...

    The only time I've ever noticed a lag was in one game where countries were expelling Reformed peasants - and there were only two Reformed countries in the world. The peasants simply wouldn't let themselves be expelled! But perhaps that's realistic...?

    You're welcome to steal my code - if so, you should simplify it, since you don't use the same flags I do (introduce_reformation and spread_reformation, mostly). Here's the code for one of my expulsion events (for Reformed, in this case)
    Code:
    province_event = { #Expulsion of Heretics (Reformed province)
    
    id = 55841
    
    trigger = { 
      continent = europe
      religion = reformed
      NOT = { REB = { has_country_flag = fleeing_calvinists2 } }
    	owner = {
        has_country_flag = expulsion
    		NOT = { 
          religion = THIS 
          has_country_flag = civil_war
          }
      	}
      is_core = THIS
      NOT = { has_siege = yes }
      OR = { 
        NOT = { is_religion_enabled = protestant }
        PAP = { has_country_flag = catholic_reformation }
        PAP = { has_country_flag = counter_reformation }
        }
      NOT = { PAP = { has_country_flag = decline_of_papacy } }
      NOT = { is_colony = yes }
      any_neighbor_province = { religion_group = christian }
      }
      
    mean_time_to_happen = { months = 24 } 
      
    title = "NEWNAME2033" #Expulsion of heretics
    desc = "NEWDESC2033"
    
    option = {
      name = "NEWOPTA2033" #$PROVINCENAME$ has been purged of heresy
      owner = { set_country_flag = fleeing_calvinists }
      REB = { set_country_flag = fleeing_calvinists2 }
      owner = {
        treasury = +25
        stability = -1
    		random_owned = {
    			limit = {
            religion = reformed
            continent = europe
            NOT = { is_colony = yes }
            is_core = THIS
            NOT = { has_siege = yes }
    				OR = { 
              owner = { religion = protestant }
              AND = { 
                owner = { has_country_flag = introduce_reformation }
                owner = { religion = catholic }
                }
              AND = { 
                owner = { has_country_flag = spread_reformation }
                owner = { religion = catholic }
                }
              }
    				}
    				religion = protestant
            base_tax = -1
            change_manpower = -1
            add_province_modifier = { 
              name = "expulsion_of_heretics"
              duration = 365
              }
    			}
    			random_owned = {
    				limit = { 
    				religion = reformed
            continent = europe
            NOT = { is_colony = yes }
            is_core = THIS
            NOT = { has_siege = yes }
    				owner = { religion = catholic }
    				owner = { NOT = { has_country_flag = introduce_reformation } }
    				owner = { NOT = { has_country_flag = spread_reformation } }
    				}
    				religion = catholic
            base_tax = -1
            change_manpower = -1
            add_province_modifier = { 
              name = "expulsion_of_heretics"
              duration = 365
              }
    			  }
      		}
      }
    }

    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)




  19. #19
    Quote Originally Posted by dharper
    You're welcome to steal my code -
    thanks

    i will check it out.

    if you feel like posting your whole event chain for others to use they may apreciate it. many people will not like my Variable system but will still want Migration events.

    if you do post the whole event chain, ill add it to my top post and quate anything you say, that way people can see both examples right away and choose which they want and we wont have 2 threads going.

  20. #20
    Sort of kind of back dharper's Avatar
    Crusader Kings IIEU3 CompleteDivine WindFor The GloryFor the Motherland
    Hearts of Iron IIIHeir to the ThroneEuropa Universalis III: In NomineEU3 Napoleon's AmbitionVictoria: Revolutions
    Europa Universalis: RomeSemper FiSupreme Ruler 2020 GoldVictoria 2Victoria II: A House Divided
    Rome: Vae Victis

    Join Date
    Aug 2002
    Location
    Province #989 (EU3)
    Posts
    12,467
    Quote Originally Posted by Darken
    if you feel like posting your whole event chain for others to use they may apreciate it. many people will not like my Variable system but will still want Migration events.
    My events aren't really emigration, though - they're used for (a) forcible expulsions (like the Huguenots) and (b) voluntarily emigration of religious minorities, but only when the country in question doesn't have a colony they can go to. Your events, on the other hand, are for voluntary movement of people during times of unrest...although the code is similar, the intent is very different!

    All the possible events that can cause immigration are in my Religious_Turmoil event file in my mod.

    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
Page 1 of 2 1 2 LastLast

Posting Permissions

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