18,700
edits
m (link fix) |
(→sound: adding what may be an over-explanation of sound_dialog_play_block and its peculiar usage in Oni, but this is a great start for when we eventually make dedicated pages for every command, right?) |
||
Line 451: | Line 451: | ||
*sound_ambient_stop name:string - function to stop an ambient sound - sound_ambient_stop alarm_loop | *sound_ambient_stop name:string - function to stop an ambient sound - sound_ambient_stop alarm_loop | ||
*sound_ambient_volume name:string [volume:float] [time:float] - function to set the volume of a playing ambient sound - sound_ambient_volume alarm_loop .35 1.0 | *sound_ambient_volume name:string [volume:float] [time:float] - function to set the volume of a playing ambient sound - sound_ambient_volume alarm_loop .35 1.0 | ||
''"Dialogue" is routinely misspelled as "dialog" in the following command names and descriptions.'' | |||
*sound_dialog_play name:string - function to start character dialog playing - sound_dialog_play c00_01_18shinatama | *sound_dialog_play name:string - function to start character dialog playing - sound_dialog_play c00_01_18shinatama | ||
*sound_dialog_play_block name:string - function to start character dialog playing after the current dialog finishes - sound_dialog_play_block c00_01_67shinatama | *sound_dialog_play_block name:string - function to start character dialog playing after the current dialog finishes - sound_dialog_play_block c00_01_67shinatama | ||
''Making two successive calls to sound_dialog_play will cause the second line of dialogue to clobber the first, and you will never hear the first line play. In the level scripts, BWest prevents this by either (1) using sleep() between them, (2) calling another function that blocks further script execution for a while such as chr_animate_block or cm_anim_block, or (3) using sound_dialog_play_block. This function is commonly called with either no argument or the argument "pause", which has no meaning to the function; "pause" was either a mnemonic for the developers indicating the purpose of the function call or else the function was changed during development. The only argument that has meaning to sound_dialog_play_block is the name of a sound. However, even when no valid sound name is received to be played by the function, it still has the effect of blocking on the currently playing dialogue. Thus you will commonly see "sound_dialog_play_block" or "sound_dialog_play_block pause" calls between occurrences of sound_dialog_play. More rarely, you will see calls of the format "sound_dialog_play_block ''actual_sound_name''" for the next line of dialogue, which is more efficient than making an empty call to sound_dialog_play_block between sound_dialog_play calls for dialogue. Why didn't BWest always do it that way? Again it may be due to a change in the functionality of sound_dialog_play_block during development. But occasionally it may be desirable to separate the playing of a dialogue line from the command to block on it, for instance if you want to perform some actions immediately after starting a line playing, <u>then</u> block until the line finishes, then perform additional actions before playing further dialogue.'' | |||
*sound_dialog_play_interrupt name:string - function to interrupt the current character dialog and play a new one - sound_dialog_play_interrupt c00_01_66shinatama | *sound_dialog_play_interrupt name:string - function to interrupt the current character dialog and play a new one - sound_dialog_play_interrupt c00_01_66shinatama | ||
*sound_impulse_play name:string [volume:float] - function plays an impulse sound - sound_impulse_play glass_big 1.0 | *sound_impulse_play name:string [volume:float] - function plays an impulse sound - sound_impulse_play glass_big 1.0 |