Posts posted by crossed99
-
-
-
Edited by crossed99
Yes, I guess something like checking if he's moving with TASK::IS_PED_STILL and waiting until he stopped should work but you can also do a sequence of actions like this:
int changePosSeq; TASK::OPEN_SEQUENCE_TASK(&changePosSeq); TASK::CLEAR_PED_TASKS(0, 1, 1); TASK::TASK_FOLLOW_NAV_MESH_TO_COORD(0, guardPos.x, guardPos.y, guardPos.z, 0.8f, -1, 0.05f, 1048580, 40000.0f); TASK::TASK_ACHIEVE_HEADING(0, guardPos.h, 1500); TASK::TASK_START_SCENARIO_IN_PLACE_HASH(0, MICS::GET_HASH_KEY(scenario), -1, true, true, 0.0f, true); TASK::CLOSE_SEQUENCE_TASK(changePosSeq); TASK::TASK_PERFORM_SEQUENCE(ped, changePosSeq); TASK::CLEAR_SEQUENCE_TASK(&changePosSeq);I use this in my gang hideouts to make them move around and do stuff. Put zeros in the sequence in place of the ped handles, only use the actual ped in the perform sequence line.
-
Edited by crossed99
TASK::TASK_GO_TO_COORD_ANY_MEANS(ped, coords.x, coord.y, coord.z, 1.0f, 0, 0, 786603, 0xbf800000); TASK::TASK_FOLLOW_NAV_MESH_TO_COORD(ped, coords.x, coord.y, coord.z, 1.0f, -1, 0.5f, 1048580, 40000.0f);These are the ones I'm using. The params are: ped, coordinates, speed, timeout I think but not use, don't know the rest...
1.0 is walk speed, 2.0 should be jog and 3.0 is sprint.
edit: oh the parameter after the timeout I think is how close they're supposed to stop to the given coords. 0 is exactly the coords.
-
-
Edited by crossed99
You have to make civilian relationship groups hate your group with the same method.
PED::SET_RELATIONSHIP_BETWEEN_GROUPS(6, 2318650831, myRelGroup); // townfolk male ?
PED::SET_RELATIONSHIP_BETWEEN_GROUPS(6, 841021282, myRelGroup); // townfolk female ?
I don't really know relationship groups, but you can target any ped and check their rel group with the native I posted in the other post.
Some peds might set to always avoid combat though, you might have to look into config flags or combat attributes if you want everybody to fight.
SET_PED_COMBAT_ATTRIBUTES
https://alloc8or.re/rdr3/doc/enums/eCombatAttribute.txt
SET_PED_CONFIG_FLAG
https://alloc8or.re/rdr3/doc/enums/ePedScriptConfigFlags.txt
-
You can create your own relationship group:
Hash myRelGroup; PED::ADD_RELATIONSHIP_GROUP("MyRelGroup", &myRelGroup); PED::SET_RELATIONSHIP_BETWEEN_GROUPS(6, 707888648/*LAW*/, myRelGroup); // 6 means the first group will attack the second on sightPretty sure lawmen would attack whoever you add to this group with PED::SET_PED_RELATIONSHIP_GROUP_HASH(aimed_target_ped, myRelGroup); unless I got the hash for lawmen wrong, not 100% sure, but you can check with GET_PED_RELATIONSHIP_GROUP_HASH(Ped ped).
-
-
Edited by crossed99
void registerPrompt(int& prompt, const char* input, const char* name, bool toggle, bool addToGroup, Entity entity) { prompt = HUD::_UIPROMPT_REGISTER_BEGIN(); HUD::_UIPROMPT_SET_CONTROL_ACTION(prompt, MISC::GET_HASH_KEY(input)); HUD::_UIPROMPT_SET_TEXT(prompt, MISC::VAR_STRING(10, "LITERAL_STRING", name)); HUD::_UIPROMPT_SET_HOLD_MODE(prompt, 1); if (addToGroup) { int group = HUD::_UIPROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY(entity); HUD::_UIPROMPT_SET_GROUP(prompt, group, 0); } HUD::_UIPROMPT_REGISTER_END(prompt); togglePrompt(prompt, toggle); } void togglePrompt(int prompt, bool enable) { HUD::_UIPROMPT_SET_VISIBLE(prompt, enable); HUD::_UIPROMPT_SET_ENABLED(prompt, enable); }I do it like this, you can use it like:
static int myPrompt{}; registerPrompt(myPrompt, "INPUT_SPRINT", "My Prompts Name", false, true, *example ped*); Ped target; PLAYER::GET_PLAYER_INTERACTION_TARGET_ENTITY(PLAYER::PLAYER_ID(), &target, 1, 1); if (target == *example ped*) // if you're targeting your example ped you reistered the prompt on togglePromt(myPrompt, true); else togglePromt(myPrompt, false);Adding it to a ped or other entity is optional. Depending on what you do there are better ways to do the toggling..
Btw I have a few of my mods source code shared on their pages, you can find stuff like this in them.
edit: I edited the input, it was supposed to be "INPUT_SPRINT"
-
-
Edited by crossed99
Tbh I didn't bother to update my natives in a while, I use somewhat outdated ones. Using the above method works for me using these, so unless someone can help, you can try adding these your natives:
static void _DISPLAY_TEXT(const char* text, float xPos, float yPos) { invoke<Void>(0xD79334A4BB99BAD1, text, xPos, yPos); } template<typename... Args> static const char* VAR_STRING(int flags, Args... args) { return invoke<const char*>(0xFA925AC00EB830B9, flags, args...); }
-
ENTITY::GET_ENTITY_COORDS(&(Local_130[2 /*2*/]) just get's the center coordinates of the area they wanted the ped to wander in.
So they're ped, coodrdinates, then 4 unknown:
TASK::TASK_WANDER_IN_AREA(ped, area.x, area.y, area.z, 2f, 2f, 4f, 0);
TASK::TASK_WANDER_IN_AREA(ped, area.x, area.y, area.z, 10f, 1f, 3f, 0);
-
-
Edited by crossed99
2 hours ago, SAC said:What would 1077936128, 1086324736 be? My natives show them as "any" (as in any guess is as good as mine 🙂 )
No idea, it was in decomplied scripts. It's either those exact values or something like these:
TASK::TASK_WANDER_IN_AREA(0, ENTITY::GET_ENTITY_COORDS(&(Local_130[2 /*2*/]), true, false), 2f, 2f, 4f, 0);
TASK::TASK_WANDER_IN_AREA(&(Local_130[iVar0 /*2*/]), func_178(3, 12), 10f, 1f, 3f, 0);
-
Edited by crossed99
I've only done a little testing trying to make peds hang around my camp so I don't know if this helps.
TASK::TASK_WANDER_IN_AREA(ped, coord.x, coord.y, coord.z, 30.0f, 1077936128, 1086324736, 1);This made them walk away during the day, but if I called it at around 8-9 pm they started using scenarios around the campfire (warming hands and stuff), then later they laid down to sleep or sat in the tent for the night. Don't know what the parameters are, I assumed the 30.0f is the radius but not use. I haven't tested this in towns at all..
-
-
Modifying X and Y moves the spawn point east / west and north / south from you, regardless of your facing.
You can get the coordinates in front of a ped with this:
Vector3 front = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0f, 2.0f, 0.0f);
I can't test it right now, but your native to turn them should work, pretty sure I used that before. Make sure "player" is PLAYER::PLAYER_PED_ID() and not PLAYER::PLAYER_ID() or something, other than that not sure...
-
Edited by crossed99
Without the _SET_RANDOM_OUTFIT_VARIATION line they're invisible when they spawn in, so it might be working you just can't see them. You can also try instead: ENTITY::SET_ENTITY_VISIBLE(pedSpawn, true);
Or maybe they fall under the ground without the PLACE_ENTITY_ON_GROUND line.
But they shouldn't give you compiler errors. What errors are you getting?
-
Edited by crossed99
Maybe you could use GET_CLOSEST_OBJECT_OF_TYPE(float x, float y, float z, float radius, Hash modelHash, BOOL isMission, BOOL p6, BOOL p7)
or one of script hook's 'get all' functions.
worldGetAllPickups(pickups, pickupsArraySize);
worldGetAllObjects(objects, objectsArraySize);Something like:
const int arrSize{ 512 }; Object objects[arrSize]; int objCount = worldGetAllObjects(objects, arrSize); for (int i = 0; i < objCount; ++i) if (ENTITY::GET_ENTITY_MODEL(pickups[i]) == MISC::GET_HASH_KEY("s_brandy01x")) { // if bottle found // check distance to player ?? }I mean it's pretty convoluted, but if it finds the object while it's in the players hand then it could be used reliably.
-
I don't think there's a native for that.
There's a scenario for pouring coffee at camp, probably one for taking stew, too, or you can check if you have a coffee mug or plate in your hand, but I doubt you can detect just normally eating something from your inventory that way.
Checking your core values might be another way, when they're being refilled and the player is not sleeping then probably eating or drinking... I don't know if it's possible to do it reliably.
Let me know if you find a way, I'd be interested, too 😄
-
I'm getting these tasks as active when they're idle compared to when I make them do the hand up task with TASK_HANDS_UP:
2021-11-27 15:48:42.==== player idle =====
2021-11-27 15:48:42. - 18
2021-11-27 15:48:42. - 21
2021-11-27 15:48:42. - 25
2021-11-27 15:48:42. - 48
2021-11-27 15:48:42. - 53
2021-11-27 15:48:42. - 320
2021-11-27 15:48:42. - 332
2021-11-27 15:48:42. - 335
2021-11-27 15:48:44.==== npc idle =====
2021-11-27 15:48:44. - 48
2021-11-27 15:48:44. - 53
2021-11-27 15:48:44. - 244
2021-11-27 15:48:44. - 266
2021-11-27 15:48:44. - 270
2021-11-27 15:48:44. - 291
2021-11-27 15:48:44. - 320
2021-11-27 15:48:44. - 335
2021-11-27 15:48:46.==== pl hands up =====
2021-11-27 15:48:46. - 0
2021-11-27 15:48:46. - 47
2021-11-27 15:48:46. - 320
2021-11-27 15:48:46. - 335
2021-11-27 15:48:47.==== npc hands up =====
2021-11-27 15:48:47. - 0
2021-11-27 15:48:47. - 47
2021-11-27 15:48:47. - 320
2021-11-27 15:48:47. - 335So 0 or 47 maybe? Or maybe it's a different task when they do it "naturally" and not with TASK_HANDS_UP...
-
-
I don't really use any outfits mods so don't know about those, but here's some I use / know for survival:
'Basic needs' makes eating and drinking essential.
'Humidity overhaul' or 'Soft cores' to make weather and proper clothing matter.
I use 'Critical hits' for injuries, but there's also 'Injuries overhaul'.
'Sleep deprivation' if you want sleeping to matter. -
-
11 hours ago, LMS said:
It might be a shocking event that causes them to walk up to the body. Try removing/suppressing those.
I tried, but I couldn't make it work.. I also tried this: IS_SHOCKING_EVENT_IN_SPHERE looping through all the events from here: https://alloc8or.re/rdr3/doc/enums/eEventType.txt , but none of those seem to exist near the corpse somehow..
Enabling this works though: SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, which would suggest it's some sort of event after all I guess, so idk, but this one also makes the ped ignore a lot of other things.
Also, making the ped a sanctioned shooter (?) seem to prevent them from freaking out:
PED::SET_PED_CONFIG_FLAG(ped, 347, true);
Not sure what else this does to them though.
Anyway, I can probably work with these, thanks both of you! If anyone else has ideas they'd be still welcome!
Placing a ped at a location
in RDR2 Mods Discussion
I'm using this one to do that:
ENTITY::_SET_ENTITY_COORDS_AND_HEADING_NO_OFFSET(entity, coord.x, coord.y, coords.z, heading, true, true);Can't remember why I started using this instead of SET_ENTITY_COORDS, but this one works for me.