Jump to content

SAC

Recognized Creator
  • Posts

    136
  • Joined

  • Last visited

  • Days Won

    11

 Content Type 

Profiles

Forums

Gallery

Downloads

News Articles

Modding Wiki

RDR2 Native Database

RDR2 Native Parameters

RDR2 Player Clothes Database

RDR2 Ped Voices Database

RDR2 Ped Speech Lines

RDR2 Modding Tutorials

RDR2 Ped Model Database

RDR2 Animations Database

RDRFR Changelog

RDRFR Installation Guide

RDRFR Features

RDRFR Settings

LML User Contributions

Everything posted by SAC

  1. You are correct, I'll implement a timer
  2. Where is this gameconfig? I cannot find it with OpenIV. Someone else mentioned this file but I am unable to locate it
  3. One more thing, I've had the code actually crash the game on some NPCs so I have added a <clear_tasks> step before adding them to the hostile rel group (and the code does not crash the game anymore, so it should be right). The fleeing is just cosmetic TASK::CLEAR_PED_TASKS_IMMEDIATELY(ped, false, false); TASK::TASK_SMART_FLEE_PED(ped, ped, -1, -1, 0, 3.0f, 0); WAIT(2000); Hash rel_group_pariah_hash; PED::ADD_RELATIONSHIP_GROUP("rel_group_pariah", &rel_group_pariah_hash); PED::SET_PED_RELATIONSHIP_GROUP_HASH(ped, rel_group_pariah_hash); The intended aggro triggers, albeit sometimes with delay, which is why I have added this to my general population sandboxing routine PED::REGISTER_HATED_TARGETS_AROUND_PED(peds[i], 10); Can't say if it makes a difference but it makes sense intuitively, I am juggling a lot of changes at one time without thorough testing for each.
  4. I found this one, does the trick (ped runs away from itself, basically random fleeing) TASK::CLEAR_PED_TASKS_IMMEDIATELY(ped, false, false); TASK::TASK_SMART_FLEE_PED(ped, ped, -1, -1, 0, 3.0f, 0); Now what I'd like to do is make peds flee towards the PC.
  5. // Seems to set the ped's loco type. // Values used in the scripts: // algie // angry_female // arthur_healthy // cowboy // cowboy_f // default // default_female // free_slave_01 // free_slave_02 // gold_panner // guard_lantern // injured_general // john_marston // lilly_millet // lone_prisoner // lost_man // mp_ova_hunter // mp_ova_hunter_female // murfree // old_female // primate // rally // waiter // war_veteran NATIVE_DECL void _SET_PED_DESIRED_LOCO_FOR_MODEL(Ped ped, const char* locomotionArchetype) { invoke<Void>(0x923583741DC87BCE, ped, locomotionArchetype); } // 0x923583741DC87BCE b1207 // Clears locomotion archetype NATIVE_DECL void _CLEAR_PED_DESIRED_LOCO_FOR_MODEL(Ped ped) { invoke<Void>(0x4FD80C3DD84B817B, ped); } // 0x4FD80C3DD84B817B b1207 // Sets peds motion type NATIVE_DECL void _SET_PED_DESIRED_LOCO_MOTION_TYPE(Ped ped, const char* locoMotionType) { invoke<Void>(0x89F5E7ADECCCB49C, ped, locoMotionType); } // 0x89F5E7ADECCCB49C b1207 NATIVE_DECL void _CLEAR_PED_DESIRED_LOCO_MOTION_TYPE(Ped ped) { invoke<Void>(0x58F7DB5BD8FA2288, ped); } // 0x58F7DB5BD8FA2288 b1207 Just tested this in game and it works: PED::_CLEAR_PED_DESIRED_LOCO_FOR_MODEL(entity1); PED::_CLEAR_PED_DESIRED_LOCO_MOTION_TYPE(entity1); PED::_SET_PED_DESIRED_LOCO_FOR_MODEL(entity1, "default_female"); PED::_SET_PED_DESIRED_LOCO_MOTION_TYPE(entity1, "chain_gang_legs");
  6. Do (any of) these work on NPCs? I am interested in casting them to NPCs, not PC.
  7. You are right, your code works. I was using a lobotomized events.meta which prevented aggro. Thank you very much!
  8. I've tried to set the target ped in hate relationship with CIVMALE and REL_CIVMALE, nothing happened. I've looked at the various civilian peds around, their relationship groups are quite varied and I don't know how to dehash them / where to look them up. Next I am going to try picking a few random civilians around the target ped, and putting them in another group of my own, which hates the target ped group. Best effort, store their previous groups in a map and restoring them once the target is dead (but this is nice to have). Otherwise, unless there is some sort of universal enemy relationship group, I don't know how to approach this.
  9. Any idea what is the cloth under all female dresses named? The white thing beneath the dress Even better, any idea how to disable it or make it invisible? It is separate from the dress, because it has a different LOD
  10. Ok, sounds good, but how do I make any civilians attack the NPC?
  11. Looking to accomplish the following use cases: 1. Have an NPC declared public enemy, and every NPC around attacks them I have tried to run this on the victim NPC, nothing happens PED::SET_PED_RELATIONSHIP_GROUP_HASH(aimed_target_ped, MISC::GET_HASH_KEY("REL_WILD_ANIMAL")); Any other ideas? Make them "relationship outlaw" or "wanted"? 2. Have a civilian NPC attack another civilian NPC bool enemy_found = false; Ped victimArr[20]; int count = worldGetAllPeds(victimArr, 20); for (int i = 0; i < count; i++) { if (sac_is_valid_victim_model(victimArr[i])) // optional personal preference, not relevant to the logic { enemy_found = true; TASK::CLEAR_PED_TASKS_IMMEDIATELY(aimed_target_ped, false, false); PED::SET_PED_RELATIONSHIP_GROUP_HASH(victimArr[i], MISC::GET_HASH_KEY("REL_WILD_ANIMAL")); PED::SET_PED_COMBAT_MOVEMENT(aimed_target_ped, 2); TASK::TASK_COMBAT_PED(aimed_target_ped, victimArr[i], 0, 16); break; } } Works only if the aggressor is a cop, not if the aggressor is an ordinary civilian. And works only sometimes. 3. Have wild animals (e.g. alligators) attack NPCs, this one I haven't tried yet. As is, alligators only eat dead NPC corpses, not attack live NPCs. I have a hunch events.meta is a possible solution for this, but I haven't found the relevant behavior there (yet).
  12. Any way to improve dead body persistence? I get bodies vanish (NPCs get recycled?) as I turn the corner in Saint Denis. I am aware of Enhanced Entity and World Persistence 1.4 at Red Dead Redemption 2 Nexus - Mods and community (nexusmods.com) I have it (have not modified the ini), not sure if it's helping, but I want better persistence than that.
  13. DM-ed the author of Rampage, because Rampage ends the scenarios gracefully, and got this guidance void PlayScenarioFunc(std::string scenario) { Ped PlayerPed = PLAYER::PLAYER_PED_ID(); TASK::CLEAR_PED_TASKS_IMMEDIATELY(PlayerPed, false, false); TASK::TASK_START_SCENARIO_IN_PLACE_HASH(PlayerPed, StringHash(std::move(scenario)), 0, true, 0, 0.0f, false); } To directly abort scenarios use TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID(), false, false); To end the scenario normally use TASK::CLEAR_PED_TASKS(PLAYER::PLAYER_PED_ID(), true, true); Haven't checked it yet, I am busy tracing a game crash (most likely something related to rope physics)
  14. SAC

    ADD_ROPE

    There are 19 types of rope, from type = 0 to type = 18 Rope definitions are stored in ropedata.xml Rope types 0, 15 and 18 have proper physics for hanging... objects (taut, do not sag, small to medium diameter, good aspect for a rope) From TYL code, credit goes to Shtivi: ropeId = ROPE::ADD_ROPE(pos1.x, pos1.y, pos1.z, 0, 0, 0, length, random_rope, length + 1.0f, 1.0f, 1.0f, true, false, false, 2.0f, false, 0, true); // adds a rope of random type into the world (it is not yet attached, has no physics) It is set as rigid = false (helps with not sagging, is not elastic either) and breakwhenshot = false ROPE::_0x462FF2A432733A44(ropeId, entity1, entity2, 0, 0, 0, 0, 0, 0, (Any*)bone1, (Any*)bone2); // self-explanatory, binds two bones from two entities; one entity can be an object, i.e. a suspension point, the other an NPC bone ROPE::ACTIVATE_PHYSICS(ropeId); ROPE::_0x3C6490D940FF5D0B(ropeId, 0, (Any*)"noose01x_Rope_03", length, 0); // not having this disables winding
  15. It is because I did a lot of trial and error and I am not entirely sure which worked and which didn't, and I don't risk to mess it up after all the effort. persistence_model_aging.meta => probably not needed, probably safe to delete popzone.ymt => specifies a "min_dirt" and "max_dirt" of each "encounter zone" (spawn zone), i.e. Saint Denis downtown spawns cleaner NPCs that the swamps Not needed for the decals persistence per se, it has ramped up min/max for upping the grubby effect; it's pretty subtle anyway projdecal.ymt => this is probably the most important one Set these attributes to -1 for all decals (found them by comparing some fade decals with some non-fade ones) <UNK_MEMBER_0x0379C210 value="-1.00000000"/> <UNK_MEMBER_0x9733F1A6 value="-1.00000000"/> <UNK_MEMBER_0xFB96FFAC value="0.00000000"/> <UNK_MEMBER_0x4C042979 value="0.00000000"/> projdecalpacks.ymt => has a lifetime parameter, didn't seem to work but included to be safe vfxpedinfo.ymt => again has some lifetime parameters in there, set them to -1 visualsettings.dat => decal behavior (includes decal washing by water/rain), sadly it works just for the player, horse and other animals, not other humans; can probably be deleted in the current form. weatherClimates => disable rain It' not the cleanest packaging for a dirt mod 🙂 but it's effective. Welcome anyone to keep refining it, but I am happy with how it works. I would be very excited if anyone is able to make visualsettings.dat work for human NPCs
  16. True, and I'm going to share my custom ymts at some point. They can be put in \lml\stream, no need for a replacer xml However, it is extremely difficult to maintain. For instance, let's say you want an ymt which references females from various populations. Any modification you make to any of the populations you want to reference, you will need to replicate in your "master" ymt. This gets very complex, very fast, as you reference more NPC models and you make more modifications to them (as I am frequently doing). Of course, scripting make this easy (after the brutal initial learning curve), do a map (array) 😛 of the populations you want to spawn, then proceed to random spawning from that map. string SAC_return_random_female_model() { std::map<int, char*> female_models; female_models[0] = "sac_female"; [...] female_models[31] = "a_f_o_waptownfolk_01"; return female_models[(rand() % female_models.size())]; } [..] char const* mymodel = SAC_return_random_female_model().c_str(); Ped myPed = spawnPed((MISC::GET_HASH_KEY(mymodel)), vfront.x, vfront.y, vfront.z); (abbreviated) There is another weird effect to maintaining a monolithic ymt. Let's say I stack 2 NPC models in one ymt (10 variations each, for the sake of the example). The weird effect is when I spawn from that ymt in-game, the game randomizer will pick a lot of successive outfits from the first model, then switch to the other model and produce a lot of variants from the second one. I don't understand it, but it's a fact. I was able to randomize better by scripting PED::_SET_PED_OUTFIT_PRESET(pedSpawn, (std::rand() % (PED::GET_NUM_META_PED_OUTFITS(pedSpawn) - 1)), false); Useful reference for scripting spawns here: https://www.rdr2mods.com/forums/topic/1296-solved-how-to-spawn-ped-from-c-script-hook/
  17. Display a prompt when certain conditions are met, then execute a script when the relevant key is pressed. Similar to when you are near a body and you get a prompt "E to loot"
  18. Version 1.0.0

    857 downloads

    Makes dirt decals permanent
  19. Hi, Can anyone please teach me, or point me to some relevant reading materials, how to script a controller with a prompt? Thx
  20. One way to do it is a script with AUDIO::SET_AMBIENT_VOICE_NAME(PLAYER::PLAYER_ID(), "shut the fuck up"); Problem is it mutes Arthur entirely, which is not desirable for missions. I'll keep looking for a more specific fix
  21. SAC

    _SET_PED_FACE_FEATURE

    Must be followed by PED::_UPDATE_PED_VARIATION(ped, true, true, true, true, true); in order to take effect in-game
  22. No idea what ENTITY::GET_ENTITY_COORDS(&(Local_130[2 /*2*/]) means? Found this in my version of natives.h // Makes ped walk around the area. // // set p1 to 10.0f and p2 to 10 if you want the ped to walk anywhere without a duration. NATIVE_INLINE static void TASK_WANDER_STANDARD(Ped ped, float p1, int p2) { invoke<Void>(0xBB9CE077274F6A1B, ped, p1, p2); } // 0xBB9CE077274F6A1B 0xAF59151A b1207 Seems to work partially, meaning that they walk, but don't perform any activities. Will experiment more
×
×
  • Create New...