2Bit's Mapping Corner on www.PythonOnline.co.uk
ET Mapping Tutorial

Lesson 31


Team speech
Adding speech to the script
Adding data to the sounds file
Back to main menu
Adding speech to the script [Top]
To get speech to be broadcast to each team, like "Build the Command Post!", takes two elements: something in the script, and something in the sounds file.  We'll address the scripting element first.

Open tutorial.script.

To make speech that is heard by all the players in a team, you use the wm_teamvoiceannounce instruction.

We'll add speech that tells the allies to blow up the main gate, and the axis to prevent this.

Add these 2 lines to the end of the spawn trigger in the game_manager procedure:

  • wm_teamvoiceannounce 0 "radar_axis_entrance1_stop"
  • wm_teamvoiceannounce 1 "radar_allies_entrance1_destroy"

The "0" means that the Axis team will hear the speech; the "1" means the Allies will hear it.

The use of the word "radar" indicates that the speech comes from the Radar map.  Generally you use "axis" in the speech name so that it is clear to you that the speech is with a german accent, and similarly you use "allies" for american speech.

"entrance1_destroy" and "entrance1_stop" then make it clear what the speech says.

The "radar_axis_entrance1_stop" tells ET to look up this reference in the sounds file, and play the WAV associated with it.  Same for "radar_allies_entrance1_destroy".

As soon as the wm_teamvoiceannounce instruction is executed, the speech is queued up to be spoken, that is, if there is already speech being spoken, they won't shout each other down or interrupt each other, they just queue up.

But you will sometimes want certain speech to be spoken as soon as a player joins a team, even if it is after the start of the game.

So add these lines after the other two:

  • wm_addteamvoiceannounce 0 "radar_axis_entrance1_stop"
  • wm_addteamvoiceannounce 1 "radar_allies_entrance1_destroy"
wm_addteamvoiceannounce means "don't speak this now, but speak it to any players who join the team later".

The last bits to go into the script are the instructions to stop telling newly arrived players to destroy the main gate, if the main gate has already been destroyed.

Add these lines to the gate procedure at the end of the death trigger:

  • wm_removeteamvoiceannounce 0 "radar_axis_entrance1_stop"
  • wm_removeteamvoiceannounce 1 "radar_allies_entrance1_destroy"

When the gate is destroyed, and its "death" trigger is executed, ET will now remove these speech elements from the list of speeches to play to newly arriving players.

Adding data to the sounds file [Top]
You will need to create a folder called scripts inside the etmain/sounds folder, if it isn't already there.

Now create a text file called etmain/sounds/scripts/tutorial.sounds.

Add this text to the new file:

  sound sound/vo/radar/allies/hq_entrance1dyn.wav
  sound sound/vo/radar/axis/hq_entrance1stop.wav

As you can see, you will need a definition with the same name as that specified in each wm_teamvoiceannounce instruction.

The sound line tells ET which WAV to play.

It is always voice and streaming.  If you have additional sound lines then ET will play one or the other, giving you some variety in intonation.

You can look into the .sounds files of other maps to get ideas for the sort of speech other people have used - the WAVs don't have to be those that came with ET; you can create your own WAVs and have them spoken in just the same way.

I prefer not to put on a fake german accent for the speech I need, if there isn't one already supplied by ET - instead I found it better to cut up existing WAVs using a WAV editor and then put the words together in the construct that I wanted.  For 2tanks I had to assemble 53 new WAV files for the various team speech, and it was all done by using words lifted from the various standard ET maps.

With the script and sounds files now ready, you can run ET and you should hear the "destroy the main entrance" etc on arrival - but not after the gate has been blown up.

Next lesson