diff --git a/ARKBreedingStats/Form1.collection.cs b/ARKBreedingStats/Form1.collection.cs
index 508e29d8..00417884 100644
--- a/ARKBreedingStats/Form1.collection.cs
+++ b/ARKBreedingStats/Form1.collection.cs
@@ -857,7 +857,8 @@ private Creature ImportExportGunFiles(string[] filePaths, out bool creatureAdded
{
multipliersImportSuccessful = ImportExportGun.SetServerMultipliers(_creatureCollection, esm, Path.GetFileNameWithoutExtension(filePath));
serverImportResult = serverImportResultTemp;
- continue;
+ if (multipliersImportSuccessful == true)
+ continue;
}
importFailedCounter++;
@@ -896,28 +897,46 @@ private Creature ImportExportGunFiles(string[] filePaths, out bool creatureAdded
: c, oldName: alreadyExistingCreature?.name)).ToArray();
lastAddedCreature = newCreatures.LastOrDefault();
- if (lastAddedCreature != null)
+ var creatureWasAdded = lastAddedCreature != null;
+ if (creatureWasAdded)
{
creatureAdded = true;
// calculate level status of last added creature
DetermineLevelStatusAndSoundFeedback(lastAddedCreature, playImportSound);
- }
- _creatureCollection.MergeCreatureList(newCreatures, true);
- UpdateCreatureParentLinkingSort(false);
+ _creatureCollection.MergeCreatureList(newCreatures, true);
+ UpdateCreatureParentLinkingSort(false);
+
+ // apply naming pattern if needed. This can only be done after parent linking to get correct name pattern values related to parents
+ Species lastSpecies = null;
+ Creature[] creaturesOfSpecies = null;
+ foreach (var c in persistentCreaturesAndOldName)
+ {
+ copiedNameToClipboard = SetNameOfImportedCreature(c.creature, lastSpecies == c.creature.Species ? creaturesOfSpecies : null, out creaturesOfSpecies, new Creature(c.creature.Species, c.oldName), totalCreatureCount);
+ lastSpecies = c.creature.Species;
+ if (c.oldName == null) totalCreatureCount++; // if creature was added, increase total count for name pattern
+ }
+
+ UpdateListsAfterCreaturesAdded(Properties.Settings.Default.AutoImportGotoLibraryAfterSuccess);
- // apply naming pattern if needed. This can only be done after parent linking to get correct name pattern values related to parents
- Species lastSpecies = null;
- Creature[] creaturesOfSpecies = null;
- foreach (var c in persistentCreaturesAndOldName)
+ if (Properties.Settings.Default.AutoImportGotoLibraryAfterSuccess)
+ {
+ tabControlMain.SelectedTab = tabPageLibrary;
+ if (listBoxSpeciesLib.SelectedItem != null &&
+ listBoxSpeciesLib.SelectedItem != lastAddedCreature.Species)
+ listBoxSpeciesLib.SelectedItem = lastAddedCreature.Species;
+ SelectCreatureInLibrary(lastAddedCreature);
+ }
+ else
+ {
+ EditCreatureInTester(lastAddedCreature);
+ }
+ }
+ else if (multipliersImportSuccessful == true)
{
- copiedNameToClipboard = SetNameOfImportedCreature(c.creature, lastSpecies == c.creature.Species ? creaturesOfSpecies : null, out creaturesOfSpecies, new Creature(c.creature.Species, c.oldName), totalCreatureCount);
- lastSpecies = c.creature.Species;
- if (c.oldName == null) totalCreatureCount++; // if creature was added, increase total count for name pattern
+ SetCollectionChanged(true);
}
- UpdateListsAfterCreaturesAdded();
-
var resultText = (importedCounter > 0 || importFailedCounter > 0
? $"Imported {importedCounter} creatures successfully.{(importFailedCounter > 0 ? $"Failed to import {importFailedCounter} files. Last error:{Environment.NewLine}{lastError}" : $"{Environment.NewLine}Last file: {lastCreatureFilePath}")}"
: string.Empty)
@@ -927,16 +946,8 @@ private Creature ImportExportGunFiles(string[] filePaths, out bool creatureAdded
+ serverImportResult);
SetMessageLabelText(resultText, importFailedCounter > 0 || multipliersImportSuccessful == false ? MessageBoxIcon.Error : MessageBoxIcon.Information, lastCreatureFilePath);
-
- if (lastAddedCreature != null)
- {
- tabControlMain.SelectedTab = tabPageLibrary;
- if (listBoxSpeciesLib.SelectedItem != null &&
- listBoxSpeciesLib.SelectedItem != lastAddedCreature.Species)
- listBoxSpeciesLib.SelectedItem = lastAddedCreature.Species;
- _ignoreNextMessageLabel = true; // keep import message
- SelectCreatureInLibrary(lastAddedCreature);
- }
+ if (creatureWasAdded)
+ _ignoreNextMessageLabel = true; // ignore message of selected creature (is shown after some delay / debouncing)
return alreadyExistingCreature;
}
@@ -944,7 +955,7 @@ private Creature ImportExportGunFiles(string[] filePaths, out bool creatureAdded
///
/// Call after creatures were added (imported) to the library. Updates parent linkings, creature lists, set collection as changed
///
- private void UpdateCreatureParentLinkingSort(bool updateLists = true)
+ private void UpdateCreatureParentLinkingSort(bool updateLists = true, bool goToLibraryTab = false)
{
UpdateParents(_creatureCollection.creatures);
@@ -956,19 +967,19 @@ private void UpdateCreatureParentLinkingSort(bool updateLists = true)
UpdateIncubationParents(_creatureCollection);
if (updateLists)
- UpdateListsAfterCreaturesAdded();
+ UpdateListsAfterCreaturesAdded(goToLibraryTab);
}
///
/// Updates lists after creatures were added, recalculates library info, e.g. top stats.
///
- private void UpdateListsAfterCreaturesAdded()
+ private void UpdateListsAfterCreaturesAdded(bool goToLibraryTab)
{
// update UI
SetCollectionChanged(true);
UpdateCreatureListings();
- if (_creatureCollection.creatures.Any())
+ if (goToLibraryTab && _creatureCollection.creatures.Any())
tabControlMain.SelectedTab = tabPageLibrary;
// reapply last sorting
@@ -1038,19 +1049,24 @@ private void AsbServerDataSent(ProgressReportAsbServer data)
DetermineLevelStatusAndSoundFeedback(creature, Properties.Settings.Default.PlaySoundOnAutoImport);
_creatureCollection.MergeCreatureList(new[] { creature }, true);
- UpdateCreatureParentLinkingSort();
+ var gotoLibraryTab = Properties.Settings.Default.AutoImportGotoLibraryAfterSuccess;
+ UpdateCreatureParentLinkingSort(goToLibraryTab: gotoLibraryTab);
if (resultText == null)
resultText = $"Received creature from server: {creature}";
SetMessageLabelText(resultText, MessageBoxIcon.Information);
- tabControlMain.SelectedTab = tabPageLibrary;
- if (listBoxSpeciesLib.SelectedItem != null &&
- listBoxSpeciesLib.SelectedItem != creature.Species)
- listBoxSpeciesLib.SelectedItem = creature.Species;
- _ignoreNextMessageLabel = true;
- SelectCreatureInLibrary(creature);
+ if (gotoLibraryTab)
+ {
+ tabControlMain.SelectedTab = tabPageLibrary;
+ if (listBoxSpeciesLib.SelectedItem != null &&
+ listBoxSpeciesLib.SelectedItem != creature.Species)
+ listBoxSpeciesLib.SelectedItem = creature.Species;
+
+ _ignoreNextMessageLabel = true;
+ SelectCreatureInLibrary(creature);
+ }
return;
}
diff --git a/ARKBreedingStats/Form1.extractor.cs b/ARKBreedingStats/Form1.extractor.cs
index 52f89e7a..89ea89f5 100644
--- a/ARKBreedingStats/Form1.extractor.cs
+++ b/ARKBreedingStats/Form1.extractor.cs
@@ -256,13 +256,51 @@ private bool ExtractLevels(bool autoExtraction = false, bool statInputsHighPreci
ClearAll(_clearExtractionCreatureData);
var mutagenApplied = possiblyMutagenApplied || creatureInfoInputExtractor.CreatureFlags.HasFlag(CreatureFlags.MutagenApplied);
var bred = rbBredExtractor.Checked;
+ bool imprintingBonusChanged = false;
- _extractor.ExtractLevels(speciesSelector1.SelectedSpecies, (int)numericUpDownLevel.Value, _statIOs,
+ for (int i = 0; i < 2; i++)
+ {
+ _extractor.ExtractLevels(speciesSelector1.SelectedSpecies, (int)numericUpDownLevel.Value, _statIOs,
(double)numericUpDownLowerTEffBound.Value / 100, (double)numericUpDownUpperTEffBound.Value / 100,
rbTamedExtractor.Checked, bred,
(double)numericUpDownImprintingBonusExtractor.Value / 100, !cbExactlyImprinting.Checked,
- _creatureCollection.allowMoreThanHundredImprinting, _creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier,
- _creatureCollection.considerWildLevelSteps, _creatureCollection.wildLevelStep, statInputsHighPrecision, mutagenApplied, out bool imprintingBonusChanged);
+ _creatureCollection.allowMoreThanHundredImprinting,
+ _creatureCollection.serverMultipliers.BabyImprintingStatScaleMultiplier,
+ _creatureCollection.considerWildLevelSteps, _creatureCollection.wildLevelStep,
+ statInputsHighPrecision, mutagenApplied, out imprintingBonusChanged);
+
+ // wild claimed babies look like bred creatures in the export files, but have to be considered tamed when imported
+ // if the extraction of an exported creature doesn't work, try with tamed settings
+ if (bred && numericUpDownImprintingBonusExtractor.Value == 0 && statInputsHighPrecision)
+ {
+ var someStatsHaveNoResults = false;
+ var onlyStatsWithTEHaveNoResults = true;
+ // check if only stats affected by TE have no result
+ for (int s = 0; s < Stats.StatsCount; s++)
+ {
+ if (_extractor.Results[s].Count == 0)
+ {
+ someStatsHaveNoResults = true;
+ if (!_extractor.StatsWithTE.Contains(s))
+ {
+ // the issue is not related to TE, so it's a different issue
+ onlyStatsWithTEHaveNoResults = false;
+ }
+ }
+ }
+
+ if (!someStatsHaveNoResults || !onlyStatsWithTEHaveNoResults) break;
+
+ // issue could be a wild claimed baby that should be considered tamed
+ _extractor.Clear();
+ rbTamedExtractor.Checked = true;
+ bred = false;
+
+ continue;
+ }
+
+ break;
+ }
numericUpDownImprintingBonusExtractor.ValueSave = (decimal)_extractor.ImprintingBonus * 100;
numericUpDownImprintingBonusExtractor_ValueChanged(null, null);
diff --git a/ARKBreedingStats/Form1.importSave.cs b/ARKBreedingStats/Form1.importSave.cs
index cc93de29..e45fe443 100644
--- a/ARKBreedingStats/Form1.importSave.cs
+++ b/ARKBreedingStats/Form1.importSave.cs
@@ -107,7 +107,7 @@ private async Task RunSavegameImport(ATImportFileLocation atImportFileLo
await ImportSavegame.ImportCollectionFromSavegame(_creatureCollection, workingCopyFilePath,
atImportFileLocation.ServerName);
- UpdateCreatureParentLinkingSort();
+ UpdateCreatureParentLinkingSort(goToLibraryTab: true);
// if unknown mods are used in the savegame-file and the user wants to load the missing mod-files, do it
if (_creatureCollection.ModValueReloadNeeded
diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs
index 5de95bc6..946ad4c8 100644
--- a/ARKBreedingStats/Properties/AssemblyInfo.cs
+++ b/ARKBreedingStats/Properties/AssemblyInfo.cs
@@ -30,6 +30,6 @@
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.60.2.1")]
+[assembly: AssemblyFileVersion("0.60.3.0")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/ARKBreedingStats/SpeciesSelector.cs b/ARKBreedingStats/SpeciesSelector.cs
index c526a81d..5e7d2e10 100644
--- a/ARKBreedingStats/SpeciesSelector.cs
+++ b/ARKBreedingStats/SpeciesSelector.cs
@@ -149,7 +149,7 @@ public void InitializeSpeciesImages(List species)
s.name.Contains("Polar") ? creatureColorsPolar : creatureColors
//colors
);
- //if (!imgExists && !speciesWOImage.Contains(s.name)) speciesWOImage.Add(s.name);
+ //if (!imgExists && s.IsDomesticable && !speciesWOImage.Contains(s.name)) speciesWOImage.Add(s.name);
if (!imgExists || _iconIndices.Contains(speciesListName)) continue;
try
diff --git a/ARKBreedingStats/_manifest.json b/ARKBreedingStats/_manifest.json
index 36d0b6c4..052c57b6 100644
--- a/ARKBreedingStats/_manifest.json
+++ b/ARKBreedingStats/_manifest.json
@@ -4,7 +4,7 @@
"ARK Smart Breeding": {
"Id": "ARK Smart Breeding",
"Category": "main",
- "version": "0.60.2.1"
+ "version": "0.60.3.0"
},
"SpeciesColorImages": {
"Id": "SpeciesColorImages",
diff --git a/ARKBreedingStats/importExportGun/ImportExportGun.cs b/ARKBreedingStats/importExportGun/ImportExportGun.cs
index d32a2d6b..9bfa4e2c 100644
--- a/ARKBreedingStats/importExportGun/ImportExportGun.cs
+++ b/ARKBreedingStats/importExportGun/ImportExportGun.cs
@@ -74,6 +74,12 @@ public static Creature LoadCreatureFromJson(string jsonText, string resultSoFar,
return null;
}
+ if (string.IsNullOrEmpty(exportedCreature.BlueprintPath))
+ {
+ resultText = "file contains no blueprint path, it's probably not a creature file"; // could be a server multipliers file
+ return null;
+ }
+
serverMultipliersHash = exportedCreature.ServerMultipliersHash;
return ConvertExportGunToCreature(exportedCreature, out resultText);
@@ -113,9 +119,15 @@ private static Creature ConvertExportGunToCreature(ExportGunCreatureFile ec, out
&& ec.OwningPlayerID == 0
;
- var c = new Creature(species, ec.DinoName, !string.IsNullOrEmpty(ec.OwningPlayerName) ? ec.OwningPlayerName : !string.IsNullOrEmpty(ec.ImprinterName) ? ec.ImprinterName : ec.TamerString,
- ec.TribeName, species.noGender ? Sex.Unknown : ec.IsFemale ? Sex.Female : Sex.Male, wildLevels, domLevels, mutLevels,
- isWild ? -3 : ec.TameEffectiveness, !string.IsNullOrEmpty(ec.ImprinterName), ec.DinoImprintingQuality,
+ var isBred = !string.IsNullOrEmpty(ec.ImprinterName)
+ || (ec.DinoImprintingQuality > 0 && ec.TameEffectiveness > 0.9999);
+
+ var owner = !string.IsNullOrEmpty(ec.OwningPlayerName) ? ec.OwningPlayerName
+ : !string.IsNullOrEmpty(ec.ImprinterName) ? ec.ImprinterName
+ : ec.TamerString;
+
+ var c = new Creature(species, ec.DinoName, owner, ec.TribeName, species.noGender ? Sex.Unknown : ec.IsFemale ? Sex.Female : Sex.Male,
+ wildLevels, domLevels, mutLevels, isWild ? -3 : ec.TameEffectiveness, isBred, ec.DinoImprintingQuality,
CreatureCollection.CurrentCreatureCollection?.wildLevelStep)
{
ArkId = arkId,
@@ -304,7 +316,13 @@ public static ExportGunServerFile ReadServerMultipliersFromJson(string jsonText,
internal static bool SetServerMultipliers(CreatureCollection cc, ExportGunServerFile esm, string newServerMultipliersHash)
{
- if (cc == null) return false;
+ if (cc == null
+ || esm?.TameAdd == null
+ || esm.TameAff == null
+ || esm.WildLevel == null
+ || esm.TameLevel == null
+ )
+ return false; // invalid server multipliers
const int roundToDigits = 6;
diff --git a/ARKBreedingStats/json/values/ASA-values.json b/ARKBreedingStats/json/values/ASA-values.json
index 471706e6..295a249b 100644
--- a/ARKBreedingStats/json/values/ASA-values.json
+++ b/ARKBreedingStats/json/values/ASA-values.json
@@ -1,5 +1,5 @@
{
- "version": "32.11.468629",
+ "version": "32.11.468631",
"format": "1.15-asa",
"mod": {
"id": "ASA",
@@ -1561,6 +1561,56 @@
{
"blueprintPath": "/Game/PrimalEarth/Dinos/Yutyrannus/Yutyrannus_Character_BP.Yutyrannus_Character_BP",
"skipWildLevelStats": 512
+ },
+ {
+ "name": "Gigantoraptor",
+ "blueprintPath": "/Gigantoraptor/Gigantoraptor/Gigantoraptor_Character_BP.Gigantoraptor_Character_BP",
+ "skipWildLevelStats": 512,
+ "fullStatsRaw": [
+ [ 770, 0.2, 0.27, 0.5, 0 ],
+ [ 350, 0.1, 0.1, 0, 0 ],
+ [ 950, 0.06, 0, 0.5, 0 ],
+ [ 150, 0.1, 0.1, 0, 0 ],
+ [ 3000, 0.1, 0.1, 0, 0.15 ],
+ null,
+ null,
+ [ 320, 0.02, 0.04, 0, 0 ],
+ [ 1, 0.05, 0.1, 0.5, 0.4 ],
+ [ 1, 0, 0.01, 0, 0 ],
+ null,
+ null
+ ],
+ "colors": [
+ { "name": "Body Main" },
+ { "name": "Neck Main" },
+ { "name": "Feather Tips" },
+ { "name": "Feather Highlights" },
+ { "name": "Legs And Beak" },
+ { "name": "Feather Pattern" }
+ ],
+ "immobilizedBy": [ "Chain Bola", "Large Bear Trap", "Plant Species Y" ],
+ "breeding": {
+ "gestationTime": 0,
+ "incubationTime": 5999.52004,
+ "eggTempMin": 26,
+ "eggTempMax": 32,
+ "maturationTime": 416666.667,
+ "matingCooldownMin": 64800,
+ "matingCooldownMax": 172800
+ },
+ "taming": {
+ "nonViolent": false,
+ "violent": true,
+ "tamingIneffectiveness": 0.06,
+ "affinityNeeded0": 6800,
+ "affinityIncreasePL": 160,
+ "torporDepletionPS0": 2.8333332,
+ "foodConsumptionBase": 0.002314,
+ "foodConsumptionMult": 180.0634,
+ "babyFoodConsumptionMult": 510
+ },
+ "TamedBaseHealthMultiplier": 1,
+ "displayedStats": 927
}
],
"dyeStartIndex": 128,
diff --git a/ARKBreedingStats/json/values/_manifest.json b/ARKBreedingStats/json/values/_manifest.json
index c33131e0..74c9cab9 100644
--- a/ARKBreedingStats/json/values/_manifest.json
+++ b/ARKBreedingStats/json/values/_manifest.json
@@ -398,7 +398,7 @@
"mod": { "id": "919470289", "tag": "SSFlyer", "title": "SSFlyer" }
},
"ASA-values.json": {
- "version": "32.11.468629",
+ "version": "32.11.468631",
"format": "1.15-asa",
"mod": { "id": "ASA", "tag": "", "title": "Ark: Survival Ascended", "shortTitle": "ASA" }
},
diff --git a/ARKBreedingStats/library/CreatureCollection.cs b/ARKBreedingStats/library/CreatureCollection.cs
index 34081e94..0f9dfc94 100644
--- a/ARKBreedingStats/library/CreatureCollection.cs
+++ b/ARKBreedingStats/library/CreatureCollection.cs
@@ -213,13 +213,13 @@ public bool MergeCreatureList(IEnumerable creaturesToMerge, bool addPr
string onlyThisSpeciesBlueprintAdded = null;
bool onlyOneSpeciesAdded = true;
- var guidDict = creatures.ToDictionary(c => c.guid);
-
if (removeCreatures != null)
{
creaturesWereAddedOrUpdated = creatures.RemoveAll(c => removeCreatures.Contains(c.guid)) > 0;
}
+ var guidDict = creatures.ToDictionary(c => c.guid);
+
foreach (Creature creatureNew in creaturesToMerge)
{
if (!addPreviouslyDeletedCreatures && DeletedCreatureGuids != null && DeletedCreatureGuids.Contains(creatureNew.guid)) continue;
diff --git a/ARKBreedingStats/uiControls/LibraryInfo.cs b/ARKBreedingStats/uiControls/LibraryInfo.cs
index 8619039e..c4fcfba3 100644
--- a/ARKBreedingStats/uiControls/LibraryInfo.cs
+++ b/ARKBreedingStats/uiControls/LibraryInfo.cs
@@ -120,7 +120,7 @@ void AddParagraph(string text, string suffixForPlainText = null, bool bold = fal
for (int i = 0; i < Ark.ColorRegionCount; i++)
{
if (!species.EnabledColorRegions[i]) continue;
- AddParagraph($"Color region {i}: {species.colors[i]?.name}", bold: true, relativeFontSize: 1.1f);
+ AddParagraph($"Color region {i}: {species.colors?[i]?.name}", bold: true, relativeFontSize: 1.1f);
var colorsExist = ColorsExistPerRegion[i].Count;
AddParagraph($"{colorsExist} color id{(colorsExist != 1 ? "s" : string.Empty)} available in your library:");
AddParagraph(CreateNumberRanges(ColorsExistPerRegion[i]));