Everything posted by HughJanus
-
Making NPCs speak..? [SOLVED]
I tried the following (adapted the construct to the parameters you posted further above): 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) BOOL v7; }; static_assert(sizeof(ScriptedSpeechParams) == 0x38, "incorrect ScriptedSpeechParams size"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{speechline, 0, 0, 291934926, ped, NETWORK::NETWORK_IS_GAME_IN_PROGRESS(), 1}; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, ¶ms); But unfortunately it didnt work. Then I tried it with the exact same construct, but different parameters: 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"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ speechline, 0, 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, ¶ms); Still threw an error. Then I used the exact same thing: 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"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ "RE_PH_RHD_V3_AGGRO", "0405_U_M_M_RhdSheriff_01", 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, ¶ms); Still didnt work. Then also tried this, but didnt work either: struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) Any a; alignas(8) Any b; alignas(8) Any c; alignas(8) Any d; alignas(8) Any e; }; static_assert(sizeof(ScriptedSpeechParams) == 0x38, "incorrect ScriptedSpeechParams size"); //declaring line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ speechline, 0, 0, 291934926, ped, NETWORK::NETWORK_IS_GAME_IN_PROGRESS(), 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, ¶ms); I also tried it with the player Ped, but to no avail 😕 Edit: went through the decompiled scripts and found the following construct being filled this way (like you posted it): Param0 = uParam0 //ped ? struct<7> Var0; Var0.f_5 = 1; Var0.f_6 = 1; Var0 = sParam1; //speechline "RE_PH_RHD_V3_AGGRO" Var0.f_1 = sParam5; //voice "0405_U_M_M_RhdSheriff_01" Var0.f_2 = iParam6; //int 1 Var0.f_3 = iParam2; //int 1744022339 Var0.f_4 = uParam3; //ped ? Var0.f_5 = iParam4; //int 1 Var0.f_6 = iParam7; //int 1 PLAY_AMBIENT_SPEECH(Param0, &Var0); Havent used it successfully yet, though. Edit 2: using it like this and its not crashing anymore, but it doesnt happen anything either^^ (no speaking of peds): char* speechline = speechl_it->second; struct SpeechParams { char* speechline; char* voice; int i1; int i2; Ped p3; int i4; int i5; }; SpeechParams params{ "RE_PH_RHD_V3_AGGRO", "0405_U_M_M_RhdSheriff_01", 1, 291934926, ped, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, params);
-
Arthur without TB
I wouldnt know how to do it. Someone here already said they tried to spawn different Arthur Peds after chapter 4, but he always has TB. Maybe we can find something when OpenIV releases a version with all files unhashed and modable.
-
How kill "non-killable" NPCs?
Thank you, I will try it and share the solution.
-
Making NPCs speak..? [SOLVED]
Thanks, LMS! Gonna try it out soon. Edit: Just tried it and it didnt work the way I did it. Short summary: I use the script hook natives and the wrapper for the function looks as follows static BOOL _PLAY_AMBIENT_SPEECH1(Ped ped, char* speechName) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, speechName); } I copied that and adjusted it static BOOL x_PLAY_AMBIENT_SPEECH1(Ped ped, boost::any p1) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, p1); } I used the type "any" from the boost-library, so I didnt have to make my own^^ The code in my helper function looks as follows: void PedFear(Ped ped) { //container for speechlines std::map<int, char*> speech; speech[1] = "PANIC_HELP"; speech[2] = "GENERIC_FRIGHTENED_HIGH"; speech[3] = "GUN"; speech[4] = "GUN_RUN"; speech[5] = "INTIMIDATED_GEN"; speech[6] = "INTIMIDATED_AGAIN_GEN"; speech[7] = "PLEAD"; speech[8] = "SCARED_HELP"; //iterator for the container std::map<int, char*>::iterator speechl_it = speech.begin(); //numbers for randomizing the speech lines int linerand = 1 + (std::rand() % (speech.size() - 1 + 1)); int linecounter = 1; while (speechl_it != speech.end()) { if (linerand == linecounter) { char* speechline = speechl_it->second; boost::any var[7]; var[0] = speechline; // speechline var[1] = 0; // voice - Can be 0 var[2] = 0; // uparam5 var[3] = 291934926; // iparam11 var[4] = ped; // Ped target var[5] = NETWORK::NETWORK_IS_GAME_IN_PROGRESS(); // network is game in progress var[6] = 1; // bool at the end? AUDIO::_PLAY_AMBIENT_SPEECH1(ped, var); return; } linecounter++; speechl_it++; } } But in game the game throws a script hook error as soon as I activate the mod. Am I not allowed to use the "any" type from the boost library?
-
What are the natives responsible for item prices?
It can be done with OpenIV quite easily, as soon as a proper version is out. For now you would have to catch the method trying to get the values and return them yourself (or find out where they are stored and replace them), I guess?
- Making NPCs speak..? [SOLVED]
-
How kill "non-killable" NPCs?
No, havent tried this one yet. I hoped to achieve that only the player can harm certain NPCs and change no other relationships. I dont know what it would do if I e.g. put the player in a different group or the gang in a different group. I suppose that would cause a high risk for behavioral bugs. How do you know the names REL_PLAYER and REL_COP and where do you put them? They dont count as group hashes, I suppose? Do you have any other group names?
-
SET_RELATIONSHIP_BETWEEN_GROUPS
Those are the GTA V relationship integers, which seem to have stayed the same: 0 = Companion 1 = Respect 2 = Like 3 = Neutral 4 = Dislike 5 = Hate 255 = Pedestrians
-
IMAP Hashes (Spoilers) [solved]
Nice to see youre starting to script stuff too!
-
Making NPCs speak..? [SOLVED]
I was wondering if anybody knew how to make NPCs talk. I have been searching the game files with OpenIV and have found some speech samples I would like to use, but have no idea how. Under "x64\audio\sfx" there are multiple PED_XX.rpf files which hold awc files (for each NPC type like "white townfolk", there is a file) which again hold a lot of speech files. Those speech files have the same hashes/names throughout the different NPC types, so there must be a generic option of calling them (like the PLAY_PAIN - which automatically plays the pain sound fitting the NPC). Does anybody know which natives to use and how to use them to get NPCs to speak (like saying "Piss off!" or some other generic lines)?
-
How kill "non-killable" NPCs?
@LMS But how? I have tried these already: if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0) PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i])); if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0) { PED::CLEAR_RELATIONSHIP_BETWEEN_GROUPS(0, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i])); PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i])); } if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0) { PED::CLEAR_RELATIONSHIP_BETWEEN_GROUPS(0, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i])); PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i])); ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(peds[i], true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(peds[i], playerPed)); } I have done testing on what the relationships are. They seem to have stayed the same as in the GTA 5 documentation: 0 = Companion 1 = Respect 2 = Like 3 = Neutral 4 = Dislike 5 = Hate 255 = Pedestrians None of my above solutions allowed me to hurt gang members.
-
How kill "non-killable" NPCs?
Thats what I tried with ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(ped, true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, ped)); How is it supposed to be done?
-
Ped Damage Overhaul mod problem with FPS
@Barnaby Glad to hear 🙂
-
Ped Damage Overhaul
@Adman The stumbling when shot thing is describing the behavior when the health of an NPC is under the dying movement threshold, but it is still standing. If the chance for euphoria stumbling is 0, they will just more or less drop (within one or two steps) - if euphoria stumbling is at 100, they will receive a slight push every millisecond, so they stumble for a longer time (doing more steps), but that stumbling is based on the euphoria behavior when pushed (they will grab their wound and stumble around). The leg injury stumbling is a totally different mechanic. The cower and hands up reactions remain until their health has been decreased by some points (= they get shot) - then they will flee. If you dont hurt them in cowering or hands up, they should stay that way.
- 1,271 comments
- 5 reviews
-
-
- 1
-
-
Ped Damage Overhaul
@Adman Thanks for sharing your findings! The mod does not affect animals at all (no matter what you set) - there is a check if you are currently aiming at an animal and if you do, all damage settings are temporarily undone. Also the body part specific damage only applies to NPCs. As for the regeneration rate - I will take a look into it.
- 1,271 comments
- 5 reviews
-
-
- 1
-
-
Ped Damage Overhaul
Please share your findings. I would guess its the number of NPCs affected, but thats only a guess. There is no proper documentation, so I dont know :/
- 1,271 comments
- 5 reviews
-
Ped Damage Overhaul
I really dont know. Since I dont have performance problems, I cant say what works. I would start with a low number like 10 or so, then check if it even brings any fps. If it does, work your way up until you get the fps you are willing to sacrifice. And please share your findings. Since none of our testers have performance problems, we couldnt really test this parameter.
- 1,271 comments
- 5 reviews
-
Ped Damage Overhaul mod problem with FPS
@joshmcdanie1s I would set it to 10 or so. Since there is no proper documentation for these methods, one can only guess what they do. I would guess, since I have to pass a container and an integer to the method, that the integer is the number of NPCs the method puts into the container. So the "ModEffectRange" would be the number of affected NPCs by the mod.
-
How kill "non-killable" NPCs?
I already tried this: ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(ped, true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, ped)); But it didnt work. Do you know which int to put as the last parameter?
-
Ped Damage Overhaul mod problem with FPS
@Barnaby@joshmcdanie1s Attached you can find a testing build with the parameter "ModEffectRange" in the ini. Could you try lowering this and check if it helps? Could be that its still buggy, though. Havent had much time to test it. PDO_v1.48b17.zip
-
How kill "non-killable" NPCs?
Thanks, but I would like to know how to do it in code, so I dont have to rely on other mods.
-
How kill "non-killable" NPCs?
Some NPCs cant be targetted (e.g. the kids in saint denis, gang members, etc.) - is there a way do circumvent that?
-
Question about script folder mods
I checked the "lasso of healing" mod and it says that it needs scripthook .net. So the problem is pretty obvious - you need scripthook .net and not script hook or rph. As far as I can see, the .net has not been updated.
- [.NET][ASK?] Send notification
-
Question about script folder mods
I never had a scripts folder for ScriptHook. I know it from GTA 5, but that was ScriptHook .NET.