Skip to content

Commit 175aa92

Browse files
authored
Restore support for the Asia Expansion Project mod (#2614)
AEP has been updated for CK3 1.16. https://steamcommunity.com/workshop/filedetails/?id=2970440958
1 parent 7323690 commit 175aa92

File tree

12 files changed

+8167
-5
lines changed

12 files changed

+8167
-5
lines changed

ImperatorToCK3/CK3/World.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,13 @@ private void LoadCorrectProvinceMappingsFile(Imperator.World irWorld, Configurat
460460
bool irHasTI = irWorld.TerraIndomitaDetected;
461461

462462
bool ck3HasRajasOfAsia = config.RajasOfAsiaEnabled;
463+
bool ck3HasAEP = config.AsiaExpansionProjectEnabled;
463464

464465
string mappingsToUse;
465466
if (irHasTI && ck3HasRajasOfAsia) {
466467
mappingsToUse = "terra_indomita_to_rajas_of_asia";
468+
} else if (irHasTI && ck3HasAEP) {
469+
mappingsToUse = "terra_indomita_to_aep";
467470
} else if (irWorld.InvictusDetected) {
468471
mappingsToUse = "imperator_invictus";
469472
} else {

ImperatorToCK3/Configuration.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public sealed class Configuration {
3131
public bool FallenEagleEnabled { get; private set; }
3232
public bool WhenTheWorldStoppedMakingSenseEnabled { get; private set; }
3333
public bool RajasOfAsiaEnabled { get; private set; }
34+
public bool AsiaExpansionProjectEnabled { get; private set; }
3435

3536
public bool OutputCCUParameters => WhenTheWorldStoppedMakingSenseEnabled || FallenEagleEnabled || RajasOfAsiaEnabled;
3637

@@ -319,16 +320,17 @@ public void DetectSpecificCK3Mods(ICollection<Mod> loadedMods) {
319320
WhenTheWorldStoppedMakingSenseEnabled = true;
320321
Logger.Info($"WtWSMS detected: {wtwsmsMod.Name}");
321322
}
322-
323+
323324
var roaMod = loadedMods.FirstOrDefault(m => m.Name.StartsWith("Rajas of Asia", StringComparison.Ordinal));
324325
if (roaMod is not null) {
325326
RajasOfAsiaEnabled = true;
326327
Logger.Info($"RoA detected: {roaMod.Name}");
327328
}
328-
329+
329330
var aepMod = loadedMods.FirstOrDefault(m => m.Name.StartsWith("Asia Expansion Project", StringComparison.Ordinal));
330331
if (aepMod is not null) {
331-
throw new UserErrorException("Asia Expansion Project is no longer supported because it's not updated for the current version of CK3. See AEP's description on Steam Workshop.");
332+
AsiaExpansionProjectEnabled = true;
333+
Logger.Info($"AEP detected: {aepMod.Name}");
332334
}
333335
}
334336

@@ -338,6 +340,7 @@ public OrderedDictionary<string, bool> GetCK3ModFlags() {
338340
["tfe"] = FallenEagleEnabled,
339341
["wtwsms"] = WhenTheWorldStoppedMakingSenseEnabled,
340342
["roa"] = RajasOfAsiaEnabled,
343+
["aep"] = AsiaExpansionProjectEnabled,
341344
};
342345

343346
flags["vanilla"] = !flags.Any(f => f.Value);

ImperatorToCK3/Data_Files/configurables/converter_cultures.txt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ qin = {
110110
}
111111

112112
MOD_DEPENDENT = {
113-
IF roa = {
113+
IF aep = {
114+
ethnicities = {
115+
10 = east_asian_chinese_north
116+
}
117+
}
118+
ELSE_IF roa = {
114119
# copied from han
115120
ethnicities = {
116121
2 = east_asian_han_1
@@ -127,7 +132,19 @@ qin = {
127132
}
128133

129134
MOD_DEPENDENT = {
130-
IF tfe = {
135+
IF aep = {
136+
coa_gfx = {
137+
chinese_group_coa_gfx
138+
}
139+
building_gfx = {
140+
chinese_building_gfx
141+
}
142+
clothing_gfx = {
143+
chinese_clothing_gfx
144+
}
145+
unit_gfx = { chinese_unit_gfx }
146+
}
147+
ELSE_IF tfe = {
131148
# copied from han
132149
coa_gfx = { chinese_group_coa_gfx }
133150
building_gfx = { chinese_building_gfx indian_building_gfx }

ImperatorToCK3/Data_Files/configurables/cultural_pillars/IRToCK3_heritage.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ heritage_palaungic = {
323323
heritage_mon_khmer = { # from Rajas of Asia
324324
REPLACED_BY = {
325325
roa = { heritage_mon_khmer }
326+
aep = { heritage_khmer }
326327
wtwsms = { heritage_burman } # In WtWSMS, heritage_burman is localized as "Southeast Asian"
327328
}
328329
type = heritage

ImperatorToCK3/Data_Files/configurables/inventions_to_innovations_map.liquid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# Supported CK3 mod flags for conditional blocks:
1313
# tfe (The Fallen Eagle)
1414
# wtwsms (When the World Stopped Making Sense)
15+
# aep (Asia Expansion Project)
1516
# vanilla (Vanilla CK3)
1617

1718

ImperatorToCK3/Data_Files/configurables/province_mappings/terra_indomita_to_aep.txt

Lines changed: 7988 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# This file contains blocks from the Asia Expansion Project files that can be removed.
2+
# The structure is as follows:
3+
4+
# <file name> = {
5+
# {
6+
# # comments are supported inside
7+
# some = code
8+
# }
9+
# {
10+
# some code
11+
# some code with other indent
12+
# }
13+
# }
14+
15+
# INDENTATION IS IMPORTANT!
16+
# ASIDE FROM THE CURLY BRACKETS SURROUNDING THE BLOCK, IT MUST MATCH THE ORIGINAL FILE.
17+
# OTHERWISE THE BLOCK WON'T BE REMOVED!
18+
19+
20+
"common/scripted_character_templates/AEP_pool_repopulate_local_flavor.txt" = {
21+
# Prevent random Muslim characters being generated.
22+
{
23+
else_if = {
24+
limit = {
25+
OR = {
26+
culture = culture:butr
27+
culture = culture:zaghawa
28+
}
29+
}
30+
random_list = {
31+
10 = {
32+
set_character_faith = faith:ibadi
33+
}
34+
10 = {
35+
set_character_faith = faith:sufri
36+
}
37+
}
38+
}
39+
}
40+
{
41+
else_if = {
42+
limit = {
43+
OR = {
44+
culture = culture:bolghar
45+
culture = culture:somali
46+
}
47+
}
48+
set_character_faith = faith:ashari
49+
if = {
50+
limit = {
51+
root.capital_county.faith = {
52+
religion_tag = islam_religion
53+
}
54+
}
55+
set_character_faith = root.capital_county.faith
56+
}
57+
}
58+
}
59+
60+
# Prevent random Christian characters being generated.
61+
{
62+
2 = {
63+
trigger = {
64+
root.capital_province.faith = {
65+
religion_tag = christianity_religion
66+
}
67+
root.capital_province = {
68+
geographical_region = world_europe_west_iberia
69+
}
70+
}
71+
set_character_faith = faith:conversos
72+
}
73+
}
74+
{
75+
else_if = {
76+
limit = {
77+
culture = culture:greek
78+
}
79+
random_list = {
80+
10 = {
81+
set_character_faith = faith:iconoclast
82+
}
83+
10 = {
84+
set_character_faith = faith:paulician
85+
}
86+
10 = {
87+
set_character_faith = faith:bogomilist
88+
}
89+
}
90+
}
91+
}
92+
{
93+
5 = {
94+
set_character_faith = faith:nestorian
95+
}
96+
}
97+
{
98+
else_if = {
99+
limit = {
100+
culture = culture:assyrian
101+
}
102+
set_character_faith = faith:nestorian
103+
}
104+
}
105+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file contains blocks from the Asia Expansion Project files that can be replaced with new ones.
2+
# The structure is as follows:
3+
4+
# <file name> = {
5+
# replace = {
6+
# before = {
7+
# some original code
8+
# }
9+
# after = {
10+
# some modified code
11+
# }
12+
# }
13+
#
14+
# replace = {
15+
# before = {
16+
# some original code 2
17+
# }
18+
# after = {
19+
# some modified code 2
20+
# }
21+
# }
22+
# }
23+
24+
# INDENTATION IS IMPORTANT INSIDE the before BLOCK!
25+
# ASIDE FROM THE CURLY BRACKETS SURROUNDING THE BLOCK, IT MUST MATCH THE ORIGINAL FILE.
26+
# OTHERWISE THE BLOCKS WON'T BE MODIFIED!
27+

ImperatorToCK3/Data_Files/configurables/succession_law_map.liquid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Supported CK3 mod flags for conditional blocks:
1919
# tfe (The Fallen Eagle)
2020
# wtwsms (When the World Stopped Making Sense)
21+
# aep (Asia Expansion Project)
2122
# vanilla (Vanilla CK3)
2223

2324

ImperatorToCK3/Data_Files/converter_globals/FAQ.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ A: The converter officially supports these Imperator mods:
2727
The converter also supports these CK3 mods:
2828
- The Fallen Eagle (https://steamcommunity.com/sharedfiles/filedetails/?id=2243307127)
2929
- When the World Stopped Making Sense (https://steamcommunity.com/sharedfiles/filedetails/?id=2858562094)
30+
- Asia Expansion Project (https://steamcommunity.com/workshop/filedetails/?id=2970440958)
3031
As for other mods, unless they change the map or how cultures, religions or flags work, you can probably use them.
3132
Total map overhauls are not supported (of course), and whatever new cultures and religions are brought by the mod - you'll have to add manually in the files in configurables folder.
3233

ImperatorToCK3/Outputter/BookmarkOutputter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ public static async Task OutputBookmark(World world, Configuration config, CK3Lo
5858
await using var output = FileHelper.OpenWriteWithRetries(path, Encoding.UTF8);
5959
await output.WriteAsync(sb.ToString());
6060

61+
if (config.AsiaExpansionProjectEnabled) {
62+
// Remove the AEP bookmarks.
63+
var dummyAEPBookmarksOutputPath = Path.Combine("output", config.OutputModName, "common/bookmarks/bookmarks/00_AEP_bookmarks.txt");
64+
await using var dummyAEPBookmarksOutput = FileHelper.OpenWriteWithRetries(dummyAEPBookmarksOutputPath, Encoding.UTF8);
65+
await dummyAEPBookmarksOutput.WriteAsync("# IRToCK3: Removed AEP bookmarks.");
66+
}
67+
6168
await DrawBookmarkMap(config, playerTitles, world);
6269
Logger.IncrementProgress();
6370
}

ImperatorToCK3/Outputter/FileTweaker.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ public static async Task ModifyAndRemovePartsOfFiles(ModFilesystem ck3ModFS, str
4848
ReadPartsOfFileToReplace(partsToModifyPerFile, "configurables/replaceable_file_blocks_roa.txt", warnIfNotFound: true);
4949
}
5050

51+
if (config.AsiaExpansionProjectEnabled) {
52+
Logger.Info("Reading unneeded parts of Rajas of Asia files...");
53+
ReadPartsOfFileToRemove(partsToModifyPerFile, "configurables/removable_file_blocks_aep.txt", warnIfNotFound: true);
54+
55+
Logger.Info("Reading parts of Asia Expansion Project files to modify...");
56+
ReadPartsOfFileToReplace(partsToModifyPerFile, "configurables/replaceable_file_blocks_aep.txt", warnIfNotFound: true);
57+
}
58+
5159
if (config.WhenTheWorldStoppedMakingSenseEnabled) {
5260
Logger.Info("Reading unneeded parts of When the World Stopped Making Sense files...");
5361
ReadPartsOfFileToRemove(partsToModifyPerFile, "configurables/removable_file_blocks_wtwsms.txt", warnIfNotFound: true);

0 commit comments

Comments
 (0)