Difference between revisions of "Changing sounds"

From XStoryPlayer Wiki
Jump to: navigation, search
Line 28: Line 28:
 
<li>Now we want Saiko to say 'hello' in her alien language when you say 'hello' to her.<br>
 
<li>Now we want Saiko to say 'hello' in her alien language when you say 'hello' to her.<br>
 
Open the <code>/init/std/base/char/brain/code/run/basic_func_sentence.dat</code> file. This file contains functions for basic responses.</li>
 
Open the <code>/init/std/base/char/brain/code/run/basic_func_sentence.dat</code> file. This file contains functions for basic responses.</li>
<li>Locate the following functions and change the code as follows.
+
<li>Locate the these functions and change the code as follows.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
<talk_say_hello>
 
<talk_say_hello>

Revision as of 14:53, 7 January 2015

The scene sounds can be found in the ./pack/pack_dungeon/scenes/sounds directory.

The character sounds can be found in the ./pack/pack_dungeon/ai/speech/default directory.

Sound format

  • XStoryPlayer character sound files are in .wav format.
  • XStoryPlayer scene sound files that have long duration are in .mp3 format.
  • Most sounds are 3d, so there have a location in the scene.
  • We have support for .lwv files, but because Microsoft decided to stop using them as well.

Adding talking sound

  1. At the moment the girls only make sounds during sex and in other special situations. It is however possible to add sound files to sentences.
    To let a character make a sound the following code can be used:
    talk.s      = "aaaahhhhhhh"; // The mouth movement is derived from this text
    talk.file   = "scream1";     // The file in the ai/speech directory
    talk.volume = 1.050;         // The sound volume
    talk.text   = false;         // Do not show text in dialog window

    First the ai/speech/saiko/ location is tried to find the sound file. If the file is not there the ai/speech/default/ location is used.
    This allows you to add girl specific sounds.

  2. Open the /ai/speech directory and create a sub-directory called /saiko.
  3. Add the alien_hello1.wav from the 'Tutorial Resource Pack' to the newly created /ai/speech/saiko directory.
  4. Now we want Saiko to say 'hello' in her alien language when you say 'hello' to her.
    Open the /init/std/base/char/brain/code/run/basic_func_sentence.dat file. This file contains functions for basic responses.
  5. Locate the these functions and change the code as follows.
    <talk_say_hello>
     
    // Add these lines
    talk.file = "alien_hello1";
    talk.volume = 0.95;
     
    ...
     
    </talk_say_hello>
     
     
    //----------------------------------
     
     
    <talk_say_helloagain>
     
    // Add these lines
    talk.file = "alien_hello1";
    talk.volume = 0.95;
     
    ...
     
    </talk_say_helloagain>