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

Monarch1st

Captain
12 Badges
Oct 29, 2004
374
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Europa Universalis III Complete
  • For the Motherland
  • Hearts of Iron III
  • Europa Universalis III Complete
  • Majesty 2
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • Semper Fi
  • 500k Club
  • Hearts of Iron IV Sign-up
How do I make an event to switch province owners?
E.g. Say I want Curacao to be owned by Germany. If I do it in the saved file, I'd look for HOL country, then find the controlledprovinces list, and delete 801 from there. Then look for GER, find controlledprovinces, and stick 801 in there.

Doesn't sound that hard really. Parameters are country_from, province_id, country_to, and after a couple of checks, delete it from the country_from controlledprovinces list and insert it into the country_to controlledprovinces list. Sounds easy, if you know the specific commands...which I don't.
Would someone show me the specific commands to use?
 
Would someone show me the specific commands to use?

Code:
command = { type = secedeprovince which = GER value = 801 }

You may want to look at the bitter peace events in /db/events/USSR.txt. It is an event that occurs to soviet union and makes it give away many provinces. You can see that for the same province the commands exists for many nations. The nation that controls the provinces will get it then. If it is still controlled by the current owner the last command will work. That is why for most provinces germany is listed last in the bitter peace events. Secede provinces does change ownership and if needed control. If for some reason you want to only change control that can be done aswell:

Code:
command = { type = control which = GER value = 801 }

That probably is not interesting in the case you have in mind. Please be aware that AI may not be suited too well to deal with highly ahistorical circumtances.