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

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.865
152.704
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
This is a small event that forces the AI to demobilize after about a month at peace. The reason I originally wrote this was to fix the issue with my liege lord keeping my troops forever, but it also has some other nice effects like speeding the game up a bit and making the AI countries not be constantly bankrupt.

To install, first add the following line to /db/events.txt

Code:
event = "db\events\ai_demobilize.txt"

Then create a file called ai_demobilize.txt in /db/events and paste this into it
Code:
# Makes AI demobilize during peace times

character_event = {
	id = 9500

	picture = "event_agriculture"
	
	trigger = {
		condition = { type = ai }
		condition = { type = ruler }
		condition = { type = not value = { type = atwar } }
		condition = { type = not value = { type = culture value = mongol } }
		condition = { type = not value = { type = any_demesne_province condition = { type = is_besieged } } }
		condition = { type = or
			condition = { type = any_demesne_province
				condition = { type = regiment_mobilized }
			}	
			condition = { type = any_vassal
				condition = { type = any_demesne_province
					condition = { type = regiment_mobilized }
				}
			}
		}
	}

	mean_time_to_happen = {
		days = 30
	}
	
	immidiate = {
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }
		effect = { type = remove_regiment }		
	}
}

Alternate string text for modtext.csv, not really needed since its AI-only

Code:
EVT_9500_NAME;We are not at war. Our armies return home.;;;;;;;;;;X
ACTIONNAME9500A;So be it.;;;;;;;;;;X

And you're done!
 
Last edited:
jordarkelf said:
You realize this makes it (even more) impossible for the AI to tackle province rebellions?
I would only let this fire if vassal troops are raised, not for the liege's own troops.

I honestly haven't seen much of a difference, either the AI raises a neighbouring regiment and deals with it before this hits, or they just blithely ignore it anyway. But you have a point, so I edited the event not to fire if any of the ai country's provinces is under siege (ie rebels are afoot)

I'd rather keep it for the liege, since the AI just doesn't understand that there is no point to having 50000 men sitting around during ten years of peace and it really hurts its ability to build province improvments.
 
Last edited:
Wiz said:
I honestly haven't seen much of a difference, either the AI raises a neighbouring regiment and deals with it before this hits, or they just blithely ignore it anyway. But you have a point, so I edited the event not to fire if any of the ai country's provinces is under siege (ie rebels are afoot)

I'd rather keep it for the liege, since the AI just doesn't understand that there is no point to having 50000 men sitting around during ten years of peace and it really hurts its ability to build province improvments.
Good idea for a fix. I'll add this event to my game :)
 
What about regiment strenght? Will one month be enough for the regiments to reach their realm in order to retain their relative strenght or would you consider this just a minor issue? To my knowledge ai players follow the same rules as human players in that regiments will diminish considerably when they are disbanded abroad. Of course they get reinforcements in the mean time in their respective provinces, but I still think that it takes quite a lot of time to rebuild these "war winning" armies, although this depends on time and casualties.

Great script btw. I just had to register when I saw this and all other marvelous improvements. :cool:

Ps. What kind of changes are save game compatible?
 
Last edited:
Vanaja said:
What about regiment strenght? Will one month be enough for the regiments to reach their realm in order to retain their relative strenght or would you consider this just a minor issue? To my knowledge ai players follow the same rules as human players in that regiments will diminish considerably when they are disbanded abroad. Of course they get reinforcements in the mean time in their respective provinces, but I still think that it takes quite a lot of time to rebuild these "war winning" armies, although this depends on time and casualties.

Great script btw. I just had to register when I saw this and all other marvelous improvements. :cool:

Ps. What kind of changes are save game compatible?

The event sends the regiments back to the province at whatever strength they were at the exact moment that it hit (tested this since I was concered about it myself), so it does not diminish AI armies in any way.
 
Hmm...i think this should be tweaked somewhat. Specifically it should be made either not to fire for mongols or increase the MTTH for them.

It's quite possible with a mtth of 30 days for this to fire before they DoW after appearing.
 
Jinnai said:
Hmm...i think this should be tweaked somewhat. Specifically it should be made either not to fire for mongols or increase the MTTH for them.

It's quite possible with a mtth of 30 days for this to fire before they DoW after appearing.

Oh, that's true, I didn't consider the mongols and their magical no attrition armies. Do you know which tags are mongol?

EDIT: Nevermind, I just made it a culture check. Done.
 
Thank you for the info. I hope that the coming patch will be compatible with the majority of mods. Or even better include some of them.
 
Last edited:
Does the 2.1 beta patch from Octobre already include this event or would I still need to manually add it?
 
I did the first two steps but where do I find the file modtext.csv to add the text?

That file should be in the Crusader kings/config folder, but only if you already have installed a mod. If you can't find it then it means you must create the file yourself.

Copy and paste the lines providec by Wiz onto a empty Wordpad or Notepad page. Then save the file as "modtext.csv" (you must put modtext.csv between " ", else it will save the file as a .txt-file)

But it is an AI-event only, so the need for adding these lines isn't that important since you won't see the event fire fpr yourself
 
That file should be in the Crusader kings/config folder, but only if you already have installed a mod. If you can't find it then it means you must create the file yourself.

I have not downloaded any mod yet, so I created it myself.

Perhaps a stupid question but is there any reason that all those files to be modified are "schreibgeschützt"/readonly? I find it cumbersome to always remove and add it again, as it´s now the 3rd time that I added an event here from the forums.

Do I need to activate the readonly attribute of files after editing something for CK to run without problems?