I will do further research, thank you both for the replies.
Before I proceed, I want to clearly lay out what I'm trying to do, to gauge if it is theoretically possible. Sorry if it's redundant.
(I'm currently working on an Eastern Europe scenario, so I'll be using that as reference.)
Say I'm at war with the Austrian Empire, which consists of two cities: Vienna and Budapest. These are three different situations I'm trying to program:
1) I capture Vienna. Budapest then automatically becomes the capital of a new "Hungarian Empire" which was previously "inactive" and didn't have any cities or units on the map.
2) Instead of Vienna, I capture Budapest. I am then given the option to liberate the city to the Hungarian Empire.
3) During my war with Austria, unhappiness in Budapest gets too high, and it suddenly "breaks away" and becomes capital of the Hungarian Empire.
In each case, the Hungarian Empire would basically be a dormant Civilization that would only be spawned in Budapest if one of these three situations occurs.
EDIT: It looks like HR features something resembling #3 a great deal, so I'm primarily curious about #1 and #2.
Also, to clarify, I'd like to have those events happen regardless of who owns Budapest.
So say you're playing as Russia.
AI Germany conquers Vienna. The Hungarian Empire is spawned in Budapest, but Germany conquers that too.
You then go to war with AI Germany, and capture all of their original cities.
Budapest then breaks off into the Hungarian Empire again.
So what I'm saying is, I'd like the #1 event will occur whenever the Civilization that owns Budapest is conquered, regardless of who it is.