• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Cheexsta

Veni, vidi, vici
60 Badges
Dec 22, 2005
2.894
59
  • Europa Universalis IV: Rights of Man
  • Rome: Vae Victis
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Europa Universalis: Rome Collectors Edition
  • Mount & Blade: Warband
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Victoria 2: Heart of Darkness
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Victoria 2
Hey fellas, I'm running into a bit of a block here.

What I'm trying to do is have an event that has different effects depending on what it is affecting (in this case, provinces). That is, if a province has 10 Civ value, I want the effect to be X, while if it has 20 Civ value, I want the effect to be Y and so on.

What I did at first was use:

Code:
		OR = {
			random_owned = {
					limit = {
						(conditions)
					}
					(effects)
			}
		OR = {
			random_owned = {
					limit = {
						(conditions)
					}
					(effects)
			}
		}
And so on, but while the event triggered properly and showed the effects, they wouldn't actually happen. When I changed the effects to have just one limit and no OR arguments, it worked fine.

I've also tried sticking an AND argument after each random_owned line as well, but that stuffed things up even more (and still had no effect).

The only other way I can think of solving this would be to have a separate event for each possibility, which in itself brings a whole host of headaches so I'd rather keep it all within one event if possible.

Any help would be greatly appreciated.
 
Jan 31, 2004
551
0
I think this does not work because you are mixing triggers and effects sections if you structure events in this way. What you are aiming at seems to be a "case of" structure which is not supported as far as I am aware.
I would be rather happy if someone could prove me wrong on the latter.
 

adonys

Sergeant
88 Badges
Apr 5, 2008
85
2
  • BATTLETECH: Season pass
  • Shadowrun: Dragonfall
  • Empire of Sin
  • Mount & Blade: With Fire and Sword
  • Knights of Pen and Paper 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Surviving Mars: First Colony Edition
  • Steel Division: Normandy 44
  • Steel Division: Normandy 44 Deluxe Edition
  • Knights of Honor
  • Crusader Kings Complete
  • BATTLETECH
  • Prison Architect
  • Crusader Kings III
  • Stellaris: Necroids
  • Tyranny - Bastards Wound
  • Stellaris: Humanoids Species Pack
  • Surviving Mars: Digital Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • BATTLETECH: Heavy Metal
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Sign Up
  • BATTLETECH: Flashpoint
  • Shadowrun: Hong Kong
  • Europa Universalis III Complete
  • Steel Division: Normandy 44 -  Back to Hell
  • Shadowrun Returns
  • Europa Universalis III Complete
  • BATTLETECH - Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Deluxe Edition
  • Stellaris: Megacorp
  • Teleglitch: Die More Edition
  • Rome: Vae Victis
  • War of the Roses
  • Stellaris: Distant Stars
  • 500k Club
  • Pride of Nations
  • Mount & Blade: Warband
  • Tyranny: Archon Edition
  • Stellaris: Galaxy Edition
actually, there's a way through which it can be done.

I've developed a way to do this while working on an unified looting event (using civ and pop as factors influencing the outcome). are you doing something like this too?

don't have time to present all the details and code right now, maybe tonight when i'll get home.
 

adonys

Sergeant
88 Badges
Apr 5, 2008
85
2
  • BATTLETECH: Season pass
  • Shadowrun: Dragonfall
  • Empire of Sin
  • Mount & Blade: With Fire and Sword
  • Knights of Pen and Paper 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Surviving Mars: First Colony Edition
  • Steel Division: Normandy 44
  • Steel Division: Normandy 44 Deluxe Edition
  • Knights of Honor
  • Crusader Kings Complete
  • BATTLETECH
  • Prison Architect
  • Crusader Kings III
  • Stellaris: Necroids
  • Tyranny - Bastards Wound
  • Stellaris: Humanoids Species Pack
  • Surviving Mars: Digital Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • BATTLETECH: Heavy Metal
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Sign Up
  • BATTLETECH: Flashpoint
  • Shadowrun: Hong Kong
  • Europa Universalis III Complete
  • Steel Division: Normandy 44 -  Back to Hell
  • Shadowrun Returns
  • Europa Universalis III Complete
  • BATTLETECH - Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Deluxe Edition
  • Stellaris: Megacorp
  • Teleglitch: Die More Edition
  • Rome: Vae Victis
  • War of the Roses
  • Stellaris: Distant Stars
  • 500k Club
  • Pride of Nations
  • Mount & Blade: Warband
  • Tyranny: Archon Edition
  • Stellaris: Galaxy Edition
sorry for yesterday, didn't had time to post anything.

now, if I understand correctly what you meant, you should try something like this:

Code:
xxx_event ={
	id = xxxxxx

	trigger = {
		random_owned = {
			limit = {
				condition1
				condition2
				...
				conditionn
			}
		}
	}

	mean_time_to_happen = {
		
	}

	title = "zzz"
	desc = "zzz"

	option = {
		name = "zzz"
		random_owned = {
			limit = {
				condition1
			}
			effect1
		}
		random_owned = {
			limit = {
				condition2
			}
			effect2
		}
		...
		random_owned = {
			limit = {
				conditionn
			}
			effectn
		}
	}
}

this should work correct if you want to have all effect1, effect2, effectn happening if the player choses the option. of course, depending on the conditions, only some of the effects will be added (for example if only condition1 is true, then only effect1 will be added; if condition2 and condition3 are true, then both effect2 and effectn will be added)
 

adonys

Sergeant
88 Badges
Apr 5, 2008
85
2
  • BATTLETECH: Season pass
  • Shadowrun: Dragonfall
  • Empire of Sin
  • Mount & Blade: With Fire and Sword
  • Knights of Pen and Paper 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Surviving Mars: First Colony Edition
  • Steel Division: Normandy 44
  • Steel Division: Normandy 44 Deluxe Edition
  • Knights of Honor
  • Crusader Kings Complete
  • BATTLETECH
  • Prison Architect
  • Crusader Kings III
  • Stellaris: Necroids
  • Tyranny - Bastards Wound
  • Stellaris: Humanoids Species Pack
  • Surviving Mars: Digital Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • BATTLETECH: Heavy Metal
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Sign Up
  • BATTLETECH: Flashpoint
  • Shadowrun: Hong Kong
  • Europa Universalis III Complete
  • Steel Division: Normandy 44 -  Back to Hell
  • Shadowrun Returns
  • Europa Universalis III Complete
  • BATTLETECH - Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Deluxe Edition
  • Stellaris: Megacorp
  • Teleglitch: Die More Edition
  • Rome: Vae Victis
  • War of the Roses
  • Stellaris: Distant Stars
  • 500k Club
  • Pride of Nations
  • Mount & Blade: Warband
  • Tyranny: Archon Edition
  • Stellaris: Galaxy Edition
I did an editing yesterday on my post, but for some reason it seems to be lost (had some ISP problems yesterday).

it's very important to know exactly what you want to do, be cause depending on that, the code will look completely different.

yesterday's example will only work if you want to let the player chose (if you offer him more options), each option triggering different multiple effects depending on some conditions (even inside each option), but it won't allow you to don't offer a player a choice (like in elections, you can't present the player the options for each candidate, because that means he will pick anyone he wants to, instead, you'll want to offer him only the winning candidate as a choice), and even more, it won't allow weighted results (you can only have not-intersecting conditions, otherwise you will have multiple effects being added, each having 100% chance to be added if its condition is true).

anything else needs more complicated structures in order to keep everything grouped in a few events, instead doing different events for each case.

for example, in my almost-ready unified loot event, as soon as a province is controlled (and not owned, of course), the new controller is offered to choose between leave the province as it is, loot it and raze it to the ground. after the player makes his choice, an AI event is triggered (because only the damn AI can use a weighted modifier event script, for the player each option will be available as a simple option instead) and depending on controller's choice and on few province's characteristics (civilization and population), different effects will be added to that province, and then other controller/owner announcing events will be triggered.

so, I really need to exactly know what you intend to do, in order to present you the best possible way to do it.
 

Descartes

Lt. General
42 Badges
Oct 12, 2008
1.212
2
  • Crusader Kings II
  • 500k Club
  • Sengoku
  • Europa Universalis: Rome
  • Heir to the Throne
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Hearts of Iron II: Armageddon
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 200k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Rome: Vae Victis
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Rajas of India
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Res Publica
  • Cities: Skylines
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
for example, in my almost-ready unified loot event, as soon as a province is controlled (and not owned, of course), the new controller is offered to choose between leave the province as it is, loot it and raze it to the ground. after the player makes his choice, an AI event is triggered (because only the damn AI can use a weighted modifier event script, for the player each option will be available as a simple option instead) and depending on controller's choice and on few province's characteristics (civilization and population), different effects will be added to that province, and then other controller/owner announcing events will be triggered.
Will you release that one? :rolleyes:
 

Cheexsta

Veni, vidi, vici
60 Badges
Dec 22, 2005
2.894
59
  • Europa Universalis IV: Rights of Man
  • Rome: Vae Victis
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Europa Universalis: Rome Collectors Edition
  • Mount & Blade: Warband
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Victoria 2: Heart of Darkness
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Victoria 2
For the record: I've now managed to get the limits working exactly as I had intended. Basically, in a single event option you can have different effects depending on what it's affecting. The exact event I'm working on is as follows:

Code:
	option = {
		name = "Ok"
		random_owned = {
			limit = {
				civilization_value = 10
				NOT = { civilization_value = 20 }
				NOT = { controlled_by = THIS }
				NOT = { has_province_flag = tcm_province_occupied_10 }
			}
			set_province_flag = tcm_province_occupied_10
			civilization_value = -10
		}
		random_owned = {
			limit = {
				civilization_value = 20
				NOT = { civilization_value = 30 }
				NOT = { controlled_by = THIS }
				NOT = { has_province_flag = tcm_province_occupied_20 }
			}
			set_province_flag = tcm_province_occupied_20
			civilization_value = -20
		}
...etc

Tested and working perfectly, and has the potential to really simplify the TCM files. Now, to get the event firing as soon as possible...