- Making NPCs speak..? [SOLVED]
-
Making NPCs speak..? [SOLVED]
Ok so I tried this params = {} params.speechName = "FAREWELL" params.voiceName = "0479_U_M_M_VALGUNSMITH_01" params.v3 = 1 params.speechParamHash = 0x67F3AB43 params.entity = 0 params.v6 = true params.v7 = 1 params.v8 = 1 Citizen.InvokeNative(0x8E04FEDD28D42462, cl, params) and got this error SCRIPT ERROR: Invalid Lua type in __data Pointing to the line where I Invoked the native.
- Making NPCs speak..? [SOLVED]
- Making NPCs speak..? [SOLVED]
-
Making NPCs speak..? [SOLVED]
This function PlayPedAmbientSpeechNative() Used to be called. PlayAmbientSpeech1() (They recently changed the name of the function.) And it basically invokes the native _PLAY_AMBIENT_SPEECH1. Here is a link to the native document: https://vespura.com/doc/natives/?_0x8E04FEDD28D42462 The problem is even though it's in the natives document I cannot pass any parameters into it. I see that you have to give it a struct that holds the parameters in c++ but you can't do that in lua. And here is a code example that spawn peds at pre-defined positions: Citizen.CreateThread(function() clerkHash = GetHashKey(store.ClerkModel) pos = Config.Stores[1].pos heading = Config.Stores[1].hdg if IsModelInCdimage(clerkHash) and IsModelValid(clerkHash) then RequestModel(clerkHash) while not HasModelLoaded(clerkHash) do RequestModel(clerkHash) Wait(0) end clerk = CreatePed(clerkHash, pos.x, pos.y, pos.z, hdg, 1, 1, 0, 0) SetModelAsNoLongerNeeded(clerkHash) Citizen.InvokeNative(0x283978a15512b2fe, clerk, true) -- You can invoke natives like this too end end)
-
Making NPCs speak..? [SOLVED]
There is this line in Natives local retval --[[ boolean ]], params --[[ Any ]] = PlayPedAmbientSpeechNative( ped --[[ Ped ]] ) And this as a description struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) int v3; alignas(8) Hash speechParamHash; alignas(8) Entity entity; alignas(8) BOOL v6; alignas(8) int v7; alignas(8) int v8; }; static_assert(sizeof(ScriptedSpeechParams) == 0x40, "incorrect ScriptedSpeechParams size"); Example: ScriptedSpeechParams params{"RE_PH_RHD_V3_AGGRO", "0405_U_M_M_RhdSheriff_01", 1, 0x67F3AB43, 0, true, 1, 1}; _PLAY_AMBIENT_SPEECH1(PLAYER_PED_ID(), (Any*)¶ms); When I found the code in the description here I thought there was a way to do it in lua for RedM but I guess not. I cannot give params to this function no matter what I do. I think this function just doesn't work in RedM.
- Making NPCs speak..? [SOLVED]
- Making NPCs speak..? [SOLVED]
- Making NPCs speak..? [SOLVED]