Aurawhisperer Posted May 23, 2014 Share Posted May 23, 2014 Like throughout the realm of Skyrim and it's strange encounters, such as an example of Stormcloaks, Imperials, Thalmor, stranded farmers, the Khajit Caravan, etc. How do I make my modded NPC's travel? Because i want to create ambush parties from the hostile NPC's that I made. I want to create a neat CK package based on a specific hostile organization traveling throughout Skyrim rather than just ambushing one area and stay there. i want them to spread throughout the territory. Is is an AI package that I need to link or is it more towards a marker? Right now I only know the rules about patrol markers. That's it. But that isn't what I wanted Link to comment Share on other sites More sharing options...
Hallgarth Posted May 23, 2014 Share Posted May 23, 2014 I believe if you have markers, and set them to travel between these markers they will. Not sure if you have to set it as particular days though. It's been a while since I've looked at AI packages. I think if you set them to patrol, you can have them go to multiple markers. Maybe have a look at that wandering bard's AI package and see how his is set up. Link to comment Share on other sites More sharing options...
JobVanDam Posted May 23, 2014 Share Posted May 23, 2014 Yeah I would like a kinda non technical way to implement this. One way I've seen it done is have markers at certain location then tell the NPC's to travel their. The way I think Immersive Patrols works is he has them sandbox around a specific marker but the range they can sandbox is HUGE. With the IP implementation over time though I've noticed when in certain areas you will always encounter a specific patrol. For telling NPC's to go to X marker how do you make them go to marker A then when they reach marker A go to marker B? When trying to think about it this is what baffles me. For instance, if an NPC has a package to go to marker A on Monday and marker B on Tuesday if they don't reach marker A by the end of Monday won't they stop and start heading to marker B? Or is there a flag that says "this AI package MUST be completed"? Link to comment Share on other sites More sharing options...
DrNewcenstein Posted May 23, 2014 Share Posted May 23, 2014 Place your NPC in the area you want them to start, LinkRef the NPC to the first marker, set the time on the marker, place another marker further along the path and linkref the first marker to the 2nd marker, and set the idle time on that 2nd marker, then keep going like that. I'm not sure how many markers you can string together, though. If you set Marker A in Riften and Marker B in Dawnstar, your NPC should be able to decide for itself which route to take - follow the road or as-the-crow-flies - and that should be defined in the attached AI Scripts. If it says "follow the road", they'll follow the road. If you give them the Soldier Courier pathing script, they'll run wherever they find navmesh, even if it's the wrong way. Somewhere out there is a formula that you can use to calculate how long it would take an NPC of a given Speed rating to walk anywhere (i.e. Riften to Dawnstar). Then you simply apply the old "if a Train left Chicago...." theory and set your patrol markers accordingly. Understand they will encounter delays along the way, be it navmesh errors or having to walk around an obstacle. If you've ever followed Maro Jr in the DB quest, you know that unless it's the day for him to be in Solitude, his entire schedule is bjorked and it will be a while before he's in a city when he's supposed to be. Sometimes he'll reach the outer marker of a city just as it's time for him to depart for another. Other times he'll stand around for a few hours until he synchs up with the timescale and his location. Another point to consider is that once an NPC exceeds visible draw range, and their AI package says they have to be in a given location on a given day, if you fast-travel there immediately, they will either arrive shortly after you or already be there. This is because Fast Travel uses the same formula as "how long to walk from X to Y?" And that's based on walking speed. Follow Erandur to Nightcaller Temple. It's that walking speed. Link to comment Share on other sites More sharing options...
Aurawhisperer Posted May 23, 2014 Author Share Posted May 23, 2014 Place your NPC in the area you want them to start, LinkRef the NPC to the first marker, set the time on the marker, place another marker further along the path and linkref the first marker to the 2nd marker, and set the idle time on that 2nd marker, then keep going like that. I'm not sure how many markers you can string together, though. If you set Marker A in Riften and Marker B in Dawnstar, your NPC should be able to decide for itself which route to take - follow the road or as-the-crow-flies - and that should be defined in the attached AI Scripts. If it says "follow the road", they'll follow the road. If you give them the Soldier Courier pathing script, they'll run wherever they find navmesh, even if it's the wrong way. Somewhere out there is a formula that you can use to calculate how long it would take an NPC of a given Speed rating to walk anywhere (i.e. Riften to Dawnstar). Then you simply apply the old "if a Train left Chicago...." theory and set your patrol markers accordingly. Understand they will encounter delays along the way, be it navmesh errors or having to walk around an obstacle. If you've ever followed Maro Jr in the DB quest, you know that unless it's the day for him to be in Solitude, his entire schedule is bjorked and it will be a while before he's in a city when he's supposed to be. Sometimes he'll reach the outer marker of a city just as it's time for him to depart for another. Other times he'll stand around for a few hours until he synchs up with the timescale and his location. Another point to consider is that once an NPC exceeds visible draw range, and their AI package says they have to be in a given location on a given day, if you fast-travel there immediately, they will either arrive shortly after you or already be there. This is because Fast Travel uses the same formula as "how long to walk from X to Y?" And that's based on walking speed. Follow Erandur to Nightcaller Temple. It's that walking speed.But that's the issue. I don't see any of these markers stringed throughout the game by the vanilla NPC's, unless Bethesda had that encoded into those NPC's. I can't find anything script related into these traveling NPC's ether. Not even this Follow the road as you mentioned, unless I have to make it from scratch. Link to comment Share on other sites More sharing options...
JobVanDam Posted May 23, 2014 Share Posted May 23, 2014 Hmm, that would explain whenever I sleep at an inn upon waking up often there is a roaming NPC there as well. He was supposed to be there on X day but couldn't make it so when I sleep the game rushes him along and places him their. I'm looking to fix a mod that has patrolling bandits. Where is the Solitude courier pathing script? Also can I make them walk instead of run with this script? Is it possible to implement this same behavior by raising a specific flag in a AI package? Link to comment Share on other sites More sharing options...
DrNewcenstein Posted May 25, 2014 Share Posted May 25, 2014 Not quite sure. Out of curiosity, I created an NPC snd placed 2 Patrol markers - one next to the carriage outside Whiterun, the other on the road in front of the Inn in Rorikstead. I placed my NPC near the Whiterun marker and LinkRef'd her to it, then LinkRef'd the marker to the one at Rorikstead, and then Linked that one back to the one at Whiterun, to make a looped patrol. Each marker has an idle time of 5 seconds. Since my recent save was at Lakeview, by the time I got to Whiterun, she was well on her way. I was curious to see if she followed the road or cut across the plains in a straight line, so I started running along the road. About halfway between Gjukar's Monument and Rorikstead, I saw her walking down the hill towards Whiterun, so I followed her. When she came across the dead wolves and such I encountered along the way to find her, she would stop for a second, look down at it, then continue. She did follow the road, even though, as I said, there were only two markers, so it does appear there's a "preferred pathing" at work, though I'm not sure if that's a Navmesh option or part of the AI Package I gave her. At various points along the road, she would leave the road and walk anywhere from 30 to 50+ feet into the grassland on either side, then return to the road. Interestingly, when we were between the watchtower where you fight the first dragon and Whiterun, a Farmer (on his way to Windhelm to join the Stormcloaks) crossed the road ahead of her, then walked through the grassland to the junction at Whiterun near the stabes. When she reached the spot in the road where he crossed, she followed his path. On the way back, she followed the road instead of retracing her (and the Farmer's) footsteps. As well, when we were headed towards Whiterun, she gave Fort Greymoor a wide berth, moving off into the grassland opposite it. On the way back, she stayed on the road. We met an Imperial patrol on the way back to Rorikstead, and one of them knelt down to examine a dead rabbit. When she encountered the rabbit on the way toward Whiterun, she simply looked down at it and resumed her patrol. After the Soldier examined it, she examined it when she got to it, then resumed her walk toward Rorikstead. Another interesting tidbit is that there were 3 dead wolves (I killed on the way to find her) next to a stone wall. On her way to Whiterun, she got hung up on the end of the wall trying to get to the corpses. Once she finally got through, she walked across a low spot of the wall and continued along the road. On the way back to Rorikstead, she did the same thing at the same points - got hung up on the end of the wall, then crossed the low point to get back on the road. Link to comment Share on other sites More sharing options...
DrNewcenstein Posted May 25, 2014 Share Posted May 25, 2014 Further, the Packages are found in the CK under Character>Package. Looking at the various Packages, some have more options than others. For example, just about everything gets DefaultMasterPackage, which has more options than PatrolStaticPathing. They do all appear to have identical Flags, such as Hellos to Player, and whether or not to use the Aggro Radius Behavior settings specified in the Actor's Base AI Data settings (which I point out specifically since that's something I'm currently working with in another mod). There's also a Flag to indicate whether the Patrol Package "Must Complete", and times of Day, as well as an option to set the movement speed of whomever the Package in question is attached to. You can set this option to stipulate that your NPC will run, rather than walk. Link to comment Share on other sites More sharing options...
JobVanDam Posted May 25, 2014 Share Posted May 25, 2014 Yeah I'm using SandboxMultiLocation and you get to select 6 different points and they will randomly walk to one of these areas. Though I haven't chacked what happens when they get to that area though. It's the same method the Populated series uses and in that mod they sandbox for a bit and just leave soon after. Weird thing is even though I created a few NPC followers and leaders and specifically made them follow a specific leader they all seem to spawn close by to one leader and follow him so there was 14 bandits following one leader. I'm hoping it's just Skyrim goofiness because I JUST edited the plugin and over time it will fix itself but it is weird. Link to comment Share on other sites More sharing options...
DrNewcenstein Posted May 25, 2014 Share Posted May 25, 2014 Look at the Caravan Leader and Follower packages - there's one for all 3. That might help with your settings. I poked through them a little bit a while back and did see a setting for follow distance, but can't recall where. IIRC, you set the first follower's distance, then set the others to 1.5x - 2x that one, and then 2.5x - 3x for the third one, just to keep them separated better. So like you have the first follower set to 128, the 2nd set to 512, and the 3rd to 640. That should keep them off each other's heels. As for the patrol markers, they're just idle markers that NPCs will move to. If you have Idle Time set to 0, they just Ping-Pong from one to the other non-stop. You can set them to perform specific Idles at each marker, so at one they eat, at another they read a book, and at another they'll sleep. There are generally 3 idles for each action - Enter, Loop, and Exit. You should be able to set those in the Package that's attached to the marker. However, I'm not sure if you need to create Duplicates of the package you want them to follow. It looks to me like you at least have to build a package list from various specific packages, as there are options to choose from in the AI Packages window of your NPC that are the separate components of the DefaultPackageList chosen in the drop-down boxes. So, let's say you're building an NPC that will attack Thalmor Prisoner Patrols. You set their Faction, and then set whatever that particular Thalmor Patrol Faction is to Enemy, set your Patrol Idle Markers where you want them to patrol, then set how you want them to respond to the encounter (which should be set automatically since the Thalmor faction would be set as Enemy of your NPC's Faction). Link to comment Share on other sites More sharing options...
Recommended Posts