LUA - Adding a Civ to a Scenario before Game Start

sman1975

Emperor
Joined
Aug 27, 2016
Messages
1,370
Location
Dallas, TX
Greetings,

I have a completed MOD that uses a Worldbuilder map - with 7 player civs defined in the "Scenario Editor" of the map. Everything works great.

A few people have asked about adding some minor player civs to the mod.

I'm toying with the idea of building an "expansion pack" that adds 4-5 smaller player civs - but as a SEPARATE mod. The expansion pack would have a "dependency" set to the main MOD.

If someone didn't want to play the main mod with these smaller civs, they didn't need to (and save a LOT of load time).

However, if someone wanted to play as one of the minor civs, they would activate both mods before game start.

The problem: when you select the map, and check the "Load Scenario" button, the player civs from the expansion pack don't appear in the list of player civs for the scenario, as they aren't defined/used in the "Scenario Editor" for that map in the main MOD.

All the data for the expansion player civs loads successfully in the database, so it is available when setting up the scenario. So, the XML part is working fine, and I don't need code to build a civ from scratch on the fly.

Have experimented around with a few functions/events, such as "PreGame.SetCivilization" but can't seem to find the right method to get it to fire before the list of civs to play appear. "AfterModsActivate" doesn't seem to work.

Does anyone have a suggestion on how to add player civs to the "Select Civilization" list if they don't appear in the "Scenario Builder" on WorldBuilder?

Many thanks!
 
Top Bottom