Engine02 Script Commands - Sound
Index:
Music:
| 37 | (D) (E) | Func_Play_Music |
| 78 | (D) (E) | Func_Play_Temp_Music |
| 1399 | (D) (E) | Func_PauseMusic |
| 1401 | (D) (E) | Func_ContinueMusic |
| 1403 | (D) (E) | Func_FadeMusic |
| 1405 | (D) (E) | Func_SetMusicVol |
| 1426 | (D) (E) | Func_SetXMSpeedMod |
| 1427 | (D) (E) | Func_SetXMPitchMod |
| 1433 | (D) (E) | Func_SetXMChanMute |
| 1434 | (D) (E) | Func_SetXMEventFunc |
| 1435 | (D) (E) | Func_XMDoEffect |
Sound Effects:
| 40 | (D) (E) | Func_Play_Sound |
| 383 | (D) (E) | Func_Stop_Sound |
| 1400 | (D) (E) | Func_PauseSFX |
| 1402 | (D) (E) | Func_ContinueSFX |
| 1404 | (D) (E) | Func_FadeSFX |
| 1406 | (D) (E) | Func_SetSFXVol |
| 1250 | (D) (E) | Func_Play_Sound_CurrPlayer |
| 1252 | (D) (E) | Func_Play_Sound_FetchedPlayer |
| 1254 | (D) (E) | Func_Stop_Sound_CurrPlayer |
| 1256 | (D) (E) | Func_Stop_Sound_FetchedPlayer |
| 1251 | (D) (E) | Func_Play_Sound_CurrObject |
| 1253 | (D) (E) | Func_Play_Sound_FetchedObject |
| 1255 | (D) (E) | Func_Stop_Sound_CurrObject |
| 1257 | (D) (E) | Func_Stop_Sound_FetchedObject |
Descriptions:
Music:
37 - Func_Play_Music
(ALL) (REG) (Example)
Plays the given Music.
Bit 1 of the "GameFlags" Register is updated to reflect which type of
Music is being played.
Parameters:
- Music ID
The ID number of the desired Music within its "Music Def
The "G", "Z", and "A" tags may be used to reference Music that was loaded as Game-global,
"Zone"-specific, or "Act"-specific, respectively.
The "R" or "r" tags may be used to obtain the ID value from a Register.
78 - Func_Play_Temp_Music
(ALL) (REG) (Example)
Temporarily loads a Music from the specified
"Music Def" file and plays it.
Bit 1 of the "GameFlags" Register is updated to reflect which type of
Music is being played.
Parameters:
- Filename Text ID
ID number of the Text string that contains the filename of the
"Music Def" to load
When this Command is used by a Status Script Function,
this ID references a Status Script Text
When this Command is used by any other Function, it references Text from a Game Def
or a Zone Def. In this case, the "G" and "Z" tags may be used to reference "Game" and "Zone" Texts, respectively
The "R" or "r" tags may be used to obtain the ID value from a Register.
The filename in the Text string must be relative to the "Program Folder", not to the folder that contains
the file in which they appear.
- Music ID
ID number of the desired music in the specified "Music Def"
The "R" or "r" tags may be used to obtain the ID value from a Register.
1399 - Func_PauseMusic
(ALL) (Example)
Suspends Music play.
Parameters:
None
1401 - Func_ContinueMusic
(ALL) (Example)
Resumes Music play.
Parameters:
None
1403 - Func_FadeMusic
(ALL) (REG) (Example)
Fades the Music volume up or down to the Target Volume.
Parameters:
- Target Volume
This value specifies the volume to which the Music should fade (valid range 0-64)
The "R" or "r" tags may be used to obtain the value from a Register.
1405 - Func_SetMusicVol
(ALL) (REG) (Example)
Immediately sets the Music Volume to the specified value.
Parameters:
- Volume
This value specifies the new Music volume(valid range 0-64)
The "R" or "r" tags may be used to obtain the value from a Register.
1426 - Func_SetXMSpeedMod
(ALL) (REG) (Example)
Sets the speed modifier that is used when an XM Music is playing.
Parameters:
- Modifier
This value is used to calculate a new "Beats Per Minute" rate for the song
For positive values: BPM * ((Modifier + 8) / 8)
For negative values: BPM / ((Modifier + 8) / 8)
The "R" or "r" tags may be used to obtain the value from a Register.
1427 - Func_SetXMPitchMod
(ALL) (REG) (Example)
Sets the pitch modifier that is used when an XM Music is playing.
Parameters:
- Modifier
This value is used as a "FineTune" offset when calculating note frequencies
64 "FineTune" values is one full note
The "R" or "r" tags may be used to obtain the value from a Register.
1433 - Func_SetXMChanMute
(ALL) (REG) (Example)
Sets the "Mute" status on the given XM Channel.
Parameters:
- Chan
This value specifies the Channel whose "Mute" status should be modified.
XM Channel IDs start at 1, not 0.
The "R" or "r" tags may be used to obtain the value from a Register.
- Mute
This value specifies the "Mute" status to apply to the given Channel:
0- Unmuted; the Channel will play sound
1- Muted; the Channel will not play sound
The "R" or "r" tags may be used to obtain the value from a Register.
1434 - Func_SetXMEventFunc
(ALL) (REG) (Example)
Sets the current "XM Event Function", a Game Function to run whenever a "Zxx" event is encountered in an XM song.
This Function is only run once each time the effect is encountered, and should not break.
Parameters:
- FuncID
This is the ID number of the Game Def or Zone Def Function
to run when the "Zxx" effect occurs
The "G", "Z", and "A" tags may be used to reference Functions loaded as "Game-global", "Zone"-specific, and "Act"-specific, respectively
The "R" or "r" tags may be used to obtain the value from a Register.
1435 - Func_XMDoEffect
(ALL) (REG) (Example)
Causes the specified XM Effect to be triggered as if it were used by the song itself.
This Command is generally only used in "XM Event Functions" to trigger Effects for the Channel that called it, but may be used in any other Function to trigger events that affect the whole song, and not just one Channel.
Parameters:
- Effect
This value is the "Effect ID" (not "name") of the Effect to trigger
The "R" or "r" tags may be used to obtain the value from a Register.
- Parameter
This value is the "Effect Parameter" to pass along with the Effect ID
The "R" or "r" tags may be used to obtain the value from a Register.
Sound Effects:
40 - Func_Play_Sound
(ALL) (REG) (Example)
Plays the given Sound Effect.
Parameters:
- Sound ID
The ID number of the desired Sound Effect within its "Sound Effect Def".
The "G", "Z", and "A" tags may be used to reference Sound Effects that were loaded as Game-global,
"Zone"-specific, or "Act"-specific, respectively.
The "R" or "r" tags may be used to obtain the ID value from a Register.
- Flag
This value specifies how to play the given Sound Effect:
0- Play once
1- Loop infinitely
2- "Overpower" (Music and other SFX are suspended until this Sound finishes playing)
383 - Func_Stop_Sound
(ALL) (REG) (Example)
Stops the given sound from playing
Parameters:
- Sound ID
The ID number of the desired Sound Effect within its "Sound Effect Def".
The "G", "Z", and "A" tags may be used to reference Sound Effects that were loaded as Game-global,
"Zone"-specific, or "Act"-specific, respectively.
The "R" or "r" tags may be used to obtain the ID value from a Register.
1400 - Func_PauseSFX
(ALL) (Example)
Suspends Sound Effect play.
Parameters:
None
1402 - Func_ContinueSFX
(ALL) (Example)
Resumes Sound Effect play.
Parameters:
None
1404 - Func_FadeSFX
(ALL) (REG) (Example)
Fades the Sound Effect volume up or down to the Target Volume.
Parameters:
- Target Volume
This value specifies the volume to which the Sound Effects should fade (valid range 0-64)
The "R" or "r" tags may be used to obtain the value from a Register.
1406 - Func_SetSFXVol
(ALL) (REG) (Example)
Immediately sets the Sound Effect Volume to the specified value.
Parameters:
- Volume
This value specifies the new Sound Effect volume(valid range 0-64)
The "R" or "r" tags may be used to obtain the value from a Register.
1250 - Func_Play_Sound_CurrPlayer
1252 - Func_Play_Sound_FetchedPlayer
(ALL) (Example)
Plays a Sound Effect referenced by the Player's Sound Effect Reference Listing.
The "_CurrPlayer" versions retrieve the reference from the "Current Player".
The "_FetchedPlayer" versions retrieve the reference from the Player "Fetched" to "Reference 0".
Parameters:
- Entry ID
ID number of the entry within the Player's Sound Effect Reference Listing that references the desired Sound Effect
The lower-case "s" tag may be used (as in "s6") to reference an entry in the Custom Sound Effect Reference Listing. Otherwise,
the ID is taken as an entry in the Required Sound Effect Reference Listing.
The "R" or "r" tags may be used to obtain the ID value from a Register.
- Flag
This value specifies how to play the given Sound Effect:
0- Play once
1- Loop infinitely
2- "Overpower" (Music and other SFX are suspended until this Sound finishes playing)
1254 - Func_Stop_Sound_CurrPlayer
1256 - Func_Stop_Sound_FetchedPlayer
(ALL) (Example)
Stops a Sound Effect referenced by the Player's Sound Effect Reference Listing.
The "_CurrPlayer" versions retrieve the reference from the "Current Player".
The "_FetchedPlayer" versions retrieve the reference from the Player "Fetched" to "Reference 0".
Parameters:
- Entry ID
ID number of the entry within the Player's Sound Effect Reference Listing that references the desired Sound Effect
The lower-case "s" tag may be used (as in "s6") to reference an entry in the Custom Sound Effect Reference Listing. Otherwise,
the ID is taken as an entry in the Required Sound Effect Reference Listing.
The "R" or "r" tags may be used to obtain the ID value from a Register.
1251 - Func_Play_Sound_CurrObject
1253 - Func_Play_Sound_FetchedObject
(ALL) (Example)
Plays a Sound Effect referenced by the Object's Sound Effect Reference Listing.
The "_CurrObject" versions retrieve the reference from the "Current Object".
The "_FetchedObject" versions retrieve the reference from the Object "Fetched" to "Reference 0".
Parameters:
- Entry ID
ID number of the entry within the Object's Sound Effect Reference Listing that references the desired Sound Effect
The "R" or "r" tags may be used to obtain the ID value from a Register.
- Flag
This value specifies how to play the given Sound Effect:
0- Play once
1- Loop infinitely
2- "Overpower" (Music and other SFX are suspended until this Sound finishes playing)
1255 - Func_Stop_Sound_CurrObject
1257 - Func_Stop_Sound_FetchedObject
(ALL) (Example)
Stops a Sound Effect referenced by the Object's Sound Effect Reference Listing.
The "_CurrObject" versions retrieve the reference from the "Current Object".
The "_FetchedObject" versions retrieve the reference from the Object "Fetched" to "Reference 0".
Parameters:
- Entry ID
ID number of the entry within the Object's Sound Effect Reference Listing that references the desired Sound Effect
The "R" or "r" tags may be used to obtain the ID value from a Register.
Examples:
# 37 ;Play Music (Play Game-global Music 4)
: G4 ;Game-global Music 4
; ----------
# 37 ;Play Music (Play "Zone"-specific Music 6)
: Z6 ;"Zone"-specific Music 6
; ----------
# 37 ;Play Music (Play "Act"-specific Music 3)
: A3 ;"Act"-specific Music 3
; ----------
# 37 ;Play Music (Play the Music whose ID is stored in "User Register" 1)
: R1 ;Music whose ID is stored in "User Register" 1
78 - Func_Play_Temp_Music
(Description)
# 78 ;Load and Play Music (Temporarily load and play the music at ID 0 in the Music Def given by Game-global Text 4)
: G4 ;(TextID) Game-global Text 4
: 0 ;(MusID) Music ID 0 in the Music Def referenced by the given Text
; ----------
# 78 ;Load and Play Music (Temporarily load and play the music at the ID that is stored in "User Register 9" from the Music Def given by the Text whose ID is stored in "User Register 8")
: R8 ;(TextID) Text whose ID is stored in "User Register" 8
: R9 ;(MusID) Music whose ID 0 in the Music Def referenced by the given Text is stored in "User Register" 9
1399 - Func_PauseMusic
(Description)
#1399 ;Pause Music (Suspend Music Playback)
1401 - Func_ContinueMusic
(Description)
#1401 ;Continue Music (Resume Music Playback)
1403 - Func_FadeMusic
(Description)
#1403 ;FadeMusic (Fade music out to silence)
: 0 ;Minimum (Silent)
; ----------
#1403 ;FadeMusic (Fade music in to full volume)
: 64 ;Maximum
; ----------
#1403 ;FadeMusic (Fade music to the volume value stored in "User Register" 15)
: R15 ;Value stored in "User Register" 15
1405 - Func_SetMusicVol
(Description)
#1405 ;Set Music Volume (Immediately set Music volume to silence)
: 0 ;Minimum (Silent)
; ----------
#1405 ;Set Music Volume (Immediately set Music volume to full)
: 64 ;Maximum
; ----------
#1405 ;Set Music Volume (Immediately set Music volume to the value stored in "User Register" 3)
: R3 ;Value stored in "User Register" 3
1426 - Func_SetXMSpeedMod
(Description)
#1426 ;SetXMSpeedMod (Set XM Speed Modifier to 0 [no modifier] for normal speed)
: 0 ;(Speed) Normal Speed (BPM)
; ----------
#1426 ;SetXMSpeedMod (Set XM Speed Modifier to 8 for double speed)
: 8 ;(Speed) Double Speed (BPM * ((8+8)/8))
; ----------
#1426 ;SetXMSpeedMod (Set XM Speed Modifier to -8 for half speed)
: -8 ;(Speed) Half Speed (BPM / ((8+8)/8))
; ----------
#1426 ;SetXMSpeedMod (Set XM Speed Modifier to the value stored in "User Register" 27)
: u27 ;(Speed) Value stored in "User Register" 27
1427 - Func_SetXMPitchMod
(Description)
#1427 ;SetXMPitchMod (Set XM Pitch Modifier to 0 [no modifier] for normal Pitch)
: 0 ;(Pitch) Normal Pitch (BPM)
; ----------
#1427 ;SetXMPitchMod (Set XM Pitch Modifier to 64 to pitch up by 1 note)
: 64 ;(Pitch) 64 "FineTunes" (one note)
; ----------
#1427 ;SetXMPitchMod (Set XM Pitch Modifier to -64 to pitch down by 1 note)
: -64 ;(Pitch) -64 "FineTunes" (one note)
; ----------
#1427 ;SetXMPitchMod (Set XM Pitch Modifier to the value stored in "User Register" 11)
: u11 ;(Pitch) Value stored in "User Register" 11
1433 - Func_SetXMChanMute
(Description)
#1433 ;SetXMChanMute (Set Channel 0 of the currently-playing XM song to "Muted")
: 1 ;(Chan) XM Channel 1
: 1 ;(Mute) Mute; inaudible
; ----------
#1433 ;SetXMChanMute (Set Channel 9 of the currently-playing XM song to "Unmuted")
: 9 ;(Chan) XM Channel 2
: 0 ;(Mute) Unmute; audible
; ----------
#1433 ;SetXMChanMute (Set the "Mute" status of the Channel whose ID is stored in "User Register" 4 to the Value stored in "User Register" 5")
: R4 ;(Chan) Channel whose ID is stored in "User Register" 4
: R5 ;(Mute) Value stored in "User Register" 5"
1434 - Func_SetXMEventFunc
(Description)
#1434 ;SetXMEventFunc (Set Game-global Function 13 to run whenever an XM song encounters a "Zxx" Effect)
: G13 ;(FuncID) Game-global Function 13
; ----------
#1434 ;SetXMEventFunc (Set "Zone"-specific Function 2 to run whenever an XM song encounters a "Zxx" Effect)
: Z2 ;(FuncID) "Zone"-specific Function 2
; ----------
#1434 ;SetXMEventFunc (Set "Act"-specific Function 0 to run whenever an XM song encounters a "Zxx" Effect)
: A0 ;(FuncID) "Act"-specific Function 0
; ----------
#1434 ;SetXMEventFunc (Set the Function whose ID is stored in "User Register" 7 to run whenever an XM song encounters a "Zxx" Effect)
: R7 ;(FuncID) Function whose ID is stored in "User Register" 7
1435 - Func_XMDoEffect
(Description)
#1435 ;Func_XMDoEffect (Call XM Effect $0B with Parameter of 4 [Branch to Pattern 4] to run on the Channel that triggered the Event Function)
: $0B ;(Effect) XM Effect $0B (Pattern Branch)
: 4 ;(Param) Parameter value of 4 (For "Branch", Branch to Pattern 4)
; ----------
#1435 ;Func_XMDoEffect (Call the XM Effect whose ID is stored in "User Register" 1 with the Parameter Value stored in "User Register" 2 to run on the Channel that triggered the Event Function)
: R1 ;(Effect) XM Effect whose ID is stored in "User Register" 1
: R2 ;(Param) Value stored in "User Register" 2
Sound Effects:
# 40 ;Play Sound (Play Game-global Sound Effect 38 once)
: G38 ;(ID) Game-global Sound Effect 38
: 0 ;(Loop) No
; ----------
# 40 ;Play Sound (Play and loop "Zone"-specific Sound Effect 5)
: Z5 ;(ID) "Zone"-specific Sound Effect 5
: 1 ;(Loop) Yes
; ----------
# 40 ;Play Sound (Play "Act"-specific Sound Effect 1, causing music and all other Sounds to suspend until this Sound Effect is finished)
: A1 ;(ID) "Act"-specific Sound Effect 1<
: 2 ;(Loop) Overpower
; ----------
# 40 ;Play Sound (Play the Sound Effect whose ID is stored in "User Register" 6 once)
: R6 ;(ID) Value stored in "User Register" 6
: 0 ;(Loop) No
383 - Func_Stop_Sound
(Description)
# 383 ;Stop Sound (Stop "Zone"-specific Sound Effect 3)
: Z3 ;(ID) "Zone"-specific Sound Effect 3
; ----------
# 383 ;Stop Sound (Stop the Sound Effect whose ID is stored in "User Register" 18 once)
: R18 ;(ID) Value stored in "User Register" 18
1400 - Func_PauseSFX
(Description)
#1400 ;Pause Sound Effects (Suspend Sound Effect Playback)
1402 - Func_ContinueSFX
(Description)
#1402 ;Continue Sound Effects (Resume Sound Effect Playback)
1404 - Func_FadeSFX
(Description)
#1403 ;FadeSFX (Fade Sound Effects out to silence)
: 0 ;Minimum (Silent)
; ----------
#1403 ;FadeSFX (Fade Sound Effects in to full volume)
: 64 ;Maximum
; ----------
#1403 ;FadeSFX (Fade Sound Effects to the volume value stored in "User Register" 15)
: R15 ;Value stored in "User Register" 15
1406 - Func_SetSFXVol
(Description)
#1405 ;Set SFX Volume (Immediately set Sound Effect volume to silence)
: 0 ;Minimum (Silent)
; ----------
#1405 ;Set SFX Volume (Immediately set Sound Effect volume to full)
: 64 ;Maximum
; ----------
#1405 ;Set SFX Volume (Immediately set Sound Effect volume to the value stored in "User Register" 3)
: R3 ;Value stored in "User Register" 3
1250 - Func_Play_Sound_CurrPlayer
1252 - Func_Play_Sound_FetchedPlayer
(Description)
#1250 ;Play Sound CurrPlayer (Play and loop the Sound referenced by entry 1 in the Sound Reference List for the "Current Player")
: 1 ;(ID) Sound referenced by entry 1 in the Sound Reference List for the "Current Player"<
: 1 ;(Loop) Yes
; ----------
#1252 ;Play Sound FetchedPlayer (Play the Sound referenced by the Sound Reference List entry whose value is stored in "User Register" 6 for the Player "Fetched" to "Reference 0" once)
: R6 ;(ID) Value stored in "User Register" 6
: 0 ;(Loop) No
1254 - Func_Stop_Sound_CurrPlayer
1256 - Func_Stop_Sound_FetchedPlayer
(Description)
#1254 ;Stop Sound CurrPlayer (Stop the Sound referenced by entry 1 in the Sound Reference List for the "Current Player")
: 1 ;(ID) Sound referenced by entry 1 in the Sound Reference List for the "Current Player"<
; ----------
#1256 ;Stop Sound FetchedPlayer (Stop the Sound referenced by the Sound Reference List entry whose value is stored in "User Register" 6 for the Player "Fetched" to "Reference 0")
: R6 ;(ID) Value stored in "User Register" 6
1251 - Func_Play_Sound_CurrObject
1253 - Func_Play_Sound_FetchedObject
(Description)
#1251 ;Play Sound CurrObject (Play and loop the Sound referenced by entry 3 in the Sound Reference List for the "Current Object")
: 3 ;(ID) Sound referenced by entry 3 in the Sound Reference List for the "Current Object"<
: 0 ;(Loop) No
; ----------
#1253 ;Play Sound FetchedObject (Play the Sound referenced by the Sound Reference List entry whose value is stored in "User Register" 21 for the Object "Fetched" to "Reference 0" once)
: R21 ;(ID) Value stored in "User Register" 21
: 1 ;(Loop) Yes
1255 - Func_Stop_Sound_CurrObject
1257 - Func_Stop_Sound_FetchedObject
(Description)
#1254 ;Stop Sound CurrObject (Stop the Sound referenced by entry 3 in the Sound Reference List for the "Current Object")
: 3 ;(ID) Sound referenced by entry 3 in the Sound Reference List for the "Current Object"<
; ----------
#1256 ;Stop Sound FetchedObject (Stop the Sound referenced by the Sound Reference List entry whose value is stored in "User Register" 21 for the Object "Fetched" to "Reference 0")
: R21 ;(ID) Value stored in "User Register" 21