Log in to reply
 

Can i mute a cutscene in my script?



  • Im playing a cutscene in my script but i dont know how can i mute what the characters so the dont talk in my cutscene. No function i can find that does that



  • @M8T you'll need to do this in C# then. If you can identify when a player is talking, then perhaps you can mute the audio. I noticed there is a mod that did that back in 2015 so the author managed to find a way to do it.

    There are however speech natives, one of which is stop speech. Another possibility might be to set the ped speech to nonsense and see what happens or trap the error if it triggers one.

    Edit, there is a mute.
    STOP_CURRENT_PLAYING_SPEECH(Ped ped) // 0x7A73D05A607734C7 0x5B7463F4 b323

    No comment available

    Old name: _SET_PED_MUTE



  • @JohnFromGWN for STOP_CURRENT_PLAYING_SPEECH(Ped ped) it says on fivem docs there is supposed to be an int before the ped name. So would that be Function.Call(Hash.STOP_CURRENT_PLAYING_SPEECH, 1, Game.Player.Character); ?



  • @M8T Sorry, have never used that function. Place it in Visual Studio and hit F12. FiveM is not exactly the same, and if they put an INT, it is very likely a get function, not a set function AFAIK.

    Another option is to create a silent speech file and use it with this function.

    AUDIO::PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE
    void PLAY_PED_AMBIENT_SPEECH_WITH_VOICE_NATIVE(Ped ped, const char* speechName, const char* voiceName, const char* speechParam, BOOL p4) // 0x3523634255FC3318 0x8386AE28 b323

    This is the same as PLAY_PED_AMBIENT_SPEECH_NATIVE and PLAY_PED_AMBIENT_SPEECH_AND_CLONE_NATIVE but it will allow you to play a speech file from a specific voice file. It works on players and all peds, even animals.

    EX (C#):
    GTA.Native.Function.Call(Hash._0x3523634255FC3318, Game.Player.Character, "GENERIC_INSULT_HIGH", "s_m_y_sheriff_01_white_full_01", "SPEECH_PARAMS_FORCE_SHOUTED", 0);

    The first param is the ped you want to play it on, the second is the speech name, the third is the voice name, the fourth is the speech param, and the last param is usually always 0.

    Full list of speeches and voices names by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/speeches.json

    Old name: _PLAY_AMBIENT_SPEECH_WITH_VOICE



  • @JohnFromGWN Also found this Function.Call(Hash._0x806058BBDC136E06); //STOP_CUTSCENE_AUDIO yet it does nothing and if put right under the start cutscene line it will not start the cutscene for some reason



  • @M8T That could be because it requires another function first?



  • @JohnFromGWN Why would it need that?



  • @M8T I'm not saying it does. Just saying from my limited experience it does happen.
    For example when you mod a vehicle you need to install a modkit first, you won't get an error if you don't, you just won't get anything.
    Also, in the MP female code I posted, and those functions drove me crazy, you need to do certain functions sequentially - wrong order and nothing works and zero error messages.
    So it is common.
    The bad news is nobody here can help you or will help you. The good news is keep going and you will be the resident expert on scripting here.
    Try different things, that's what I do and usually you get lucky and it works.
    :)



  • @JohnFromGWN Yep, well i guess i will continue and try to figure it out. Thanks for the suggestions though!



  • @M8T There are probably quite a few different ways.
    The longer ways will be to create your own sound files. But if your doing for a mod to upload, you have to make sure it works on all setups, not just yours - that's the problem.
    If your lucky it will be a native.
    The other method I can think of is passing a parameter that will result in nothing (silence) and you can trap that error so no crash, no error message at run time.



  • @JohnFromGWN Yeah there is a native i think i just gotta make the one i sent you work



  • @M8T I can't find that one. Where did you get it? Might be outdated.



  • @JohnFromGWN search this STOP_CUTSCENE_AUDIO



  • @M8T said in Can i mute a cutscene in my script?:

    STOP_CUTSCENE_AUDIO

    got it



  • @M8T Check out this link and do a search on "Stop"

    https://github.com/crosire/scripthookvdotnet/blob/f0ae67bdca30e49434c90b07f6dfb71e38371537/source/scripting_v3/GTA.Native/NativeHashes.cs

    STOP_PED_SPEAKING = 0x9D64D7405520E3D3, // 0xFF92B49D

    STOP_SCRIPTED_CONVERSATION = 0xD79DEEFB53455EBA, // 0xAB77DA7D

    STOP_CURRENT_PLAYING_SPEECH = 0x7A73D05A607734C7, // 0x5B7463F4
    STOP_CURRENT_PLAYING_AMBIENT_SPEECH = 0xB8BEC0CA6F0EDB0F, // 0xBB8E64BF
    IS_AMBIENT_SPEECH_PLAYING = 0x9072C8B49907BFAD, // 0x1972E8AA
    IS_SCRIPTED_SPEECH_PLAYING = 0xCC9AA18DCC7084F4, // 0x2C653904
    IS_ANY_SPEECH_PLAYING = 0x729072355FA39EC9, // 0x2B74A6D6
    _CAN_PED_SPEAK = 0x49B99BF3FDA89A7A, // 0x8BD5F11E
    IS_PED_IN_CURRENT_CONVERSATION = 0x049E937F18F4020C, // 0x7B2F0743



  • @JohnFromGWN i check one of the things out StopScriptedConversation(bool p0);. What is p0? what int am i supposed to set it too and why?



  • @M8T All I know is P0 is the very first argument and it is a boolean, so try 0,1 or true, false.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.