Difference between revisions of "03CF"
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Icon| | + | {{OpCode |
− | + | | games = {{Icon|t}} | |
− | + | | command = LOAD_MISSION_AUDIO | |
− | + | | description = Loads the mission audio | |
− | + | | syntax1 = {{Icon|3}} 03CF: load_wav '[''string'']' | |
− | + | | syntax2 = {{Icon|VC}} 03CF: load_wav '[''string'']' as [''int2''] | |
− | + | | syntax3 = {{Icon|SA}} 03CF: load_wav [''int1''] as [''int2''] | |
− | + | | p1t = [''int2''] | |
− | '' | + | | p1d = Buffer, either 1 or 2 |
− | + | | p2t = [''string''] | |
− | + | | p2d = Audio name, must be from a predefined but hardcoded list | |
− | + | | p3t = [''int1''] | |
− | + | | p3d = Audio event | |
− | + | }} | |
− | |||
− | 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. | + | 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 (any upper case letters (A-Z) are converted to lower case by the game internally) 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 == | ||
− | The following example | + | The following example for Vice City plays an air horn audio after pressing [[00E1|button 13]] (CAMERA key). |
− | < | + | {{Pre|class=sb-code|1= |
− | // set constants | + | <span class="c1">// set constants</span> |
− | const | + | <span class="k">const</span> |
− | AUDIO = 'AIRHRNL' | + | AUDIO = <span class="s1">'AIRHRNL'</span> |
− | end | + | <span class="k">end</span> |
− | while true | + | <span class="k">while</span> <span class="k">true</span> |
− | wait 10 | + | <span class="k">wait</span> <span class="m">10</span> |
− | if | + | <span class="k">if</span> |
− | 00E1: player 0 pressed_button 13 // camera key | + | [[00E1]]: player <span class="m">0</span> pressed_button <span class="m">13</span> <span class="c1">// camera key</span> |
− | then | + | <span class="k">then</span> |
− | 03CF: load_wav AUDIO as 1 | + | 03CF: load_wav AUDIO as <span class="m">1</span> |
− | while 83D0: not wav 1 loaded | + | <span class="k">while</span> 83D0: <span class="k">not</span> wav <span class="m">1</span> loaded |
− | wait 0 | + | <span class="k">wait</span> <span class="m">0</span> |
− | end | + | <span class="k">end</span> |
− | 03D1: play_wav 1 | + | 03D1: play_wav <span class="m">1</span> |
− | while 83D2: not wav 1 ended | + | <span class="k">while</span> 83D2: <span class="k">not</span> wav <span class="m">1</span> ended |
− | wait 0 | + | <span class="k">wait</span> <span class="m">0</span> |
− | end | + | <span class="k">end</span> |
− | 040D: unload_wav 1 | + | 040D: unload_wav <span class="m">1</span> |
− | end | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | </ | + | }} |
== Keywords == | == Keywords == | ||
Line 47: | Line 46: | ||
== See also == | == See also == | ||
− | * {{Icon|3}} [[Audio ( | + | * {{Icon|3}} [[Audio directory (III)|Complete list of audio names for GTA III]] |
− | * {{Icon|VC}} [[Audio ( | + | * {{Icon|VC}} [[Audio directory (VC)|Complete list of audio names for Vice City]] |
− | |||
− | |||
− |
Latest revision as of 06:42, 15 January 2017
- Description
- Loads the mission audio
- Syntax
- 03CF: load_wav '[string]'
- 03CF: load_wav '[string]' as [int2]
- 03CF: load_wav [int1] as [int2]
- Parameter
- [int2]
- Buffer, either 1 or 2
- [string]
- Audio name, must be from a predefined but hardcoded list
- [int1]
- Audio event
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 (any upper case letters (A-Z) are converted to lower case by the game internally) 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 plays an air horn audio after pressing button 13 (CAMERA key).
// 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