Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - grapenuts

#1
Help / Sound not playing even in debug mode
March 14, 2020, 09:42:12 PM
I'm trying to add a custom sound to a mod that was using a stock sound which didn't really apply. I created a new SoundDef:


<?xml version="1.0" encoding="utf-8"?>
<Defs>
    <SoundDef>
        <defName>Ingest_Water</defName> 
        <sustain>False</sustain> 
        <context>MapOnly</context> 
        <eventNames />
        <priorityMode>PrioritizeNearest</priorityMode>
        <sustainStartSound></sustainStartSound>
        <sustainStopSound></sustainStopSound>
        <subSounds>
          <li>
            <muteWhenPaused>False</muteWhenPaused>     
            <grains>
              <li Class="AudioGrain_Clip">
                <clipPath>Mizu_Gulp</clipPath>
              </li>
            </grains>     
            <volumeRange>
                <min>100</min>
                <max>100</max>
            </volumeRange>   
            <pitchRange>
                <min>1</min>
                <max>1.015</max>
            </pitchRange>
            <distRange>
                <min>0</min>
                <max>20</max>
            </distRange>         
          </li>
        </subSounds>
      </SoundDef>

      <SoundDef>
        <defName>Pour_Water</defName> 
        <sustain>False</sustain> 
        <context>MapOnly</context>
        <eventNames />
        <priorityMode>PrioritizeNearest</priorityMode>
        <sustainStartSound></sustainStartSound>
        <sustainStopSound></sustainStopSound>
        <subSounds>
          <li>
            <muteWhenPaused>False</muteWhenPaused>     
            <grains>
              <li Class="AudioGrain_Clip">
                <clipPath>Mizu_Pour</clipPath>
              </li>
            </grains>     
            <volumeRange>
                <min>100</min>
                <max>100</max>
            </volumeRange>
            <pitchRange>
                <min>1</min>
                <max>1.015</max>
            </pitchRange>
            <distRange>
                <min>0</min>
                <max>20</max>
            </distRange>
          </li>
        </subSounds>
      </SoundDef>
</Defs>


The sound doesn't trigger for events it's defined for, so I went into the debug menu under Play Sound and I see them there. However, clicking on either sound button does nothing. I did double-check that the files play correctly in a media player, so I'm pretty sure I just have something wrong in this XML. Does anyone have an idea of what I messed up?

Thanks.
#2
I took at stab it it because there's a mod that's super-critical for me and it depends on ModCheck. Getting it updated for Harmony 2.0 seemed easy enough as I've already updated a couple other mods, but there's a method where I'm stuck. In Harmony.cs it uses the Harmony Transpiler on Verse.LoadedModManager.ApplyPatches and verifies it's the same as what it expects it to be by line number and string comparisons. I looked at the decomplied Verse code but I don't see how he got it to match, and thus I'm not sure how to replace it.

I'm not looking forward to trying to pick apart the original mod I wanted to fix and try to get it working without ModCheck :(