• 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.

Ijtzoi

Second Lieutenant
83 Badges
Sep 6, 2009
168
34
  • Crusader Kings II
  • Sengoku
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Cities: Skylines - Parklife
  • BATTLETECH - Digital Deluxe Edition
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis 4: Emperor
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Prison Architect
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis III Complete
  • Stellaris: Leviathans Story Pack
I've been working on my own little personal mod for a bit. I've taken my first steps into creating events, and am not yet too familiar with the syntaxes and the effects of the triggers and... er.. effects. I've hit a bit of a snag with an event I've been trying to write -

Code:
country_event = {		
	id = 6714	
	trigger = {
		any_province = {
			any_empty_neighbour_province = {
				barbarian_power = {NOT = 2}
				units_in_province = 4
				}
		}
	}		
	title = "A Few Friendly Tribes"
	desc = "EVENT6714DESC"
	mean_time_to_happen = {
		months = 12
	}
	option = {
		name = "Bring these people under our rule."
		any_province = {
			any_empty_neighbour_province = {
				limit = {
					barbarian_power = {NOT = 2}
					units_in_province = 4
				}
				secede_province = THIS
				population = 1
			}
		}
		treasury = -10
	}
	option = {
		name = "We can't afford it right now."
	}
}
What I'm trying to accomplish is an event where, after a military presence for a year (subject to change) in a province whose barbarians have been (mostly) pacified, one could pay some money and the province is yours. This would make factions like Dacia, Suebi, or even just any one-prov tribe with nearby gray a lot more playable, I believe.

It doesn't work. The event never seems to trigger and forcing it via console brings up an empty box (the one that would usually have all the options, strings and an exit button). The console looks like it is only checking each province I own and not the empty neighbour ones I wanted.

I have no idea where it's going wrong, but as I have said, am rather new at scripting in a Paradox game. Have I made a wrong assumption about how a trigger or event works? Have I structured it wrong, or am going about the problem the wrong way? Is what I seek to accomplish simply impossible? I would greatly appreciate some help. Also, if the solution would only work with VV - I do not have VV. :( I'm on vanilla 1.3.
 
Just so you know, units_in_province will count ANY units, not just yours, so if for instance you put troops in a barbarian province that's next to another country they may end up getting it instead of you.
 
A few things.

First, do what Descartes said. I don't think NOT = 2 is valid syntax, though admittedly I haven't tried it.

Second, when you trigger a province event from the console, it just checks your capital by default rather than searching for any provinces that fit the triggers. Try finding the province id for one that does fit the triggers and enter it as event 6714 [provid] where [provid] is the id number for that province.
 
Wow. Wasn't expecting so much help so soon. Thanks, everyone. :) So I reformed the code with such suggestions. All "not"s are outside of {}s and I added a character check to try and get around the units_in_province thing. You now need a general in a bordering one-bar gray, in theory at least (issues testing), now. This should reduce the instances of it going to nearby countries
Code:
country_event = {
	id = 6714
	trigger = {
		any_province = {
			any_empty_neighbour_province = {
				not = {barbarian_power = 2}
				units_in_province = 4
				}
		}
		any_character = {
			location = {
				not = {barbarian_power = 2}
				barbarian_power = 1
				units_in_province = 4
				owner = XXX
				any_neighbour_province = {
					owner = THIS
				}
			}
		}
	}	
	title = "A Few Friendly Tribes"
	desc = "EVENT6714DESC"
	mean_time_to_happen = {
		months = 12
	}
	option = {
		name = "Bring these people under our rule."
		any_province = {
			any_empty_neighbour_province = {
				limit = {
					not = {barbarian_power = 2}
					units_in_province = 4
				}
				secede_province = THIS
				population = 1
			}
		}
	treasury = -10
	}
	option = {
		name = "We can't afford it right now."
	}
}
However - it STILL won't trigger. Can't tell why. A few problems and questions regarding code:
Are all of these 1.3-working-commands (stupid non-VV game...)?
owner = XXX looked like it was valid from certain history files. Is it not?
Also - still testing still fails to start it. It's a country event, not a province one. When I specify a province, it tries to look for provinces within it (should I switch it to a province event? would "THIS" still count as the parent country?). When I don't, it doesn't seem to do the whole "any_empty" subchecks. Not visibly in the console, anyways.
BTW - will "THIS" always refer to the country the whole event is for, even if within a switch to provinces, chars or other countries?
And how would I go about making the ai aware of this event and seek to use it?
 
Two problems I can see:

1. For effects, you need to use any_owned rather than any_province. The latter is for triggers only, AFAIK.

2. Remove the U in "neighbour". For some reason, the game engine uses the US spelling for some things and British spelling for others - in this case, it uses the US spelling.
 
Ahh, so that'd be the trouble - couldn't detect the neighbor paragraph in the trigger, had no valid options with the effects any_owned thing. Makes sense, thanks. Also didn't know that about the trigger-only, that it was even possible. After a few more iterations, and it turns out that any_garrisoned_province can make the event a bit neater and less likely to trigger for the wrong country, but it was also trigger-only, so I had to figure out the random_garrisoned_province and now IT'S WORKING WOOOOOO thanks everyone, you've all been a great help. :)
 
Last edited:
Glad to hear it :) Both of those issues I pointed out were things that have tripped me up in the past (and let to much hair-pulling), good to see it has helped someone :)