Thread: Global Custom Sentences Replacement Guide

Results 1 to 2 of 2
  1. #1
    Super moderator Hezus's Avatar
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    8,997

    Global Custom Sentences Replacement Guide

    Sentence replacement has been possible for many long years through Global Sound Replacement but it's also possible to make your own sentences. This is how it's done!

    1. What are sentences?
    The sentences.txt (or default_sentences.txt) file handles all speech and sounds within the game. For instance:

    Code:
    OT_ANSWER0 otis/yes
    Using 'OT_ANSWER0" will make Otis use the yes.wav file stored in ../svencoop/sound/otis/.

    Another example is the intercom announcer:
    Code:
    C1A1_0 bizwarn bizwarn bizwarn warning, high energy detonation detected in materials lab
    As you can see, you can create full sentences with seperate words, as long as they have a corresponding .wav file. And it's not limited to words. It will play whatever is stored in the .wav file. You can also add a comma (,) to make the speaker pause for a second.


    2. How to make your own sentences?
    Since the default_sentences.txt is used by the game, you should not edit it. It's better to make your own! Create a text file and the following line to it:

    Code:
    SECTORSEC vox/doop, sector secured
    As you can see, it uses the doop.wav, sector.wav and secured.wav from the ../sound/vox/ folder to create a sentence. Save your file as 'mymap_sentences.txt' and store it in ../svencoop/sound/mymap/.

    Now, open your maps' CFG file and add this line to it:

    Code:
    sentence_file sound/mymap/mymap_sentences.txt
    This will now point the game towards your custom sentence file.


    3. How to put them ingame?
    Open your map and add an 'ambient_generic' entity. Give it a targetname and in the 'Sound File' field type: !SECTORSEC .Make sure you start with an exclamation mark (!) so the engine knows it is loading that sound from a sentence.txt file.

    To make sure my sound is only heard after triggering it and everywhere in the map, I'll check the 'Play Everwhere' and 'Start Silent' flags. Now set up a button/trigger targeting your ambient_generic and the intercom will speak your custom sentence.

    You can also do this with NPCs such as scientists, so they will lipsync your custom sentence. To do this, you must use a 'scripted_sentence' entity. Give it a targetname (scientist1_speak), in 'Sentence Name' add your custom sentence starting with a ! (!LEAVEBRITNEYALONE), and in 'Speaker Type' use the name of the NPC you want to use (scientist).

    It's also possible to put custom sentences for using and unusing NPCs. Just add your custom sentence to the 'Use Sentence' (!DOYOUWANTTOBUILDASNOWMAN) and 'Un-use Sentence' (!OKBYE). Note that this is only applies to friendly units.

    Lastly, you can replace existing sentences. If you want your scientist to have different screams than the default ones, you can use Global Sound Replacement. More info on that here.

    Important!
    Never start your sentence names with symbols or numbers. The game will not be able to find them.
    Last edited by Hezus; 14-05-2018 at 03:10 PM.

  2. #2
    Registered User kmkz's Avatar
    Join Date
    Oct 2011
    Location
    Buenos aires, Argentina
    Posts
    20

    Re: Global Custom Sentences

    Thanks, this was useful to me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •