Jump to content

How is sound played in CK2


joemann

Recommended Posts

My understanding is that in the basic game sound effects are stored  in the form of Wav. files in the sound directory. You can click on and listen to each individual file. However there is also a sound.sfx file in the interface directory. I do not know what this contains but I suppose it is the compressed version of the Wav files from thr sound directory. Is that correct?

 

When the game plays a sound effect does it originate from the sfx file or from the wav file?

 

The reason I am asking is that I want my mod to play custom-made sounds. I have these in the form of  wav files and I assumed that by putting these in the CK2 base game sound directory, and typing the appropriate command in the event file of my mod the sound would play.

 

narrative_event = {
    id = ksv.42
    desc = ksv42desc
    picture = GFX_evt_ksv.sexoral1
    sound = gagging_female_02                #does not work Why?
                                                          
    is_triggered_only = yes

    option = {
        name = ksvoptionfurther
        character_event = { id = ksv.421 }
        
    }

 

 

I had tested this with a standard sound file: garotting_female_01, it worked. However when I used my own custom made file it did not. Validator did not find an error.

 

Does that mean that the sound does not come from the wav file but from the sfx file in the interface directory?

 

If this is the case how do you deal with this?

 

I have  tried repeating  file structure of the game in my mod adding a sound directory with my wav files  in it, but no succes. I even comprssed some of my wav files to the sfx format with 7zip and put them in the mod's interface file, didn't work either.

 

Is the sound for modding limited to the games standard sounds? If not where do you store custom-made sounds?

Link to comment

My understanding is that the .sfx contain a definition of the sound effects, giving each .wav asset an in-game identifier which then can be used by the code, just like.gfx gives definitions for the image assets.

 

So you would need three things to implement new sounds from scratch into an event:

 

1- the .wav asset

2- edit the .sfx file (I think you can't add new files of this type but I may be wrong), to include a definition that points to your added .wav asset.

3- call the sound correctly inside your script. I *think* You don't do this like in your example, in the root of an event, but inside an immediate (executes when the event first appears onscreen), option (executes when an option button is clicked), or after (executes just before the event is disbanded from screen) clause, and the proper way to call it, according to others in another thread , appears to be sound_effect = X, with X being the identifier you gave in the .sfx definition.

 

In any case it seems that your main issue is that you lack a reference to your new assets in the .sfx file, so the game doesn't even know your .wav assets are there.

Link to comment

That makes sense.

 

To start with your third comment: I don't  think (remember I am new to this) that the script I posted is the root of the event. It is the first start screen of one of three options the player can pick. So there is more script preceding it. So I think this  is an option. I have tried many different commands including the sound_effect command. The reason I use the sound = command is that it works with a standard sound effect (garroting_female).

 

Concerning the sfx file. I googled it and it seems to be a compressed archive of sound files combined with an executable. Maybe that is the in-game identifier. Abominus posted the following

 

secret_cults_blend_in =
{
    file = "secret_cults_blend_in_01.wav"
    volume = 65
    on_demand = yes
}

which seems to make sense. I don't understand, however, why this should be in an sfx file instead of a text file which can be easily modified. I suppose there is no point in adding this script in the option script?

 

So I seem to be stuck.

 

This raises the question of whether all  the sound files need to be in the main game directory, or if it is possible to put them in the mod file. If the later is true you would the not have to touch the main sfx file (if I knew how) which seems a bit scary and try and make a new sfx file for the  mod.

 

I was surprised to notice that there is not a lot of information available in the wiki on sound modding. Maybe it is not a topic of interest to most modders.

 

Do you think a post on the paradox forum would help?

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use