From: Vancouver, BC
I have recently been working on a small mod to create a small break-away state in northern Greece that joins the Entente, on the basis of a Decision Event. This posed for me the general challenge of how to create new countries using the Game Editor.
After extensive correspondence with Bill, who was extremely helpful, I have think I have figured out how to do this. The key points seem to be as follows.
1) You can't actually create an entirely new country - you have to use one of the countries for which there is a code already in the Game Editor. Fortunately, the Editor lists many countries that do not exist on the WW1 map. So, in my case, I used The Free State of Danzig as the proxy and employed its country code.
2) To bring this new country to life, you first have to transfer hexes to it using a Territory script. I modelled mine on the Finland Declares Independence Script, but you can look at the other examples already there.
3) A key point in writing the Territory script is that the first hex in the list of hexes to be transferred has to be the hex containing the city that will be the new capital of the country. It seems the Editor understands that city will be the capital. I was not able to add the Capital, or designate Alternate Capitals, using the Country Data screen in the Editor.
4) I then wrote a Mobilization #3 script which gave the new country its alignment in the game, based on a Decision Event which triggered its creation.
5) I also wrote a Unit script to create a new corps to defend the new capital of the newly independent country.
And it worked! When I say YES to the Decision Event, a new border appears, I get a pop-up saying that Danzig has mobilized and a new corps with Danzig colours appears on the map.
Curiously, since this new state does not exist in the Diplomacy pull-down menu, neither side can DOW it, or use diplomacy to influence it. But its Major parent can buy produce new units there, if you add units to the Build menu for it under the Country Data screen.
I would be interested to hear about the experiences of other players in creating or recreating new countries in your mods.