Definesound: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
 
Jblade (talk | contribs)
mNo edit summary
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
definesound <name> <filename> <pitch1> <pitch2> <priority> <type> <volume>
'''definesound''' <value> <filename> <pitch1> <pitch2> <priority> <type> <volume>


The definesound command defines a sound and assigns various properties to it.
The definesound command defines a sound and assigns various properties to it. The maximum number of sounds that can be defined is 4096 for EDuke32, and 450 for Duke v1.5. Sound defines over 1000 won't work with the MUSICANDSOUNDFX sprite, so bear that in mind if you're working on a mod with many custom sound files.
*<name>: The name by which the sound will be referred to in the CON files.
*<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.
*<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>).
*<pitch1> and <pitch2>: According to the comments in the default user.con, these are a "random pitch variation range." Values may be positive or negative.
*<pitch1> and <pitch2>: 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. 32 is the maximum limit, and can be set lower as the user chooses.
*<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 indicates what type of sound you are defining and can be added together much the way [[cstat]] values are:
*<type>: This flag is a [[bitfield]] which indicates what type of sound you are defining.
:1  Repeat
:Bit #0 ('''1'''): The sound repeats if continually played.
:2  Used for Music&SFX sprites
:Bit #1 ('''2'''): The sound is an ambient effect.  Disabling ambience in the menu will mute this sound.
:4  Duke voice
::Bit #0 + Bit #1 ('''3'''): The sound will loop until instructed to stop.
:8  Disabled when Parental Lockout is on
:Bit #2 ('''4'''): The sound is a player voice.  Disabling "Duke Talk" in the menu will mute this sound.
:16 Global sound
:Bit #3 ('''8'''): The sound contains offensive content.  Disabling "Adult Mode" or enabling the parental lock in the menu will mute this sound.
*<volume>: Negative values increase volume; positive ones soften it.  Can range from -32768 to 32768.
: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.
*<volume>: Negative values increase volume; positive ones soften it.  Can range from -32768 to 32767. Note that this value does not actually 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:Sound manipulation]]

Revision as of 01:11, 19 January 2019

definesound <value> <filename> <pitch1> <pitch2> <priority> <type> <volume>

The definesound command defines a sound and assigns various properties to it. The maximum number of sounds that can be defined is 4096 for EDuke32, and 450 for Duke v1.5. Sound defines over 1000 won't work with the MUSICANDSOUNDFX sprite, so bear that 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 (\).
  • <pitch1> and <pitch2>: 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.
  • <volume>: Negative values increase volume; positive ones soften it. Can range from -32768 to 32767. Note that this value does not actually 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.