Jump to content

File not found with GameDatabase.Instance.ExistsAudioClip(filename) ... but file exists


Recommended Posts

I started fooling around with creating a plugin to play warning buzzers.

In the method where I load up the FXGroup with the audio clip, etc.  I check to make sure the audio clip exists with 

                if (!GameDatabase.Instance.ExistsAudioClip(filename))
                {
                    PrintToLog("[PK_Ah_Ooooga] ERROR - file " + filename + ".* not found!", 3);
                    return false;
                }

and sure enough in the console/log when the vessel loads into the flight scene, it complains about it not finding the clip:

[ERR 08:16:07.213] [PK_Ah_Ooooga] ERROR - file "Pebkac/Sounds/warning".* not found!

things I looked at trying to figure out why:

  • does file named warning exist in  GameData \Pebkac\Sounds folder - yes
  • does the audio exist in the database - yes, or, I assume it does, since there is a Pebkac/Sounds/warning entry in the database/audio section of the Alt+F12 window

I'm not sure what else to look at.

The file is a .wav, and has that extension, which I'm also assuming is OK.

Any advice is much appreciated.

~K

 

 

 

Link to comment
Share on other sites

I tried coding it to load Squad/Alarms/Sounds/OldHorn.wav and it can't find that either?

Is this even the way to do this kind of thing still?   The example code I'm looking at is from way back when (as is my experience with writing plugins for this game.)

 

Link to comment
Share on other sites

Getting rid of the check for the clip being loaded makes the error report go away.  And strangely it doesn't crash when I trigger the event that is supposed to play the sound... But no sound happens.

Link to comment
Share on other sites

Turns out my module declaration in the part config was slightly (completely?) wrong:

MODULE
{
    name = PebkacWarningSiren
    sound_warning = Squad/Alarms/Sounds/OldHorn // I had this as "Squad/Alarms/Sounds/OldHorn" (in quotes) which is WRONG
    isSounding = 0f
}

Anyway, hopefully I will remember this kind of thing in the future.

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...