03CF

From GTAMods Wiki
Revision as of 05:19, 2 January 2015 by Spaceeinstein (talk | contribs)
Jump to navigation Jump to search

GTA III Vice City San Andreas LOAD_MISSION_AUDIO


Description

Loads the mission audio

Syntax

GTA III 03CF: load_wav [string]
Vice City 03CF: load_wav [string] as [int2]
San Andreas 03CF: load_wav [int1] as [int2]

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. A partial list of the predefined list for Vice City is here under the column script name. 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