ProfMajkowski Posted November 30, 2022 Share Posted November 30, 2022 Hey guys! I've been working on a mod for the past few weeks that will involve the player getting attacked at random by a hostile NPC. I've done everything else I know how to do (or managed to figure out somehow), but I just can't figure out how to do the actual core feature I just mentioned. It's a relatively simple concept on paper, just spawn a aggressive NPC somewhere near the player once in a while. That's it. But I'm struggling to figure out how to do it. I tried looking at mods that do similar things to see if I can kinda reverse-engineer this, but no luck with that since my understanding of CK is pretty limited. So if there's anyone willing to help me with this, I would greatly appreciate it. Link to comment Share on other sites More sharing options...
LarannKiar Posted November 30, 2022 Share Posted November 30, 2022 To create an actor reference in the game near the Player reliably, you need to make a Papyrus script. It won't be easy because you have to write a "PlaceActorAtPlayer" function yourself (as there's no such native function) that scans the area near the player (narrow / large, distance check), moves the NPC (to the nearest navmeshed ground), etc. Link to comment Share on other sites More sharing options...
ProfMajkowski Posted December 1, 2022 Author Share Posted December 1, 2022 To create an actor reference in the game near the Player reliably, you need to make a Papyrus script. It won't be easy because you have to write a "PlaceActorAtPlayer" function yourself (as there's no such native function) that scans the area near the player (narrow / large, distance check), moves the NPC (to the nearest navmeshed ground), etc.Yeah, I thought I would have to write my own script. I've come to understand Papyrus a little over the past few weeks, so I'll hopefully be able to put something together. Thank you for the advice! At least now I know where to start. Link to comment Share on other sites More sharing options...
tomahawk6633 Posted December 1, 2022 Share Posted December 1, 2022 You can take a look at the scripts found in "SKK Combat Stalkers" https://www.nexusmods.com/fallout4/mods/57842 just get the full random version. Link to comment Share on other sites More sharing options...
hereami Posted December 3, 2022 Share Posted December 3, 2022 (edited) Can use quest alias(es) for spawning and driving actors, fairly simple and efficient method. Though still may need a script to (re)start the quest itself at right moment, unless events manager is involved. Edited December 3, 2022 by hereami Link to comment Share on other sites More sharing options...
CrEaToXx Posted December 5, 2022 Share Posted December 5, 2022 Yeah. PlayerAlias script on a Quest. Then start a timer on real time, or game time, and have a leveled spawn placed at, or anywhere close to your position. Conditionize if you must, like f.e. only on a cell change only when you move, only outside of settlements, or interiors etc. Link to comment Share on other sites More sharing options...
ProfMajkowski Posted December 6, 2022 Author Share Posted December 6, 2022 Thanks guys, I think I know how to do it now. I'll give an update if I run into trouble. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts