Sound operators: Difference between revisions
Jump to navigation
Jump to search
(→System: Added all the info I could find on sys_output) |
(.) |
||
| Line 1: | Line 1: | ||
These are the root sound operators referenced in [[Portal 2]]. See <code>scripts/sound_operator_stacks.txt</code> and [[Soundscripts#Operator stacks ]] for more details. | These are the root sound operators referenced in [[Portal 2]]. See <code>scripts/sound_operator_stacks.txt</code> and [[Soundscripts#Operator stacks ]] for more details. | ||
{{todo|Make this more beginner-friendy?}} | |||
== Usage == | == Usage == | ||
Revision as of 19:11, 28 August 2018
These are the root sound operators referenced in Portal 2. See scripts/sound_operator_stacks.txt and Soundscripts#Operator stacks for more details.
Todo: Make this more beginner-friendy?
Usage
VFX.LightFlickerEnd
{
channel CHAN_AUTO
soundlevel SNDLVL_105db
volume 1.0
rndwave
{
wave "vfx/light_flicker/light_flicker_end_01.wav"
wave "vfx/light_flicker/light_flicker_end_02.wav"
wave "vfx/light_flicker/light_flicker_end_03.wav"
wave "vfx/light_flicker/light_flicker_end_04.wav"
}
soundentry_version 2
operator_stacks
{
start_stack // applied when the sound begins
{
import_stack "P2_exclusion_time_blocker_start" // defined in scripts/sound_operator_stacks.txt
// We are now extending/configuring P2_exclusion_time_blocker_start
block_entries // prevents another sound from playing
{
input_duration 0.25 // seconds to block for
match_entry "World.LightFlickerEnd" // the sound entry to block
match_entity false // only on the same entity that this sound is playing from?
}
}
}
}
Common properties
execute_once- Whether the operator should run every time the stack is evaluated, or only the first time. Output values are presumable stored between executions in the latter case.
input_execute- The operator will only run if this value is true (i.e. non-zero).
output- The result of the operator (if there is one). Accessed with
@OperatorName.output.
There is also one special command that is not an operator:
import_stack- Inserts another named stack into this one.
Operator list
System
Affect sound playback.
sys_stop_entries- Ends existing sounds.
match_entry- The sound entry name to look for.
match_substring- Whether
match_entrycan be part of a larger string (e.g. "MyGun" matches MyGun.fire, MyGun.reload). match_channel- Sound must have the same channel (e.g. CHAN_STATIC) as this one to match.
match_entity- Sound must be coming from the same entity as this one.
input_max_entries
Confirm:Stop all but this many instances of the sound?
sys_start_entry- Plays another sound.
input_start
Confirm:In addition to whether the operator is active, only start if/when this value is true?entry_name- The entry to play.
sys_block_entries- Prevents new sounds from playing.
input_duration- How long to suppress sounds for.
input_active
Confirm:In addition to normal duration, suppress only when this value is true?match_entry- Sound entry to suppress.
match_sound- A raw WAV/MP3 filename to match. Possibly deprecated?
match_substring- Whether
match_entrycan be part of a larger string (e.g. "MyGun" matches MyGun.fire, MyGun.reload). match_channel- Sound must have the same channel (e.g. CHAN_STATIC) as this one to match.
match_entity- Sound must be coming from the same entity as this one.
sys_output- Sends a value back to the sound system relating to the current entry.
input_float- Takes a float value to send to the system.
input_speakers- Takes an array of floats to send to the system, each to do with a certain speaker. Use only with the speakers output.
output- Says what value should be altered, for example:
speakers- Use in
update_stacks only. Adjusts the volume of each speaker according to values given byinput_speakers. pitch- Use in
update_stacks only. Adjusts the playback pitch of the sound to the value given withinput_float. dsp- Use in
update_stacks only. Adjusts the DSP of the sound to the value given withinput_float. delay- Use in
start_stacks only. Waits for the number of seconds specified ininput_floatbefore starting the sound. A negative value results in it starting the sound that many seconds into the WAV file instead of at the beginning. block_start- Use in
start_stacks only. Prevents the sound from starting if the value given withinput_floatis non-zero. mixlayer_trigger- "Tell the mixlayer we're active" if the value given with
input_floatis non-zero. - Todo: What does this mean?
save_restore
Confirm:Use in update_stacks only. Tells the system to save and restore the state of the sound if the value given withinput_floatis non-zero.stop_hold- Use in
update_stacks only.
Confirm:Prevents the sound from stopping if the value given with input_floatis non-zero. facing
Confirm:Make the sound play in a certain direction?
sys_platform- Tests what platform the engine is running on.
pcx360ps3- Should the operator return true if running on this platform?
sys_mixlayer- Configures a sound mixer. See
scripts\soundmixers.txtmixlayer- The layer to alter.
mixgroup- The sound group within the layer to alter.
field- Property of the group to alter.
input- Floating point value to set.
Maths
Generate or process numbers.
math_random- Produces a random number. Access it with
@MyRandom.output.input_mininput_max- Range of values to output.
- math_float
- math_delta
- math_remap_float
- math_func1
Getters
Provide values from the engine.
- get_entry_time
- get_sys_time
- get_source_info
- get_soundmixer
- get_convar
- get_dashboard
- get_map_name
Calculations
Calculate pre-set algorithms.
- calc_angles_facing
- calc_distant_dsp
- calc_occlusion
- calc_falloff
- calc_source_distance
- calc_spatialize_speakers
Other
- util_pos_vec8
- util_print_float
- game_view_info
- op_accumulate_ss_float