Definesound: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Doom64hunter (talk | contribs) m Updated some outdated info and clarified parameters |
||
Line 1: | Line 1: | ||
'''definesound''' <value> <filename> < | '''definesound''' <value> <filename> <pitch_lower> <pitch_upper> <priority> <type> <distance> | ||
The definesound command defines a sound and assigns various properties to it. The maximum number of sounds that can be defined is 16384 for EDuke32, and 450 for Duke v1.5. | |||
Sound defines over 1000 won't work with the MUSICANDSOUNDFX sprite, because above this value this will trigger an echo effect, so bear this in mind if you're working on a mod with many custom sound files. | |||
*<value>: This can be either the sound's number or the name that has been [[define]]d for that number. | *<value>: This can be either the sound's number or the name that has been [[define]]d for that number. | ||
*<filename>: The name of the sound file. Sound files are assumed to be in the same directory as the program unless a folder path is specified. Assume that the user's OS is case sensitive, and directory delimiters are forward slashes (<code>/</code>) rather than backslashes (<code>\</code>). | *<filename>: The name of the sound file. Sound files are assumed to be in the same directory as the program unless a folder path is specified. Assume that the user's OS is case sensitive, and directory delimiters are forward slashes (<code>/</code>) rather than backslashes (<code>\</code>). | ||
*< | *<pitch_lower> and <pitch_upper>: These are a random pitch variation range. Values may be positive or negative. For example, if you want you sound to have a chance of both moderate increase and decrease in pitch, you would use values such as <code>-512 512</code>. | ||
*<priority>: A value of 0 to 255 indicates the priority the sound has over other sounds that are playing simultaneously. The higher the value, the greater its priority. This is due to the limit on the number of sounds that can play at once. Take a look at the original USER.CON to see what kinds of sounds get what kinds of priority. For example, most Duke remarks are maxed out at 255. | *<priority>: A value of 0 to 255 indicates the priority the sound has over other sounds that are playing simultaneously. The higher the value, the greater its priority. This is due to the limit on the number of sounds that can play at once. Take a look at the original USER.CON to see what kinds of sounds get what kinds of priority. For example, most Duke remarks are maxed out at 255. | ||
*<type>: This flag is a [[bitfield]] which indicates what type of sound you are defining. | *<type>: This flag is a [[bitfield]] which indicates what type of sound you are defining. | ||
:Bit #0 ('''1'''): The sound repeats if continually played. | ::Bit #0 ('''1'''): The sound repeats if continually played. | ||
:Bit #1 ('''2'''): The sound is an ambient effect. Disabling ambience in the menu will mute this sound. | ::Bit #1 ('''2'''): The sound is an ambient effect. Disabling ambience in the menu will mute this sound. | ||
::Bit #0 + Bit #1 ('''3'''): The sound will loop until instructed to stop. | :::Bit #0 + Bit #1 ('''3'''): The sound will loop until instructed to stop. | ||
:Bit #2 ('''4'''): The sound is a player voice. Disabling "Duke Talk" in the menu will mute this sound. | ::Bit #2 ('''4'''): The sound is a player voice. Disabling "Duke Talk" in the menu will mute this sound. | ||
:Bit #3 ('''8'''): The sound contains offensive content. Disabling "Adult Mode" or enabling the parental lock in the menu will mute this sound. | ::Bit #3 ('''8'''): The sound contains offensive content. Disabling "Adult Mode" or enabling the parental lock in the menu will mute this sound. | ||
:Bit #4 ('''16'''): The sound will always be heard from anywhere in the level. (See [[globalsound]].) (sndist = 0) | ::Bit #4 ('''16'''): The sound will always be heard from anywhere in the level. (See [[globalsound]].) (sndist = 0) | ||
:Bit #7 ('''128'''): The sound is used in Duke-Tag. | ::Bit #7 ('''128'''): The sound is used in Duke-Tag. | ||
*< | *<distance>: Negative values increase the distance at which the sound is heard; positive ones reduce it. Can range from -32768 to 32767. Note that this value does not affect the sound's volume, but rather it modifies the distance registered between it and any listening players. As such, this has no effect on global sounds or sounds made by the player. | ||
[[Category:Duke3D 1.3/1.5 commands]] | [[Category:Duke3D 1.3/1.5 commands]] | ||
[[Category:Sound manipulation]] | [[Category:Sound manipulation]] |
Revision as of 01:09, 13 November 2021
definesound <value> <filename> <pitch_lower> <pitch_upper> <priority> <type> <distance>
The definesound command defines a sound and assigns various properties to it. The maximum number of sounds that can be defined is 16384 for EDuke32, and 450 for Duke v1.5.
Sound defines over 1000 won't work with the MUSICANDSOUNDFX sprite, because above this value this will trigger an echo effect, so bear this in mind if you're working on a mod with many custom sound files.
- <value>: This can be either the sound's number or the name that has been defined for that number.
- <filename>: The name of the sound file. Sound files are assumed to be in the same directory as the program unless a folder path is specified. Assume that the user's OS is case sensitive, and directory delimiters are forward slashes (
/
) rather than backslashes (\
). - <pitch_lower> and <pitch_upper>: These are a random pitch variation range. Values may be positive or negative. For example, if you want you sound to have a chance of both moderate increase and decrease in pitch, you would use values such as
-512 512
. - <priority>: A value of 0 to 255 indicates the priority the sound has over other sounds that are playing simultaneously. The higher the value, the greater its priority. This is due to the limit on the number of sounds that can play at once. Take a look at the original USER.CON to see what kinds of sounds get what kinds of priority. For example, most Duke remarks are maxed out at 255.
- <type>: This flag is a bitfield which indicates what type of sound you are defining.
- Bit #0 (1): The sound repeats if continually played.
- Bit #1 (2): The sound is an ambient effect. Disabling ambience in the menu will mute this sound.
- Bit #0 + Bit #1 (3): The sound will loop until instructed to stop.
- Bit #2 (4): The sound is a player voice. Disabling "Duke Talk" in the menu will mute this sound.
- Bit #3 (8): The sound contains offensive content. Disabling "Adult Mode" or enabling the parental lock in the menu will mute this sound.
- Bit #4 (16): The sound will always be heard from anywhere in the level. (See globalsound.) (sndist = 0)
- Bit #7 (128): The sound is used in Duke-Tag.
- <distance>: Negative values increase the distance at which the sound is heard; positive ones reduce it. Can range from -32768 to 32767. Note that this value does not affect the sound's volume, but rather it modifies the distance registered between it and any listening players. As such, this has no effect on global sounds or sounds made by the player.