Nuclide
Software Development Kit for id Tech
sentences.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17/* voice sentence samples for AI and other triggers that are supposed to talk.
18 * the formatting is messy as hell and I feel dirty for even bothering with all
19 * this to begin with.
20 *
21 * the server will send a short string identifer over and we'll look it up.
22 * what's annoying is that some NPCs got their own pitch overrides so I guess
23 * we'll just default to those whenever there's no custom value set.
24 */
25
26/* sentences are the voice-acting backbone of the sound system.
27 * http://articles.thewavelength.net/230/
28 * has pretty good documentation of how the format is meant to work */
29
30/* Sentences Documentation
31
32 Each line is a new sentence group.
33 [GROUPNAME] [...PARAMETERS] [...SAMPLES]
34
35 If a sample is not in a sub-directory, it'll be assumed to be part
36 of the 'vox' sub-directory, or the last valid path of a previous sample.
37 For example
38 attention male/hello how are you
39 becomes
40 vox/attention.wav male/hello.wav male/how.wav male/are.wav male/you.wav
41
42 When parameters are surrounded by spaces, this means they apply
43 to all current samples. They can be overwritten later down the parsing.
44 When a parameter is attached to a sample, e.g.
45 attention(p120)
46 Then this parameter only applies to said keyword.
47 Whereas...
48 (p120) attention everyone alive
49 Will apply the pitch effect to all three succeeding samples.
50
51 Parameters:
52 (pXX) = Pitch. Valid values are from 50 to 150.
53 (vXX) = Volume. Valid values are from 0 to 100.
54 (sXX) = Start point in %. E.g. 10 skips the first 10% of the sample.
55 (eXX) = End point in %. E.g. 75 ends playback 75% into the sample.
56 (tXX) = Time shift/compression in %. 100 is unaltered speed,
57 wheras 50 plays the sample back in half the time.
58*/
59
60#ifdef SERVER
61#define DYNAMIC_SENTENCES
62
63#ifdef DYNAMIC_SENTENCES
64 string *g_sentences;
66#else
67 #define SENTENCES_LIMIT 1024
68 string g_sentences[SENTENCES_LIMIT];
70#endif
71
72string Sentences_GetSamples(string);
73int Sentences_GetID(string);
74#endif
75
76#ifdef CLIENT
77string Sentences_GetString(int id);
78void Sentences_Shutdown(void);
79#endif
80
81void Sentences_Init(void);
82
#define hashtable
Definition: fteextensions.qc:269
string * g_sentences
Definition: sentences.h:64
void Sentences_Shutdown(void)
Definition: sentences.qc:39
void Sentences_Init(void)
Definition: sentences.qc:170
int Sentences_GetID(string)
Definition: sentences.qc:282
string Sentences_GetString(int id)
Definition: sentences.qc:162
var hashtable g_hashsentences
Definition: sentences.h:83
int g_sentences_count
Definition: sentences.h:65
string Sentences_GetSamples(string)
Definition: sentences.qc:148