• Register
Post tutorial RSS Chatterbox or "How to make NPCs talk"

Interested in making the bridge officer sound like your spouse? Or perhaps you want the NPCs to talk Yiddish? Both is definitely doable in SG Warlords, by following this tutorial.

Posted by on - Basic Voice Acting

There is a number of ways you can add new sounds, including voice lines, into the game. The most common though is through adding chatters so let's look at that.

Chatters? What you talkin' bout'?

Here's how it works. There are two general types of chatters in Warlords:

  • Bridge officer - That's the various things the bridge officer says when you issue a command or when an enemy appears on your sensors.
  • Random NPCs - While travelling through space you can occasionaly hear some nearby NPC say something over the commlink. This is it.

So how does that help you? Well, this means you have to decide what you want to change first and edit the appropriate database. And that's it. That's the only difference. Well... the sorting mechanism is also slightly different, but you'll get the hang of it.

Sound files

So when dealing with SFX in games, it's always important to know what format to use. Warlords, for now, only accepts .wav files so you can't really go wrong with that. Simple, pure, uncompressed .wav. Needless to say, the files need to be within the game folder, but where you place them is your choice, since you'll also be linking them manually in the databases. The Data\Sound folder is suggested of course.


This is where most of the game implementation takes place. What you'll be doing is linking the new chatter sound files to specific situations. Then the game knows when to use the files. Depending on what type of chatter you've opted to create, choose the appropriate database.

  • Data\Base\BridgeChatter.wdt for bridge officer chatter
  • Data\Base\RandomChatter.wdt for random NPC chatter

Opening the database in a spreadsheet editor like MS Excel or OpenOffice Math is advisable since it will be easier to edit and less likely to make a mistake, but you can also edit the file in Notepad or Notepad++. It is advisable to read the How to properly mod databases tutorial.


Each database (table, actually) in Warlords consists of a number of columns and rows. Columns are parameters, while rows are individual entries. The four columns in BridgeChatter.wdt are

  • Id - Simple entry numbering, starting from 0.
  • KeyName - This string is used to invoke the entry through scripts.
  • Sort - This is very important. The game will use the entry depending on this value. Let's call this a situational filter. The various Sort values are listed below.
  • File - Path to the actual sound file that will be played.

How do I tell the game to play the file?

Chatter DiagramThe sorts vary depending on whether you're working on random chatters or bridge officer chatters as each is triggered in various situations. This also goes for how a chatter is triggered. Bridge officer is triggered automatically through the code, while random NPC chatter is a combination. Some are triggered via code, but a lot of it is handled manually through scripts. You don't really have to concern yourself with this since these script implementations are already in place. All you need to be mindful of is properly assembling the database. This is where the databases are important. The embedded diagram shows an example of how a chatter is triggered. It shows one very important thing: You cannot pick a specific individual chatter file to play! The game collects all database entries that fit the requested need (situation) and randomly picks one to actually play. If you want to play a specific sound, this is done differently, but that will be covered in a different tutorial.

Sorting me gently

As I've noted, there are many different sorts / filters. Assigning those properly means you won't hear Going in for an attack run when an NPC decides to land on a planet. The sorts are hard-coded, meaning you cannot add more sorts, but you can use the ones supplied in the game. There are 2 files important for this. You don't need to edit those, but they are useful as references for assigning sorts.

  • BridgeChatterSort.wdt - Sorts used by the bridge officer, listed by name and, more importantly, their ID (which is then referenced in the BridgeChatter.wdt).
  • RandomChatterSort.wdt - Sorts used by the NPCs, listed by name. The entry keynames are referenced in the RandomChatter.wdt.

I won't go into details on what the other parameters in the Sorts databases do. We'll cover that in a separate tutorial. At the bottom is a table of bridge and random chatter sorts, with an accompanying description of the situation the sort is used in.

Using chatter through scripts

The bridge officer chatter is commonly (or exclusively) triggered through the code. You can however force this same thing through scripts if necessary, but this is a lot more frequent and usual for random NPC chatter. Here's how you do it:

 game PlayChatter TARGET_REPAIRED ;

That's it! It's as simple as that. The only thing you have to change is the last bit, the actual function parameter TARGET_REPAIRED. Simply add this line to the appropriate script and set the appropriate sort parameter. The game will then deal with the rest. Triggering a chatter via scripts is also a nifty way to test new chatters to see if everything is working properly.

The almighty sorts

As you have likely learned by now, probably the most important thing regarding chatters is the sort parameter. It's always good to have all those listed somewhere, and you do have them in the databases, but to make things easier, we've compiled a Google spreadsheet of the individual sorts together with a description of when a sort is used.

For further information, please feel free to contact us: modding@starpointgemini.com

For more information about SG Warlords check out these links:
Starpoint Gemini Warlords homepage
Starpoint Gemini Warlords forum
Starpoint Gemini Warlords Steam store page
LGM Games dev-blog
Follow us on Facebook
Follow us on Twitter

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.