Quantcast

Jump to content

» «
Photo

How to mute car engine audio?

34 replies to this topic
Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#1

Posted 06 December 2013 - 08:35 AM

I'm creating a mod of car status from handling of it, and after, a mod to tuning the car (like engine and turbo)
gta_sa+2013-12-05+10-56-02-20.jpg
My idea is when you buy a new engine, the audio of it will change too, then i need to "mute" the engine audio and then recreate the audio of engine using audio files and playing with cleo (i already have ideas of how to create this) @_@

Manfred Von Karma
  • Manfred Von Karma

    Trick

  • Members
  • Joined: 16 Jun 2009
  • None

#2

Posted 06 December 2013 - 11:33 PM

This is the engine audio list made by Sanny :

 

http://sannybuilder....nginesounds.htm

 

You'll see that each vehicle engine has two different sounds , one plays when accelerating and the other when deccelerating .

Lets say that you want to disable the Landstalker engine sound , all you have to do is get the address of the vehicle's engine sound from the list ( Memory Address v1.0 Decimal case ) wich is 8784626 and past it in this little script that i've made : 

0@ = 8784626 // Vehicles engine sound address
0A8C: write_memory 0@ size 2 value -1 virtual_protect 0 // accl id
0@ += 2
0A8C: write_memory 0@ size 2 value -1 virtual_protect 0 // decc id

-1 disables the engine sound , but if you want to give the Landstalker engine's a sound of a different vehicle ( Sanchez for exemple ) all you have to do is pick the accl/decc ids from Sanny's list wich are 48 and 47

0@ = 8784626 // Vehicles engine sound address
0A8C: write_memory 0@ size 2 value 48 virtual_protect 0 // accl id
0@ += 2
0A8C: write_memory 0@ size 2 value 47 virtual_protect 0 // decc id
  • _DK and ChopTheDog. like this

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#3

Posted 07 December 2013 - 07:21 AM Edited by Junior_Djjr, 07 December 2013 - 07:25 AM.

thanks
worked, but if i have Vehicle Audio Loader (by fastman92) installed don't work :c

and as i expected, i have to respawn the vehicle... beyond all vehicles of the same model are affected together

i need any thing like 0A1C: (mute the heli engine) but in a car .-.
have something in struct of the vehicle to disable the audio of engine? (like when you put the car in underwater but you can get it of the water, the car stops the audio of engine but continues driving, i need this lol)

edit: have this (081D) but the car don't continues driving.....

_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#4

Posted 07 December 2013 - 08:58 AM

Try this.
0A97: 1@ = car 0@ struct
1@ += 0x1F5
0A8C: write_memory 1@ size 1 value true virtual_protect 0

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#5

Posted 07 December 2013 - 02:58 PM Edited by fastman92, 08 December 2013 - 09:16 AM.

worked, but if i have Vehicle Audio Loader (by fastman92) installed don't work :c


You must use this function instead:
:getVehicleAudioPropertiesByModelID
{
 Description: 
    Returns address to tVehicleAudioProperties struct of vehicle by ID.
    
    Works with or without Vehicle Audio Loader by fastman92.
 Type: PROPERTY
  
 Parameters:
   Passed:
     0@ - vehicle ID  
     
 Returned:
     0@ - pointer to tVehicleAudioProperties struct of vehicle by ID.  
 
 Example:
  0AB1: call_scm_func @getVehicleAudioPropertiesByModelID 1 vehicle_ID 400 store_pointer_to 5@
}
0A8D: 1@ = read_memory 0x004F5C26 size 4 virtual_protect false      // 0x004F5C23 + 3

2@ = 0x4F5C16
0A8D: 3@ = read_memory 2@ size 1 virtual_protect false

if
3@ == 0x2D
then
    2@ += 1
    0A8D: 3@ = read_memory 2@ size 4 virtual_protect false
    0062: 0@ -= 3@  // (int) 
end

0@ *= 0x24      // 0@ *= sizeof(tVehicleAudioProperties)

005A: 0@ += 1@  // (int)
 
0AB2: ret 1 0@
Pass model ID to it.

Use GTAG SCM (v1).

You may find this opcode useful:
0441: 6@ = car $TEMPVAR_ACTOR_CAR model
The structure:
00000000 tVehicleAudioProperties struc ; (sizeof=0x24)
00000000 VehicleType     dw ?                    ; base 10
00000002 EngineOnSound   dw ?                    ; base 10
00000004 EngineOffSound  dw ?                    ; base 10
00000006 field_4         dw ?                    ; base 10
00000008 field_5         dd ?
0000000C field_6         dd ?
00000010 HornTon         db ?                    ; base 10
00000011 field_8         db 3 dup(?)
00000014 HornHigh        dd ?
00000018 DoorSound       db ?                    ; base 10
00000019 field_11        db ?
0000001A RadioNum        db ?                    ; base 10
0000001B RadioType       db ?                    ; base 10
0000001C field_14        db ?                    ; base 10
0000001D field_15        db 3 dup(?)
00000020 field_16        dd ?
00000024 tVehicleAudioProperties ends
#pragma pack(push, 1)
struct tVehicleAudioProperties
{
  __int16 VehicleType;		//	1: +  0
  __int16 EngineOnSound;	//  2: +  2
  __int16 EngineOffSound;	//  3: +  4
  __int16 field_4;			//  4: +  6
  float field_5;			//  5: +  8
  float field_6;			//  6: + 12
  char HornTon;				//  7: + 16
  char field_8[3];			//	8: + 17, zeros
  float HornHigh;			//  9: + 20
  char DoorSound;			// 10: + 24
  char field_11[1];			// 11: + 25, zeros
  char RadioNum;			// 12: + 26
  char RadioType;			// 13: + 27
  char field_14;			// 14: + 28
  char field_15[3];			// 15: + 29, zeros
  float field_16;			// 16: + 32
};
#pragma pack(pop)

_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#6

Posted 07 December 2013 - 03:25 PM

It possibly won't work because tVehicleAudioProperties is copied to CVehicle struct at its initialisation (and then 'game' works with this data within CVehicle).

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#7

Posted 07 December 2013 - 06:07 PM

Try this.

0A97: 1@ = car 0@ struct
1@ += 0x1F5
0A8C: write_memory 1@ size 1 value true virtual_protect 0

you tested? here don't worked, not change
is this a address to turn of the audio of engine of car? what is this exactly?
have other address to try?


@fastman
yeah, worked, but the result is the same of:
0@ = 8784626 // Vehicles engine sound address
0A8C: write_memory 0@ size 2 value -1 virtual_protect 0 // accl id
0@ += 2
0A8C: write_memory 0@ size 2 value -1 virtual_protect 0 // decc id
...but now, working in your mod
and i don't need this, 'cause this affects ALL cars with that model

_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#8

Posted 07 December 2013 - 06:36 PM

Junior_Djjr, I got this offset from 0A1C opcode. Maybe it works only for helis then.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#9

Posted 07 December 2013 - 06:49 PM

Sorry to tell it, but you won't go far without ability to reverse engineer executable code and make your own findings.
8883d7293521057.jpg

MrPeteyMax
  • MrPeteyMax

    DON'T TOUCH ME YOU FILTHY CASUAL

  • Members
  • Joined: 22 Sep 2013

#10

Posted 07 December 2013 - 06:55 PM

I'm not posting here to help because I have no idea how scripting likethis works, I just wanna say this mod is a really good idea, and I hope you keep going with it!

 

I remember going to Pay n' Spray and saying you get a new engine but nothing changed! Keep up the good work.


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#11

Posted 07 December 2013 - 07:04 PM Edited by fastman92, 07 December 2013 - 07:04 PM.

What do you exactly want? Multiple vehicle engine sounds and the active engine sound controlled by the CLEO script?
 
using audio files and playing with cleo
That won't work.
Only GTA SA audio files may be used - GENRL in this case.

_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#12

Posted 07 December 2013 - 10:34 PM

Possibly that's the func which updates engine sound
http://pastebin.com/ypqeP51g

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#13

Posted 08 December 2013 - 07:48 AM

What do you exactly want? Multiple vehicle engine sounds and the active engine sound controlled by the CLEO script?


i need any thing like 0A1C: (mute the heli engine) but in a car .-.
have something in struct of the vehicle to disable the audio of engine? (like when you put the car in underwater but you can get it of the water, the car stops the audio of engine but continues driving, i need this lol)

edit: have this (081D) but the car don't continues driving.....

read ↑
simple... mute the engine of car, but, IN ONE CAR, the same of 081D make with helis, the audio of engine i can make after..

the problem is: i need make in ONE car, only in THIS car, and not in the model of car


btw: the gear of car changes in wrong time of we can see, like... the opcode return a new gear, and AFTER (some like 1 or 2 secs) we can see the gear changing in the car... then i need the rpm memory address (thats all i need to i start the "new" "system" of audio of engines) (i will use audios of forza)
i think the fabio3 give me a memory address to read rpm of car (the same used in imvehft?) ...but i losted the address and i losted he (stop to enter in facebook :p ) anyone can pass to me?


Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia

#14

Posted 08 December 2013 - 08:57 AM

5@ = Actor.CurrentCar($PLAYER_ACTOR)
0A97: 0@ = car 5@ struct
0@ += 0x138 // vehdata
0@ += 0xDC // sound 1
0A8C: write_memory 0@ size 2 value 0 virtual_protect 0
0@ += 0x2 // sound 2
0A8C: write_memory 0@ size 2 value 0 virtual_protect 0

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#15

Posted 08 December 2013 - 10:56 AM

5@ = Actor.CurrentCar($PLAYER_ACTOR)
0A97: 0@ = car 5@ struct
0@ += 0x138 // vehdata
0@ += 0xDC // sound 1
0A8C: write_memory 0@ size 2 value 0 virtual_protect 0
0@ += 0x2 // sound 2
0A8C: write_memory 0@ size 2 value 0 virtual_protect 0

seemann :3

 

P.E.R.F.E.C.T. (or not?)

in value 0 the audio bugs when i get of and enter in a car... the car make the shoes sounds (lol)

then i write -1 and now is perfect of i wanted

 

 

the only last thing of i want is an address of rpm of car, in some speedometer used the gear ratio or something, but is better use the the "real" rpm... imvehft/steering used this?

then with rpm of car i can control the audios of engine


Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia

#16

Posted 08 December 2013 - 02:28 PM

I might be wrong, but there's no such parameter as 'rpm'. GTA SA makes changes to the vehicle gears based on the current velocity, which is stored at [vehicleStruct+0x384]+0x2c+0x64. A copy of this value for the player car is at 0x00C1CB40.

 

This code will output a pseudo rpm number for the vehicle 5@:

            0A97: 0@ = car 5@ struct
            0@ += 0x384 // // vehicle.pHandling
            0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
            0@ += 0x2C // handling.transmissionData
            0@ += 0x64 // transmission.engineAcceleration
            
            
            0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
            1@ *= 10000.0
            0092: 1@ = float 1@ to_integer
 
            045A: draw_text_1number 320.0 155.333 GXT 'BJ_0' number 1@
            03F0: enable_text_draw 1

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#17

Posted 08 December 2013 - 04:17 PM

this is pratically the same of i get the car speed .-.

this "rpm" don't returns to 0 when gear changes, and the gear changes in differents values, "6000" or "7000" for example, then is impossible to get the exact time of the gear changes

 

how the "tachometers" works? like steering mod and others speedometers mods (any good source to share?), all of i need is one value to check the "rpm" of actual gear and check to gear changes, cause the 0AB8: don't return the gear correctly...... return a value and after secs the gear changes...


Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#18

Posted 08 December 2013 - 04:32 PM

this "rpm" don't returns to 0 when gear changes


It doesn't return to 0 in real life too, unless you can't shift. Sounds like a completely valid behaviour.

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#19

Posted 08 December 2013 - 06:21 PM Edited by Junior_Djjr, 08 December 2013 - 06:24 PM.

 

this "rpm" don't returns to 0 when gear changes


It doesn't return to 0 in real life too, unless you can't shift. Sounds like a completely valid behaviour.

 

hahaha i know

i meant to say: the value don't changes when the gear changes, then is impossible to know if gear change or not, and know this is the main of i want......

(btw, in real, the rpm diminues .-. in this value no, but the only problem is to get the moment of gear changes)


_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#20

Posted 08 December 2013 - 10:01 PM Edited by _DK, 08 December 2013 - 10:03 PM.

0AB8 returns the gear correctly.
{$CLEO}

0000:
while true
    wait 0
    if
        player.Defined(0)
    then
        if
            actor.Driving($PLAYER_ACTOR)
        then
            0@ = actor.CurrentCar($PLAYER_ACTOR)
            0A97: 0@ = car 0@ struct
            0A8E: 1@ = 0@ + 0x4B4
            0A8D: 1@ = read_memory 1@ size 1 virtual_protect 0
            0A8E: 2@ = 0@ + 0x808
            0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
            0AD1: show_formatted_text_highpriority "Gear %d %.3f" time 100 1@ 2@
        end
    end
end

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#21

Posted 09 December 2013 - 12:47 AM

0AB8 returns the gear correctly.

{$CLEO}

0000:
while true
    wait 0
    if
        player.Defined(0)
    then
        if
            actor.Driving($PLAYER_ACTOR)
        then
            0@ = actor.CurrentCar($PLAYER_ACTOR)
            0A97: 0@ = car 0@ struct
            0A8E: 1@ = 0@ + 0x4B4
            0A8D: 1@ = read_memory 1@ size 1 virtual_protect 0
            0A8E: 2@ = 0@ + 0x808
            0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
            0AD1: show_formatted_text_highpriority "Gear %d %.3f" time 100 1@ 2@
        end
    end
end

you tested? like i said, the number of gear returns a different number... i can see the value changing and after seconds the car changes the gear (or the car changes the gear and then the value change...)

and this is big wrong, like 1, 2 secs... for example, the gear returns "3" but the car only changed the gear one time! (what can see in movement and audio)

(is only here? impossible)


_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#22

Posted 09 December 2013 - 01:49 AM Edited by _DK, 09 December 2013 - 02:01 AM.

But how do you actually detect when gear is changed? With sound changing?  :lol:

So that means you want to know when vehicle changes its sounds.


Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#23

Posted 09 December 2013 - 03:37 AM Edited by Junior_Djjr, 09 December 2013 - 03:38 AM.

But how do you actually detect when gear is changed? With sound changing?  :lol:

So that means you want to know when vehicle changes its sounds.

the sound changing and moves the suspension of car, is easy to see

i think the easily way is when vehicle moves suspension of gear change or something

 

but, whatever...


Manfred Von Karma
  • Manfred Von Karma

    Trick

  • Members
  • Joined: 16 Jun 2009
  • None

#24

Posted 09 December 2013 - 11:39 AM

 If you want to add your customized sounds to gta vehicles including gear change sound , then the best way to do it is to make a script that adds virtual gear change , and here is a mod that may help you made by sst5416 , its a virtual manual transmission mod  : http://www.gtagarage...ow.php?id=13722

 

cz as far as i know , you cant control the default gear change in gtasa .


Silent
  • Silent

    Moderating Cookie Monster

  • Feroci Racing
  • Joined: 01 Feb 2010
  • Poland

#25

Posted 09 December 2013 - 03:53 PM

From what I've seen, gears 1 and 2 'share' the loop. Doesn't mean 0AB8 is not working properly.

Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#26

Posted 09 December 2013 - 07:23 PM

 If you want to add your customized sounds to gta vehicles including gear change sound , then the best way to do it is to make a script that adds virtual gear change , and here is a mod that may help you made by sst5416 , its a virtual manual transmission mod  : http://www.gtagarage...ow.php?id=13722

 

cz as far as i know , you cant control the default gear change in gtasa .

no, this may "spoil" my mod .-.

 

From what I've seen, gears 1 and 2 'share' the loop. Doesn't mean 0AB8 is not working properly.

correcting what i meant: the gear of gta dont work correctly :p 

the value returns wrong, try to decelerate and acelerate the car, then... not only 1 and 2, but all values of gears changes in wrong time of you can see in the movement/sound of car

 

i meant that is impossible to create my mod with this opcode or any address to get this value, i need other way, any address to get the time of car make the movement of suspension + sound change?

and even though i don't "re-create" the audio of engine, i need this to create a turbo sound of my mod .-.


_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#27

Posted 09 December 2013 - 08:04 PM Edited by _DK, 09 December 2013 - 08:08 PM.

I think sound doesn't change with gear changing. Looks like it just playing audio in a loop with some delay.


Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#28

Posted 10 December 2013 - 01:58 AM

I think sound doesn't change with gear changing. Looks like it just playing audio in a loop with some delay.

yes, you may be correct

but anyway, the suspension of car moves too, some cars is a little movement, but cars like elegy is very easy to see


Junior_Djjr
  • Junior_Djjr

    BMS - Brazilian Modding Studio

  • Members
  • Joined: 16 Dec 2011
  • Brazil

#29

Posted 10 December 2013 - 02:26 AM Edited by Junior_Djjr, 10 December 2013 - 02:28 AM.

ok, if this is much difficult, i thanks to all helps and sorry for lost your times :p (If you find any way tell to us!!!!)

 

anyway, no problem, i can removes funcs of my mod, only make to change the speed and sound of engine (using sounds of original cars instead create a new "system" of sounds) ...and create a durability tire system (ideas for handling changes to make the car unstable like bad tires?) ...then the tires can deflate if drift much etc... also, you can buy new tires with more durability :B

may create others things like configure the suspension and create a possible to add parts of any model in your car by ids added in a .ini (or you type the id and load? nice?), like THIS video of my other mod at 2:45

i'm making new stats of car and then create a shop (trying to use transfender for that)

1486854_252756484879829_302136536_n.jpg

(acceleration, max speed, brakes, damage, and others like gears, drive type, monetary value etc, after, the tires and others)

i will release english version too ok? :p

  • SergeantSavidge likes this

_DK
  • _DK

    Call me 'The Bald Guy"

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#30

Posted 10 December 2013 - 03:27 AM

So did you already find how to modify speed of vehicle sounds?
And about objects - you can attach them to car in way like extras are attached - create a copy of needed model as atomic and add it to vehicle clump. For me it is the best solution here,




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users