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

Victor1234

Feldmarschall
10 Badges
Jan 3, 2004
1.613
612
  • Arsenal of Democracy
  • Darkest Hour
  • Europa Universalis III
  • Divine Wind
  • Heir to the Throne
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III: Collection
So, I was looking all around to find such a command, as I had seen them in Victoria and HOI2.....only, I didn't find any such command. I looked at the standard events which end the major wars (Napoleonic, basically) and only saw a victory-point increase command and a major boost to relations. If I set ferocity to "yes" in the AI files, the country should not accept any peace offers....so how could I then end the war?

The idea is, I set AI ferocity of all combatants to = yes at war start. Then if certain provinces are taken (control) then that fires the end of the war event, where the AI reverts back to the ferocity = no, and the provinces change hands, etc. Only trouble is, I can't seem to find any command to end the state of war at that point....

Anyone want to, please, shed some light on this?

Thanks in advance,
Victor
 
There's no "command = { type = peace which = TUR }" However, you could make the command:

"command = { type = secedeprovince which = TUR value = 323 }" #Transylvania#

by having this in the trigger:

"control = { province = 323 data = TUR }" #Transylvania#
"owned = { province = 323 data = -1 }"

This checks if the nation getting it(Hungary) owns Transylvania and it's controlled by Ottoman Empire. When the province is seceded the warscore will drop and then you have a higher chance of tyhem making peace with money transfer or white peace. ;)
 
Not with "ferocity = yes". AI will continue the war until complete victory or defeat. But it is possible to code an AI file change to revert to ferocity = no when borders are "fine".
 
There is a way to cheat a peace command, but it only works in certain situations, and it might be that this will work for you. It also means that you don't have to worry about changing the ai mid stream.

The trick is to use the inheritance command in an initial event. This, obviously, ends the war between two nations. Then have it trigger a second event that gives that just-inherited nation independence. This then triggers a third event - that includes the breakvassal command. It can also include secede-province commands, to simulate the exchange of territory.

The big challenge is in being prepared to code up enough versions of it to encompass all of the variable conditions and results you want. Let's have a pretend example of two nationa ABC and DEF who are at war. ABC owns provinces 100, 200 and 300 while DEF owns 400, 500 and 600 and you want to be able to simulate a peace command for some historical reason that is unimportant here. Both have ferocity = yes.
Code:
event = {
	id = 100001
	random = no
	country = ABC
	trigger = {
		war = { country = ABC country = DEF }
		OR = {
			AND = {
				owned = { province = 400 data = DEF } #their capital province
				control = { province = 400 data = ABC }
			}
			AND = {
				owned = { province = 500 data = DEF }  #the other two
				control = { province = 500 data = ABC }
				owned = { province = 600 data = DEF }
				control = { province = 600 data = ABC }
			}
		}
		control = { province = 100 data = ABC } # ABC control's all its own
		control = { province = 200 data = ABC }
		control = { province = 300 data = ABC }
	}
	name = "The Peace of Snagglepuss"
	desc = "Niggledy, biggledy blah, blah BOO!"
	date = { year = 1452 }
	offset = 100
	deathdate = { year = 1467 }

	action_a = {
		name = "Excellent!"
		command = { type = inherit which = DEF }
		command = { type = trigger which = 100002 }
	}
}

event = {
	id = 100002
	random = no
	country = ABC
	name = "Administrative event"
	desc = "We wouldn't need to do this if Johan gave us a peace command"
	
	action_a = {
		name = "Not that he isn't awesome already"
		command = { type = independence which = DEF }
		command = { type = trigger which = 100003 }
	}
}

event = {
	id = 100003
	random = no
	country = DEF
	name = "AI_Event"
	desc = "So it goes"

	action_a = {
		name = "OK"
		command = { type = breakvassal which = ABC }
		command = { type = relation which = ABC value = -200 }
		command = { type = secede province which = ABC value = 500 }
	}
}

OK, so that's the simple shape of it. Some of the things that you need to be wary of are:

1. There can be a lot of variation in province ownership at the time the war begins, unless is starts really close to the beginning of the scenario. You'll need to account for that or it could be either abused or frustrating for players.

2. The independence command looks at the revolt.txt file for what to give the nation. It gets everything in the 'minimum' entry. Now, this could really cause problems if this was a civil war, for example, or any situation where the two nations share provinces in their 'minimum' entries. However, one thing most modders don't realise is that you can have multiple entries for each nation in the revolt.txt, just so long as their active dates don't overlap. Let's say that province 300 is one that both ABC and DEF would normally have had as an 'accepted' core of their nation. Well, that would have meant that, once ABC gave independence to DEF then it would have departed with provinces 300, 400, 500 and 600. Yes, you could have included another secedeprovince commond for province 300, but it would have returned sans bailiff, courthouse etc, much to the victorious player's annoyance. It would also have wiped out any provincerevolt conditions placed on their by some other event. So, instead, you could have had a distinct entry for DEF in the revolt.txt file for just the period 1452 to 1467 which defined its minimums as excluding province 300.


So, yes, there are ways around a lot of the trigger and command shortfalls, but it can mean having to be really careful and potentially write many different iterations of these events to cover all the possibilities.

Good luck.

MattyG
 
Strange, I tried the event setup exactly as you wrote here, the thing worked fine until the second event was supposed to fire. It never did. My guess is, EU2 doesn't like having more than one event triggered in a chain like that, because I had another event chain that nobody could find a thing wrong with, that also wouldn't fire, which had the event triggered by an event, which then triggers a third event.
 
Sure.

#The English Civil War - England#
event = {

id = 100001
random = no
country = ENG
name = "English Civil War"
desc = "The civil war begins to stop the return of the deposed English royal family, the de Cornouaille, who have gathered themselves in the Duchy of Cornwall. They offer us peace, but if we accept, our Kingdom forever abandons our claims to France, Wales, Scotland and Ireland, our family goes into exile and England cedes land to Yorkshire, Wales and Scotland. If we do not accept, we must hold both Wessex and Anglia to stay in the fight and must take control of Cornwall, Wales, Yorkshire, the Highlands, Meath, Leinster and Calais to win. If neither side achieves a victory by 1430, it ends in a draw."
style = 1

date = { day = 1 month = january year = 1419 }



action_a ={
name = "No deal, we cannot give in"
command = { }



}

action_b ={
name = "The situation is hopeless, let us end it now"
command = { type = trigger which = 100002 }
command = { type = trigger which = 100003 }
command = { type = trigger which = 100004 }
command = { type = trigger which = 100005 }
command = { type = trigger which = 100006 }

}
}
#The English Civil War Won - Scotland#
event = {

id = 100002
random = no
country = SCO
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1




action_a ={
name = "A great day for Scotland"
command = { type = ai which = "nocolon.ai" }
command = { type = trigger which = 100007 }
command = { type = inherit which = ENG }


}
}
#The English Civil War Won - Ireland#
event = {

id = 100003
random = no
country = EIR
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1





action_a ={
name = "A great day for Ireland"
command = { type = ai which = "nocolon.ai" }


}
}
#The English Civil War Won - Normandy#
event = {

id = 100004
random = no
country = NRM
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1




action_a ={
name = "A great day for Normandy"
command = { type = ai which = "nocolon.ai" }


}
}
#The English Civil War Won - Wales#
event = {

id = 100005
random = no
country = WLS
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1




action_a ={
name = "A great day for Wales"
command = { type = ai which = "nocolon.ai" }
command = { type = inherit which = CNW }


}
}
#The English Civil War Won - York#
event = {

id = 100006
random = no
country = YOR
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1





action_a ={
name = "A great day for York"
command = { type = ai which = "nocolon.ai" }


}
}

#The English Civil War Won - Scotland#
event = {

id = 100007
random = no
country = SCO
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
style = 1





action_a ={
name = "A great day for Scotland"
command = { type = independence which = ENG }
command = { type = trigger which = 100008 }
}
}
#The English Civil War Lost - England#
event = {

id = 100008
random = no
country = ENG
name = "English Civil War"
desc = "The civil war has ended and we have lost. Now the rightful King of England has resumed his throne"
style = 1





action_a ={
name = "A sad day for the realm"
command = { type = remove_countryculture which = french }
command = { type = removecore which = 231 }
command = { type = removecore which = 232 }
command = { type = removecore which = 233 }
command = { type = removecore which = 234 }
command = { type = removecore which = 235 }
command = { type = removecore which = 236 }
command = { type = removecore which = 237 }
command = { type = removecore which = 413 }
command = { type = removecore which = 412 }
command = { type = removecore which = 382 }
command = { type = removecore which = 414 }
command = { type = removecore which = 415 }
command = { type = removecore which = 416 }
command = { type = removecore which = 241 }
command = { type = removecore which = 243 }
command = { type = removecore which = 250 }
command = { type = removecore which = 383 }
command = { type = removecore which = 384 }
command = { type = removecore which = 385 }
command = { type = removecore which = 379 }
command = { type = removecore which = 380 }
command = { type = removecore which = 411 }
command = { type = removecore which = 238 }
command = { type = removecore which = 239 }
command = { type = removecore which = 240 }
command = { type = removecore which = 241 }
command = { type = relation which = SCO value = 200 }
command = { type = relation which = EIR value = 200 }
command = { type = relation which = WLS value = 200 }
command = { type = relation which = NRM value = 200 }
command = { type = relation which = YOR value = 200 }
command = { type = secedeprovince which = SCO value = 238 }
command = { type = secedeprovince which = SCO value = 239 }
command = { type = secedeprovince which = YOR value = 240 }
command = { type = secedeprovince which = YOR value = 242 }
command = { type = ai which = "england.ai" }
command = { type = treasury value = 100 }
}
}
#The English Civil War Lost - England#
event = {

id = 100009
trigger = {
NOT = {


control = { province = 249 data = ENG }

}

}
random = no
country = ENG
name = "English Civil War"
desc = "The civil war has ended and we have lost it."
style = 1



date = { day = 1 month = january year = 1419 }
offset = 1
deathdate = { day = 1 month = january year = 1430 }



action_a ={
name = "A sad day for England"
command = { type = trigger which = 100002 }
command = { type = trigger which = 100003 }
command = { type = trigger which = 100004 }
command = { type = trigger which = 100005 }
command = { type = trigger which = 100006 }


}
}



This is the complete event series. The first event, second and the last event work, the only trouble seems to be the triggering of the event with the independence command. The event which should trigger it fires alright, but then that event doesn't. I had a similar event series where an event fires an event, which fires an event, which causes war to be declared (and thus didn't include any inherit or independence command), which also wouldn't fire.
 
I am sorry to have led you slightly astray.

There can be problems with events triggering events where there are changes of tag and countries appearing and disappearing. I suspect the game does not have the time to catch up on the new data, although that does seem strange. It's also the case that the game game reads an event before it happens to work out which bits it will execute (sych as identifying which of the provinces might revolt etc) and at that point it assesses whether a condition exists to have a command trigger (such as the existence of a country, ownedship of a revolting province or - in this case - the NON-existence of a country).

So, could you retry the sequence, and this time remove the command to trigger event 100007 and instead have it in this fashion.

Code:
#The English Civil War Won - Scotland#
event = {

id = 100007
random = no
country = SCO
trigger = {
             event = 100002
             NOT = { exists = ENG }
}
name = "English Civil War"
desc = "The civil war has ended and England allows our independence, as well as cedes us our ancient lands."
date = { year = 1419 }
offset = 1
deathdate = { day = 29 month = december year = 1430 }

action_a ={
name = "A great day for Scotland"
command = { type = independence which = ENG }
command = { type = trigger which = 100008 }
}
}

And remember, the style = 1 line is irrelevant, save yourself the trouble.
 
Well, it works, but the problem now is, the peace doesn't come out the way I wanted it to....as Scotland annexes England, everyone else in the alliance who holds any part of England gets to own that part....and then when England is created again, they still keep it. Methinks I'll forget about the events altogether and just save-game edit. Would seem to save alot of trouble.

Thanks for the help anyways, everyone. Much appreciated :)
 
Victor1234 said:
Well, it works, but the problem now is, the peace doesn't come out the way I wanted it to....as Scotland annexes England, everyone else in the alliance who holds any part of England gets to own that part....and then when England is created again, they still keep it. Methinks I'll forget about the events altogether and just save-game edit. Would seem to save alot of trouble.

Thanks for the help anyways, everyone. Much appreciated :)

If the problem is only to get a peace with an enemy who would not accept any reasonable peace offer then the solution is simple.

Save your game. Start the game and right-click the shield of your country to start the game as said enemy. Make the offer you like to your former own country. Save game. Start game again as you own country.

Or did I misunderstand the problem?
 
Sort of misunderstood it, ya. The ideal situation I wanted to see would be several AI countries (England, Scotland, etc) fighting at the start of the scenario, then when one of them wins (shown by them controlling certain provinces), the events fire and end the war. All during this, I'm a third country not involved in the war, only watching. Thanks anyway, though.

The problem was, I was sort of used to Victoria/HOI2 editing where there's a larger variety of commands, such as one that ends a war and expected the same would be possible in EU2 without a round-about way event chain. Now I've changed my plans though, so I'll simply save-game edit after the event fires to remove their culture/cores.
 
Unfortunately there are a lot of event commands "missing" in EU2. :( I think the only option we have is to beg for another patch.

The inheritance/independence/breakvassal chain is IMHO a rather bad option. This will cause the "losing" contry to have the same techlevel as the "winning" one, changes ownership of all armies and clears all treaties and relations of the "losing" country.

You could, however, wait for the two countries to signs some other kind of peace and then force them to give back all provinces they might have conquered in an event.