Hello everyone,
I just had the ScriptHookRDR2 and installed a few mods, very impressive! I have made couple simple scripts like to change player's status.
Now I would learn more about how to make a ped like dog to sense the world and act around. I know how to spawn one but looking for the way to drive/control it. Here are some detailed actions I could imagine for the dog now:
- move/run to the East for 5 steps
- standing on the current place and moving its head to the left, or to the player, so its sight will change to the new direction and focus will follow
- sense the current area of the world and respond certain behaviors like dig or piss
Do you have any mod scripts about this, driving a dog to sense and act in its world?
So far, from the NativeDB, I found some functions seem relevent, and especially a list of ped task natives, but no ideas how to use them.
SET_PED_USING_ACTION_MODE
ENABLE_CONTROL_ACTION
SET_PED_STEALTH_MOVEMENT
IS_PED_HEADTRACKING_PED
https://www.rdr2mods.com/wiki/pages/list-of-ped-task-native-functions-in-rdr2-r4/
Do you have any good practice/examples about how to use these natives to drive the dog, or using others?
By watching the dogs built in the game, I think the game developers already provided lots of scripts to drive the dogs, gave them the kind of controlling mechanisms. I hope to learn them too if anyone could share it:)
Besides the natives I could access using the Hook, Is there any RDR2 libraries I could use too like RDR2.Native? From an online search, I found the code like below but not sure whether they are real and how to use them
using RDR2;
using RDR2.Native;
...
private Ped dogPed;
...
dogPed.Task.FollowPed(...);
...