Skip to content

Commit 79689bf

Browse files
committed
write voice line weights to disk next to sound files
1 parent be55209 commit 79689bf

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

DataTool/FindLogic/Combo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ public class VoiceLineInstanceInfo {
213213
public HashSet<ulong> SoundFiles;
214214

215215
public STUCriteriaContainer? m_criteria;
216+
public float? m_weight;
216217
}
217218

218219
public class SoundFileAsset : ComboAsset {
@@ -1052,6 +1053,7 @@ public static ComboInfo Find(ComboInfo info, ulong guid, Dictionary<ulong, ulong
10521053
voiceLineInstanceInfo.Conversations = voiceLineInstance.m_voiceLineRuntime.m_BD1B6F64?.Select(x => x.GUID.GUID).ToArray();
10531054
voiceLineInstanceInfo.SubtitleRuntime = voiceLineInstance.m_voiceLineRuntime.m_6148094F;
10541055
voiceLineInstanceInfo.m_criteria = voiceLineInstance.m_voiceLineRuntime.m_criteria;
1056+
voiceLineInstanceInfo.m_weight = voiceLineInstance.m_voiceLineRuntime.m_weight;
10551057
Find(info, voiceLineInstanceInfo.ExternalSound, replacements, context);
10561058
Find(info, voiceLineInstanceInfo.SubtitleRuntime, replacements, context);
10571059
} else {

DataTool/ToolLogic/Extract/ExtractHeroVoiceBetter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ public static bool SaveVoiceSet(SaveSetContext context) {
207207
criteriaDesc = stringWriter.ToString();
208208
}
209209

210+
string weightDesc = null;
211+
// ReSharper disable once CompareOfFloatsByEqualityOperator
212+
if (voiceLineInstance.m_weight != null && voiceLineInstance.m_weight != 1) {
213+
weightDesc = $"{voiceLineInstance.m_weight}";
214+
}
215+
210216
// 99% of voiceline instances only have a single sound file however there are cases where some NPCs have multiple
211217
// the Junkenstein Narrator is an example, the lines are the same however they are spoken differently.
212218
foreach (var soundFile in voiceLineInstance.SoundFiles) {
@@ -227,6 +233,7 @@ public static bool SaveVoiceSet(SaveSetContext context) {
227233
SaveLogic.Combo.SaveVoiceLineInstance(flags, path, voiceLineInstance, filename, soundFile);
228234

229235
WriteFile(criteriaDesc, Path.Combine(path, $"{soundFileGuid}-criteria.txt"));
236+
WriteFile(weightDesc, Path.Combine(path, $"{soundFileGuid}-weight.txt"));
230237
}
231238

232239
// Saves Wrecking Balls squeak sounds, no other heroes have sounds like this it seems

0 commit comments

Comments
 (0)