Skip to content

Commit

Permalink
Fixes for new minimum formID
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Aug 28, 2024
1 parent 16a7c76 commit c2c2c8c
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 46 deletions.
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Mutagen.Bethesda.Core">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Fallout4">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Skyrim">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Starfield">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Oblivion">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Testing">
<Version>0.46.0.1-nightly-20240826-095673</Version>
<Version>0.46.0.1-nightly-20240827-232520</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Serialization" Version="[$(Version)]" />
<PackageVersion Include="Mutagen.Bethesda.Serialization.Newtonsoft" Version="[$(Version)]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public async Task Test()
var metaData = new SerializationMetaData(GameRelease.Fallout4, new InlineWorkDropoff(), IFileSystemExt.DefaultFilesystem, NormalFileStreamCreator.Instance, CancellationToken.None);
var a = await Fallout4ModHeader_Serialization.Deserialize(dataWriter, kernel, metaData);
a.Stats.NumRecords.Should().Be(0);
a.Stats.NextFormID.Should().Be(0x1);
a.Stats.NextFormID.Should().Be(0x0);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"FormKey": "000001:Mod0.esp",
"FormKey": "000000:Mod0.esp",
"EditorID": "TestCell"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000003:Mod0.esp",
"FormKey": "000002:Mod0.esp",
"EditorID": "Placed2",
"Health": 0.45
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000002:Mod0.esp",
"FormKey": "000001:Mod0.esp",
"EditorID": "Placed1",
"Health": 0.23
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"FormKey": "000002:modKey.esp",
"FormKey": "000001:modKey.esp",
"EditorID": "TestCell"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000004:modKey.esp",
"FormKey": "000003:modKey.esp",
"EditorID": "Placed2",
"Health": 0.45
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000003:modKey.esp",
"FormKey": "000002:modKey.esp",
"EditorID": "Placed1",
"Health": 0.23
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"FormKey": "000001:modKey.esp",
"FormKey": "000000:modKey.esp",
"EditorID": "MyWorldspace",
"SubCellsTimestamp": 123
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,23 @@ await SerializationHelper.AddBlocksToWork<NewtonsoftJsonSerializationWriterKerne
settings.UseFileName($"{nameof(AddBlocksToWork)}_1_6_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(oneSixHeaderDataPath), settings);

var cellDirPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp");
var cellDirPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp");
fileSystem.Directory.Exists(cellDirPath).Should().BeTrue();
var cellPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp", "RecordData.json");
var cellPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp", "RecordData.json");
fileSystem.File.Exists(cellPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddBlocksToWork)}_1_6_TestEdid.json");
await Verifier.Verify(fileSystem.File.ReadAllText(cellPath), settings);

var tempPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp", "Temporary");
var tempPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp", "Temporary");
fileSystem.Directory.Exists(tempPath).Should().BeTrue();
var placed1Path = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp", "Temporary", "[0] Placed1 - 000002_Mod0.esp.json");
var placed1Path = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp", "Temporary", "[0] Placed1 - 000001_Mod0.esp.json");
fileSystem.File.Exists(placed1Path).Should().BeTrue();
settings.UseFileName($"{nameof(AddBlocksToWork)}_1_6_TestEdid_Temporary_Placed1.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed1Path), settings);

var perstPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp", "Persistent");
var perstPath = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp", "Persistent");
fileSystem.Directory.Exists(perstPath).Should().BeTrue();
var placed2Path = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000001_Mod0.esp", "Persistent", "[0] Placed2 - 000003_Mod0.esp.json");
var placed2Path = Path.Combine(existingDir, "Cells", "[0] 1", "[1] 6", "[0] TestCell - 000000_Mod0.esp", "Persistent", "[0] Placed2 - 000002_Mod0.esp.json");
fileSystem.File.Exists(placed2Path).Should().BeTrue();
settings.UseFileName($"{nameof(AddBlocksToWork)}_1_6_TestEdid_Persistent_Placed2.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed2Path), settings);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"FormKey": "000002:modKey.esp",
"FormKey": "000001:modKey.esp",
"EditorID": "TestCell"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000004:modKey.esp",
"FormKey": "000003:modKey.esp",
"EditorID": "Placed2",
"Health": 0.45
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"MutagenObjectType": "PlacedNpc",
"FormKey": "000003:modKey.esp",
"FormKey": "000002:modKey.esp",
"EditorID": "Placed1",
"Health": 0.23
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"FormKey": "000001:modKey.esp",
"FormKey": "000000:modKey.esp",
"EditorID": "MyWorldspace",
"SubCellsTimestamp": 123
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,59 +115,59 @@ await SerializationHelper.AddXYBlocksToWork<NewtonsoftJsonSerializationWriterKer
withNumbering: true);

fileSystem.Directory.Exists(Path.Combine(existingDir, "Worldspaces")).Should().BeTrue();
fileSystem.Directory.Exists(Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp")).Should().BeTrue();
fileSystem.Directory.Exists(Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp")).Should().BeTrue();

var headerDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "RecordData.json");
var headerDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "RecordData.json");
fileSystem.File.Exists(headerDataPath).Should().BeTrue();
var settings = new VerifySettings();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(headerDataPath), settings);

var fourFiveFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5");
var fourFiveFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5");
fileSystem.Directory.Exists(fourFiveFolder).Should().BeTrue();
var fourFiveHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "GroupRecordData.json");
var fourFiveHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "GroupRecordData.json");
fileSystem.File.Exists(fourFiveHeaderDataPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(fourFiveHeaderDataPath), settings);

var fourSixFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[1] 4, 6");
var fourSixFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[1] 4, 6");
fileSystem.Directory.Exists(fourSixFolder).Should().BeTrue();
var fourSixHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[1] 4, 6", "GroupRecordData.json");
var fourSixHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[1] 4, 6", "GroupRecordData.json");
fileSystem.File.Exists(fourSixHeaderDataPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_6_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(fourSixHeaderDataPath), settings);

var fourFiveThreeNineFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[0] 3, 9");
var fourFiveThreeNineFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[0] 3, 9");
fileSystem.Directory.Exists(fourFiveThreeNineFolder).Should().BeTrue();
var fourFiveThreeNineHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[0] 3, 9", "GroupRecordData.json");
var fourFiveThreeNineHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[0] 3, 9", "GroupRecordData.json");
fileSystem.File.Exists(fourFiveThreeNineHeaderDataPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_3_9_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(fourFiveThreeNineHeaderDataPath), settings);

var fourFiveSixFourFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[1] 6, 4");
var fourFiveSixFourFolder = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[1] 6, 4");
fileSystem.Directory.Exists(fourFiveSixFourFolder).Should().BeTrue();
var fourFiveSixFourHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[1] 6, 4", "GroupRecordData.json");
var fourFiveSixFourHeaderDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[1] 6, 4", "GroupRecordData.json");
fileSystem.File.Exists(fourFiveSixFourHeaderDataPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_6_4_GroupRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(fourFiveSixFourHeaderDataPath), settings);

var cellDirPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[1] 6, 4", "[0] TestCell - 000002_modKey.esp");
var cellDirPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[1] 6, 4", "[0] TestCell - 000001_modKey.esp");
fileSystem.Directory.Exists(cellDirPath).Should().BeTrue();
var cellDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000001_modKey.esp", "[0] 4, 5", "[1] 6, 4", "[0] TestCell - 000002_modKey.esp", "RecordData.json");
var cellDataPath = Path.Combine(existingDir, "Worldspaces", "[0] MyWorldspace - 000000_modKey.esp", "[0] 4, 5", "[1] 6, 4", "[0] TestCell - 000001_modKey.esp", "RecordData.json");
fileSystem.File.Exists(cellDataPath).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_6_4_TestCellRecordData.json");
await Verifier.Verify(fileSystem.File.ReadAllText(cellDataPath), settings);

var tempPath = Path.Combine(cellDirPath, "Temporary");
fileSystem.Directory.Exists(tempPath).Should().BeTrue();
var placed1Path = Path.Combine(tempPath, "[0] Placed1 - 000003_modKey.esp.json");
var placed1Path = Path.Combine(tempPath, "[0] Placed1 - 000002_modKey.esp.json");
fileSystem.File.Exists(placed1Path).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_6_4_TestCell_Temporary_Placed1.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed1Path), settings);

var persistentPath = Path.Combine(cellDirPath, "Persistent");
fileSystem.Directory.Exists(persistentPath).Should().BeTrue();
var placed2Path = Path.Combine(persistentPath, "[0] Placed2 - 000004_modKey.esp.json");
var placed2Path = Path.Combine(persistentPath, "[0] Placed2 - 000003_modKey.esp.json");
fileSystem.File.Exists(placed2Path).Should().BeTrue();
settings.UseFileName($"{nameof(AddXYBlocksToWork)}_4_5_6_4_TestCell_Persistent_Placed2.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed2Path), settings);
Expand Down Expand Up @@ -259,14 +259,14 @@ await SerializationHelper.AddXYBlocksToWork<NewtonsoftJsonSerializationWriterKer

var tempPath = Path.Combine(cellDirPath, "Temporary");
fileSystem.Directory.Exists(tempPath).Should().BeTrue();
var placed1Path = Path.Combine(tempPath, "[0] Placed1 - 000003_modKey.esp.json");
var placed1Path = Path.Combine(tempPath, "[0] Placed1 - 000002_modKey.esp.json");
fileSystem.File.Exists(placed1Path).Should().BeTrue();
settings.UseFileName($"{nameof(TopLevelRecord)}_4_5_6_4_TestCell_Temporary_Placed1.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed1Path), settings);

var persistentPath = Path.Combine(cellDirPath, "Persistent");
fileSystem.Directory.Exists(persistentPath).Should().BeTrue();
var placed2Path = Path.Combine(persistentPath, "[0] Placed2 - 000004_modKey.esp.json");
var placed2Path = Path.Combine(persistentPath, "[0] Placed2 - 000003_modKey.esp.json");
fileSystem.File.Exists(placed2Path).Should().BeTrue();
settings.UseFileName($"{nameof(TopLevelRecord)}_4_5_6_4_TestCell_Persistent_Placed2.json");
await Verifier.Verify(fileSystem.File.ReadAllText(placed2Path), settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"GameRelease": "Fallout4",
"ModHeader": {
"Stats": {
"NextFormID": 3
"NextFormID": 2
}
},
"Npcs": {
"Records": [
{
"FormKey": "000001:InputMod.esp",
"FormKey": "000000:InputMod.esp",
"Level": {
"MutagenObjectType": "PcLevelMult",
"LevelMult": 1.3
Expand All @@ -20,7 +20,7 @@
}
},
{
"FormKey": "000002:InputMod.esp",
"FormKey": "000001:InputMod.esp",
"Level": {
"MutagenObjectType": "NpcLevel"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ ModKey: InputMod.esp
GameRelease: Fallout4
ModHeader:
Stats:
NextFormID: 3
NextFormID: 2
Npcs:
Records:
- FormKey: 000001:InputMod.esp
- FormKey: 000000:InputMod.esp
Level:
MutagenObjectType: PcLevelMult
LevelMult: 1.3
Name:
TargetLanguage: English
Value: Goblin
- FormKey: 000002:InputMod.esp
- FormKey: 000001:InputMod.esp
Level:
MutagenObjectType: NpcLevel
Attacks:
Expand Down

0 comments on commit c2c2c8c

Please sign in to comment.