Skip to content

Commit

Permalink
feat: use MaxAttenuation value from SoundbanksInfo.xml in event
Browse files Browse the repository at this point in the history
  • Loading branch information
Notexe committed Jan 10, 2024
1 parent 5d929e2 commit 55def90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions G2WwiseDataTool/EventWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Entry
public string eventObjectPath = "";
public string eventAssemblyPath = "";
public string eventNameHash = "";
public float unknownFloat = -1; // Max Attenuation Radius? (the game uses the value in the soundbank instead so changing this does absolutely nothing)
public float eventMaxAttenuation = -1; // doesn't seem to affect anything in-game, probably used for debugging purposes.
public string outputPath = "";
public bool isStreamed = false;
public bool isPrefetched = false;
Expand Down Expand Up @@ -55,7 +55,7 @@ public static void WriteWWEV(ref Event wwev)
writer.Write(eventNameLength + 0x1);
writer.Write(eventNameBytes);
writer.Write((sbyte)0x0); // Padding
writer.Write(wwev.unknownFloat);
writer.Write(wwev.eventMaxAttenuation);

if (wwev.isStreamed)
{
Expand Down
10 changes: 10 additions & 0 deletions G2WwiseDataTool/SoundbanksInfoParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ public static void ReadSoundbankInfo(string inputPath, string outputPath, bool s
wwev.eventName = eventNode.Attributes["Name"].Value;
wwev.eventObjectPath = eventNode.Attributes["ObjectPath"].Value;


if (eventNode.Attributes["MaxAttenuation"] != null && eventNode.Attributes["MaxAttenuation"].Value != "")
{
wwev.eventMaxAttenuation = float.Parse(eventNode.Attributes["MaxAttenuation"].Value);
}
else
{
wwev.eventMaxAttenuation = -1.0f;
}

if (eventNode.Name == "Event")
{
wwev.eventAssemblyPath = "[assembly:/sound/wwise/exportedwwisedata" + wwev.eventObjectPath + ".wwiseevent].pc_wwisebank";
Expand Down

0 comments on commit 55def90

Please sign in to comment.