Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Q: Audio Files load_wav


Jabhacksoul
 Share

Recommended Posts

I am using Sanny Builder 3.

 

As I understand this code:

 

03CF: load_wav 37472 as 1

 

It pulls the #37472 wav file from the library in audio/streams folder? I am sure these question has been asked in a variety of ways and I am sorry but I did wade through the search engine many times prior to asking this:

 

Can you define in your mission script a raw wav file without "injecting" the audio into the streams listed?

 

Basically what I am trying to do is the following:

 

I want to have the player and 2 other special actors standing outside having a conversation but I am not doing very well with the animation "IDLE_CHAT" it is a in game cut scene not a mission. So my coding should be fairly simple create the player and two other peds and have them chat. Not all that simple when working in machine code. mercie_blink.gif

 

087B: set_player $PLAYER_CHAR clothes_texture "policetr" model "policetr" body_part 17 087B: set_player $PLAYER_CHAR clothes_texture "bald" model "head" body_part 1 070D: rebuild_player $PLAYER_CHAR 0605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time 60000647: unknown_actor $ACTOR_ONE look_task 05BF: AS_actor $ACTOR_ONE look_at_actor $PLAYER_ACTOR 9000 ms 

 

 

How do I link the audio to the actor so it appears they are talking?

I have some grasp of assembly language but I am still struggling on this stuff.

 

Thanks for your assistance.

Link to comment
Share on other sites

spaceeinstein

All usable audio are defined in data\AudioEvents.txt.

 

Opcodes 09F1, 0967, and 0968 should work.

Link to comment
Share on other sites

 

All usable audio are defined in data\AudioEvents.txt.

 

Opcodes 09F1, 0967, and 0968 should work.

So something like this?

 

 

// Player is wearing police uniform and is bald087B: set_player $PLAYER_CHAR clothes_texture "policetr" model "policetr" body_part 17 087B: set_player $PLAYER_CHAR clothes_texture "bald" model "head" body_part 1 070D: rebuild_player $PLAYER_CHAR // Player waves his arms and bobs his head around to simulate talking for 9 seconds0605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time 9000// Other non player looks at player pretending to pay attention when we all know he is not0647: unknown_actor $ACTOR_ONE look_task 05BF: AS_actor $ACTOR_ONE look_at_actor $PLAYER_ACTOR 9000 ms // Set memory element 10 to Player008B: [email protected] = $PLAYER_ACTOR// Not sure about the "Event" part what the number represents? 09F1: play_audio_at_actor $PLAYER_ACTOR event 1992// Player flaps his lips for 9 seconds while my audio plays 0967: actor [email protected] move_mouth 9000 ms 0968: actor [email protected] stop_mouth

 

 

Am I missing something? mercie_blink.gif Must be that event crap...

 

Ok, dropped off line to make changes to my thread. Here is the entire thread:

 

 

:MY_CS02thread 'MY_CS02' gosub @MY_CS02_108 // Init Mission if wasted_or_busted else_jump @MY_CS02_105 gosub @MY_CS02_600 :MY_CS02_105gosub @MY_CS02_900  // End Missionend_thread :MY_CS02_108 023C: load_special_actor 'TENPEN' as 1 // models 290-299 023C: load_special_actor 'PULASKI' as 2 // models 290-299 023C: load_special_actor 'HERN' as 3 // models 290-299 :MY_CS02_110if or823D:   not special_actor 1 loaded 823D:   not special_actor 2 loaded 823D:   not special_actor 3 loaded else_jump @MY_CS02_120 wait 0 jump @MY_CS02_110 :MY_CS02_120$ACTOR_ONE = Actor.Create(Mission1, #SPECIAL01, 1550.68, -1675.49, 14.51)$ACTOR_TWO = Actor.Create(Mission1, #SPECIAL02, 1541.156, -1672.352, 13.552)$ACTOR_THR = Actor.Create(Mission1, #SPECIAL03, 1541.156, -1678.352, 13.552)Actor.Angle($ACTOR_ONE) = 90.0Actor.Angle($ACTOR_TWO) = 0.0Actor.Angle($ACTOR_THR) = 180.00605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time 9000// Other non player looks at player pretending to pay attention when we all know he is not0647: unknown_actor $ACTOR_ONE look_task0647: unknown_actor $ACTOR_TWO look_task0647: unknown_actor $ACTOR_THR look_task05BF: AS_actor $ACTOR_ONE look_at_actor $PLAYER_ACTOR 9000 ms05BF: AS_actor $ACTOR_TWO look_at_actor $PLAYER_ACTOR 9000 ms05BF: AS_actor $ACTOR_THR look_at_actor $PLAYER_ACTOR 9000 ms// Set memory element 10 to Player008B: [email protected] = $PLAYER_ACTOR// Not sure about the "Event" part what the number represents?//09F1: play_audio_at_actor $PLAYER_ACTOR event 1992// Player flaps his lips for 9 seconds while my audio plays0967: actor [email protected] move_mouth 9000 msif   not Actor.Dead([email protected])else_jump @MY_CS02_600 0968: actor [email protected] stop_mouthreturn:MY_CS02_60000BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!return:MY_CS02_900$ONMISSION = 0 01BD: $CURRENT_TIME_IN_MS = current_time_in_ms mission_cleanup return 

 

 

Now CJ stands there talking to himself and never stops talking without audio.

Also my actors all three seem to ignore him and walk away and the mission fails. I must be missing a kill switch.

 

Comments?

Edited by Jabhacksoul
Link to comment
Share on other sites

 

 

Now CJ stands there talking to himself and never stops talking without audio.

Also my actors all three seem to ignore him and walk away and the mission fails.  I must be missing a kill switch.

 

Comments?

It must crash or stuck at this point:

 

if not Actor.Dead([email protected])else_jump @MY_CS02_600

 

because [email protected] is not defined

And if not crash or not stuck the mission ends immediately because it runs into the return and cancel the mission script

 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Not all sounds can be found in data\AudioEvents.txt, but the most important

 

///////SOUNDS/////

A small part of them can be startet with play sound opcodes: 018C: 097A: 09F1:

Find sounds in the range from SOUND_1002 to SOUND_1191. Not all worked by me. It seems that someone only can used from the exe

Someone of these sounds are durable and must be started with 018D: and stoped with 018E:

 

Some other ones of these sounds have a replay mode (music for minigames) and can be stoped with a stop sound

SOUND_PILOT_AWARD_TRACK_START 1187 start sound

SOUND_PILOT_AWARD_TRACK_STOP 1188 stop sound

 

 

///////WAVE/////

The most part of AudioEvents.txt includes waves and must used with

 

03CF: load_wav  1828 as  100D6: if  003D0:   wav  1 loaded004D: jump_if_false @03D1: play_wav 1

 

 

can be attached to actor or object

 

0949: link_wav 1 to_actor [email protected]

 

 

if wave is finish should be unloaded

 

040D: unload_wav 1

 

 

in original is usual to unload wav before loading a wav

 

:AUDIOL_3300D6: if  00039:   [email protected] ==  0  // integer values004D: jump_if_false @AUDIOL_38040D: unload_wav [email protected]: load_wav [email protected] as [email protected]

 

 

you can also check if the sound is finish

 

00D6: if  003D2:   wav 1 ended004D: jump_if_false @

 

 

In the original main exists a thread which do the work for loading and playing waves and link wave to actor

Its

name_thread 'AUDIOL'

 

you can use it with your script in the main.scm with the create_thread command with parameters

 

04AE: unknown $ACTOR_SPEECH_WAV_FILE radar_icon_or_model  16481004F: create_thread @AUDIOL_1 $PLAYER_ACTOR  0  1  1  0

 

Instead of $PLAYER_ACTOR can be set the variable name of the actor in your script

04AE: is used to give the sound number to $ACTOR_SPEECH_WAV_FILE

can also be

 

0004: $ACTOR_SPEECH_WAV_FILE =  16481  // integer values

 

 

 

///autom. phrases///////

Other way to let actor speak which is not written in AudioEvents.txt is

 

09D5: unknown_get_actor [email protected] unknown 342 flags 1 1 1 store_to [email protected]

 

first param, [email protected] is the actor variable name

second param, 342 is slot with some different phrases sounds

third, fourth, fift param of flags, dont know

last param, [email protected] have no effect, can allways be any unused variable

 

for different actors, male, female, player, girlfriends, naked girlfriends, ammu seller, foodshop seller, haircut and tattoo seller

exists different phrases slots and chooses automaticly and random a sound of more ones from each slot

 

///the chatt opcode///

the chatt opcode 0677: works only by consideration of some special condition

1. it needs to use the task mask 062E:

2. It must running in a loop

3. works only with actors which have the entry 1983 in the peds.ide

If any actor disturb the scene, the chatt actors stop the chatt because of the task mask

Exemble script:

 

:Chatt03A4: name_thread "CHT":Chatt_10001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @Chatt_100D6: if 000FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point 2500.193 -1659.034 13.36 radius 1.0 1.0 2.0004D: jump_if_false @Chatt_10001: wait 1000 ms0247: request_model #WFYST0247: request_model #SMYST:Chatt_20001: wait 0 ms00D6: if 10248: model #WFYST available0248: model #SMYST available004D: jump_if_false @Chatt_20001: wait 1000 ms009A: [email protected] = create_actor 7 #WFYST at 2504.193 -1651.034 13.60173: set_actor [email protected] z_angle_to 210.0009A: [email protected] = create_actor 7 #SMYST at 2505.193 -1652.034 13.60173: set_actor [email protected] z_angle_to 30.00249: release_model #WFYST0249: release_model #SMYST:Chatt_30001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @Chatt_500D6: if 18118: NOT actor [email protected] dead8118: NOT actor [email protected] dead004D: jump_if_false @Chatt_5062E: [email protected] 1655 [email protected]: [email protected] 1655 [email protected]: if 104A4: [email protected] 704A4: [email protected] 7004D: jump_if_false @Chatt_40677: AS_actor [email protected] chat_with_actor [email protected] 1 10677: AS_actor [email protected] chat_with_actor [email protected] 0 1:Chatt_400D6: if 000E1: key_pressed 0 19//nach hinten schauen004D: jump_if_false @Chatt_30001: wait 1000 ms:Chatt_501C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian0002: jump @Chatt_1

 

 

 

//////play soundtrack from file BEAT or AMBIENCE

 

 

0953: get_soundtrack_status_to [email protected] if0039:   [email protected] ==  0;; integer values004D: jump_if_false @//0952: load_soundtrack 12 //0954: start_playing_loaded_soundtrack //0955: end_playing_loaded_soundtrack

 

 

use following track numbers: 1, 2, 3, 4, 8, 9, 10, 12, 13

 

//////Radio///

Radio music only works if player is in vehicle

There exist only these codes for radio music

 

041E: set_radio_station 3 051E: [email protected] = get_current_radio_station 0A26: set_radio_to_favorite_station

 

 

 

/////////////////sound numbers and AudioEvents.txt//////////////

The sounds which are used with 03CF: load_wav 1828 as 1

are mostly dialog sounds of missions

The names of these waves are the entry names from gxt dialog texts

exemble:

SOUND_MAN5_BK 24412

search in american.gxt for MAN5_BK

and find the dialog text:

~z~You got ice cold gangstas running through your veins!

 

The sound numbers have NO association with Audio file numbers, folder, banks

Only way I know to find sounds is to write a sound test script

 

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

Man you are one smart bug ZAZ!

 

I found this out last night so when I changed this and remove the not it stopped jumping to mission failed text. I used the F1 key to make the line so I guess live and learn.

 

 

ifnot Actor.Dead([email protected])else_jump @MY_CS02_600

 

 

I guess since this is really not a mission I shouldn't bother with it anyway. He is just talking to the others. I was studying the original main.scm where CJ and Ryder have conversations but your script seems to be cleaner than even R*'s. Your snippet goes directly from A to Z without jumping all over the place. When I finish the mod I will be sure to credit you for the help and tell you where to download it. My brother is working on the new wav files and I was hoping beyond the scope of what I have read that we could just add them to the directory not inject them overwriting others. I really appreciate your efforts.

 

Link to comment
Share on other sites

For anyone else looking for this information, here is the code and details on how to link sounds.

 

//Cut Scene 01 "The Conversation":MISSN_01_200                                       //Enter this as Gosub @MISSN_01_20003CF: load_wav 43205 as 1                           //Grove Street Home...gosub @MISSN_01_280                                 //wait for wav to load see below0949: link_wav 1 to_actor $PLAYER_ACTOR            //link it to the player03D1: play_wav 1                                    //play it 0605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time -1gosub @MISSN_01_290                                  //wait for wav to unload03CF: load_wav 43206 as 1                            //At least it was until I...gosub @MISSN_01_280                                  //wait for wav to load  0949: link_wav 1 to_actor $PLAYER_ACTOR               //link it to the player03D1: play_wav 1                                     //play it 0605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time -1gosub @MISSN_01_290                                  //wait for wav to load03CF: load_wav 20041 as 1                            //Sweet: Come on CJ let's go!gosub @MISSN_01_280                                  //wait for wav to unload0949: link_wav 1 to_actor $ACTOR_SWEET               //link to other non player03D1: play_wav 1                                          //play it0605: actor $ACTOR_SWEET perform_animation_sequence "IDLE_CHAT" IFP_file "PED" 4.0 loop 0 0 0 0 time -1gosub @MISSN_01_290                                   //wait for wav to unloadreturn//Subroutine to wait for wave loading:MISSN_01_280wait 0if  03D0:   wav 1 loaded jf @MISSN_01_280return//Subroutine to wait for the wav to play out:MISSN_01_290wait 0if 03D2:   wav 1 ended jf @MISSN_01_290040D: unload_wav 1 return

 

 

For those of you reading this in the future, jumps always go to where they are told while subroutines return from where they came. To illustrate this; if I wrote a subroutine for the letters at = * then this:

That fat cat sat on a very large hat. = Th* f* c* s* on a very large h*. gosub *=at return

 

So if you find yourself repeating code over and over use simple subroutines with gosub and return.

 

Thanks Zaz!

 

 

Link to comment
Share on other sites

///the chatt opcode///

the chatt opcode 0677: works only by consideration of some special condition

1. it needs to use the task mask 062E:

2. It must running in a loop

3. works only with actors which have the entry 1983 in the peds.ide

If any actor disturb the scene, the chatt actors stop the chatt because of the task mask

1) No it does not.

2) No it does not.

3) Not true, ANY created actor can use it. "1983" (and others in peds.ide) is a hex value determining which cars that particular ped can drive - it has NOTHING to do with this opcode.

4) Sort of, but it has nothing to do with the task mask. All this opcode does is give you manual control of the "random conversations" the peds will have; they do three lines each then stop. You can also interrupt with "clear actor task".

 

Just sayin'.

I'm actually not against democracy though. I'm against things I think are f*cking stupid. I think this is f*cking stupid. - Sweets

Link to comment
Share on other sites

 

///the chatt opcode///

the chatt opcode 0677: works only by consideration of some special condition

1. it needs to use the task mask 062E:

2. It must running in a loop

3. works only with actors which have the entry 1983 in the peds.ide

If any actor disturb the scene, the chatt actors stop the chatt because of the task mask

1) No it does not.

2) No it does not.

3) Not true, ANY created actor can use it. "1983" (and others in peds.ide) is a hex value determining which cars that particular ped can drive - it has NOTHING to do with this opcode.

4) Sort of, but it has nothing to do with the task mask. All this opcode does is give you manual control of the "random conversations" the peds will have; they do three lines each then stop. You can also interrupt with "clear actor task".

 

Just sayin'.

Nice to see you, Ceedj.

Its long time ago as worked out how to run the chatt opcode.

I looked into Mission Beach Party and found these coding,

and I got it only by using the same and only with actors with 1983

Could you post an alternativ script ?

I think you are using scm hook. We have seen in past that something works different.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.