nordi Posted April 7, 2014 Share Posted April 7, 2014 Hey  I would like to know, what options I have, to use custom: sounds, text, with native functions. I think, using advancedHook, is the solution (or at least for texts), is it correct ?  The natives I want to use are: extern void DRAW_CURVED_WINDOW_TEXT(float, float, float, int, int, char *, char *, int); extern void PLAY_SOUND_FROM_POSITION(int sound_id, char *name, float x, float y, float z);  Thanks. Link to comment Share on other sites More sharing options...
julionib Posted April 7, 2014 Share Posted April 7, 2014 some time ago i made a tutorial about that and more, its a little outdated now but may help: Â http://gtaxscripting.blogspot.com.br/2013/03/tut-playing-native-sounds-and-external.htmlabout that DRAW_CURVED_WINDOW_TEXT native i never tried Link to comment Share on other sites More sharing options...
nordi Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) some time ago i made a tutorial about that and more, its a little outdated now but may help:  http://gtaxscripting.blogspot.com.br/2013/03/tut-playing-native-sounds-and-external.html  about that DRAW_CURVED_WINDOW_TEXT native i never tried   Well, your tutorial is the reason I'm asking this question ^^ (I was not aware of the options, natives functions provide to play a sound (from position, from car, etc.) until i found your tutorial) Using NAudio, will allow me to play external sound yes, but I will hear this sound anywhere in the map, while I really want to use the PLAY_SOUND_FROM_POSITION Edited April 7, 2014 by nordi Link to comment Share on other sites More sharing options...
julionib Posted April 7, 2014 Share Posted April 7, 2014 what you didnt understand in the PLAY_SOUND_FROM_POSITION section? Â did you tested some code yet? Link to comment Share on other sites More sharing options...
Wiebrendh Posted April 7, 2014 Share Posted April 7, 2014 Isn't there just an option that plays a sound once? Link to comment Share on other sites More sharing options...
julionib Posted April 7, 2014 Share Posted April 7, 2014 the PLAY_SOUND_FROM_POSITION and "her friends" will do this, the question is if you want be able to stop the sound or not, some sounds like rocket on flight need to be stopped because they are loopedif you do this you will play a sound, but will not be able to stop it: dim pos as vector3 = game.currentCamera.positionGTA.Native.Function.Call("PLAY_SOUND_FROM_POSITION", -1, "GENERAL_WEAPONS_ROCKET_LOOP", pos.X, pos.Y, pos.Z) That tutorial has link to a file that list some game sounds, unfortunately its not possible play external sounds using those native methods, i imagine Link to comment Share on other sites More sharing options...
Wiebrendh Posted April 7, 2014 Share Posted April 7, 2014 Hmm, that kinda sucks.. How do i play external sounds?? I want to add this is my slowmotion mod and personal vehicle mod.. Link to comment Share on other sites More sharing options...
julionib Posted April 7, 2014 Share Posted April 7, 2014 that tutorial show some examples, look for the "Playing external sounds" section Link to comment Share on other sites More sharing options...
pedro2555 Posted April 7, 2014 Share Posted April 7, 2014 (edited) There is no programmatic way to play external sounds using native GTA functions. You can probably change the game files, but that is out of my knowledge range. Â You can however calculate sound level over distance, from my experience it is more a hassle than it is a useful feature but anyway here is my approach: Â Say you have sl1 and dt1 has your reference sound level and distance, for instance 5 to 1 (meaning, at 1 meter from sound source, sound level is 5db) you can then use the following formula to calculate sl2 at dt2: sl2 = sl1 - (10 * log(dt1 / dt2)) with our 5 to 1, to calculate level at 20 meters, would be: sl2 = 5 - (10 * log(1 / 20)) Mathematical, this should give you the correct sound level in decibel, at the time of research this didn't prove very useful, but the need for it wasn't that big, so you may want to continue yourself from here and hopefully manage to achieve good results. Edited April 7, 2014 by pedro2555 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now