Difference between revisions of "03CF"
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
:: Buffer, either 1 or 2 | :: Buffer, either 1 or 2 | ||
− | This opcode loads a wav audio generally played during missions. For GTA III and Vice City, the audio name is not based on the audio file name; it is based on a predefined list hardcoded into the game, although a vast majority of the names do match the file names. Names are not case sensitive and must be 7 characters or less, which is already taken care by the predefined list | + | This opcode loads a wav audio generally played during missions. For GTA III and Vice City, the audio name is not based on the audio file name; it is based on a predefined list hardcoded into the game, although a vast majority of the names do match the file names. Names are not case sensitive and must be 7 characters or less, which is already taken care by the predefined list. In GTA III, only one audio can be loaded at a time but from Vice City and onwards more than one can be loaded. [[03D0]] checks if it has been loaded, [[03D1]] plays it, and [[040D]] clears it. |
== Example == | == Example == | ||
Line 45: | Line 45: | ||
== Keywords == | == Keywords == | ||
load, wav, mission, audio | load, wav, mission, audio | ||
+ | |||
+ | == See also == | ||
+ | * {{Icon|3}} [[Audio (folder, III)|Complete list of audio names for GTA III]] | ||
+ | * {{Icon|VC}} [[Audio (folder, VC)|Complete list of audio names for Vice City]] | ||
[[Category:OpCodes]] | [[Category:OpCodes]] | ||
[[Category:Code Snippets]] | [[Category:Code Snippets]] |
Revision as of 05:32, 28 January 2015
Description
- Loads the mission audio
Syntax
Parameter
- [string]
- Audio name, must be from a predefined but hardcoded list
- [int1]
- Audio event
- [int2]
- Buffer, either 1 or 2
This opcode loads a wav audio generally played during missions. For GTA III and Vice City, the audio name is not based on the audio file name; it is based on a predefined list hardcoded into the game, although a vast majority of the names do match the file names. Names are not case sensitive and must be 7 characters or less, which is already taken care by the predefined list. In GTA III, only one audio can be loaded at a time but from Vice City and onwards more than one can be loaded. 03D0 checks if it has been loaded, 03D1 plays it, and 040D clears it.
Example
The following example, for Vice City using Sanny Builder, will play an air horn audio after the CAMERA key is pressed.
// set constants
const
AUDIO = 'AIRHRNL'
end
while true
wait 10
if
00E1: player 0 pressed_button 13 // camera key
then
03CF: load_wav AUDIO as 1
while 83D0: not wav 1 loaded
wait 0
end
03D1: play_wav 1
while 83D2: not wav 1 ended
wait 0
end
040D: unload_wav 1
end
end
Keywords
load, wav, mission, audio