Tricks with Civs/CSs removed at game start: are "non-map" civs possible?

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
I believe that Gedemon and others use a trick where they init the game with extra civilizations and city states, then remove their units at game start. This allows these civs and CSs to be added back into the game at some later time. I believe that these missing civs/CSs return false from player:IsAlive() and that they don't trigger GameEvents.PlayerDoTurn (but I'm not sure about either of those points).

Can these missing civs and city states be contacted? Obviously, they are missing from the UI so this isn't possible without some more modding. But it's easy enough to modify UI to put them there, and the UI can then attempt to trigger the civ trade screen (or the CS popup) via Lua just as any "real" civ. Does anyone know what happens if you do this? I could easily imagine either of two outcomes: works fine (because the game engine assumes that you have checked living status before the call so it doesn't need to) or crash (some code gets a bad value).

The reason I'm asking is that I need to implement an "invisible" civilization (The Fey) that can only be contacted with a certain policy. I also want to add a dozen or so "gods" that are really city states (giving quests and so forth) but not on the map and not contactable for most players (only when I allow it via Lua).

One way for me to do this is to place all of these civs (the Fey and the gods) at the south pole and build a truly impassible wall of mountains around them. I'll do it that way if necessary, but I hope I don't have to. Please share if you have any relevant info.
 
Some functions will crash when used on a dead player, so I'm not sure that it could work. Your workaround is the first thing that come to me if not.
 
Couldn't you try giving the <StaysAliveZeroCities> for the trait for the leader of your Civ? It wouldn't help with the CSs, because they don't get leaders or traits, but it will keep your invisible civilization alive, even with no units.
 
Back
Top Bottom