YouDoNotKnowMyName0 Posted Thursday at 12:07 AM Share Posted Thursday at 12:07 AM Hello everybody! I am currently working on a little quest mod and I am having trouble with implementing the AI packages. What I am trying to implement: An NPC has their regualr daily routine. If a certain quest reaches a certain quest stage, the NPC will get "kidnapped" and the player has to rescue them. Then at some point, the NPc will be able to return to their normal daily schedule again. How do I plan on implementing this: The "regular day" packages all have a condition: A global variable needs to be 0. The "use specific idle marker in prison cell" package has a condition: The global variable needs to be 1. The quest that handles all of this will set the global variable to 1, move the NPC to an XMarkerHeading near the idle marker inside of the prison cell and then run "EvaluatePackage()" on the NPC to make sure their packages evaluate the conditions again. Why global variables and not quest stages? Because there will be a few possible condions for the NPC returning back to their "normal life", so trying to do that with checking quest stages would make the conditons for the packages overly complicated. So I just use a simple global variable that gets set to 1 if the NPC is imprisoned and when it is set to 0, the NPC will be free again. Information about the cells: The NPC usually is inside a city (and its interior cells). When the quest stage that teleports the NPC gets activated, the player is in an interior cell in that city. The NPC will get teleported into an interior cell that is connected to the main skyrim worldspace by another interior cell. The load door for those two interior cells is a few exterior cells away from the load door to the city where the NPC usually lives. None of the load doors are locked, but the prison door of the NPCs prison cell is locked and needs a key. All interior cells are navmeshed and have properly set up load doors. The problem(s): It works so far, when the quest reaches that stage, the NPC will get "teleported" away from wherever they normally are (the questmarker points me to go outside of the city, the NPC is usually only within the city). However when I exit the town and start walking towards the door to the interior cell where the NPC should be "imprisoned", I will meet the NPC walking towards me. So there are two issues: The NPC will not do their "use idle package" indefinitley The NPC will use other packages despite the conditions of them not allowing that What I already checked or tried: I went through every single of their packages and made sure they had the condition set to "GetGlobalVariable" NpcInPrisonVar == 0. So the NPC should not try to do their normal packages. I also tried to put the "use idle marker" package at the top or the bottom of the package stack, neither of them changed anything, I still could find the NPC walking through the worldspace towards town. And I tried to use the "travel" package and have the NPC "travel to near self". I also made sure to set the "Must complete" flag of the "use idle marker" package, but that did not change anything. So, what is going on here? What else can I try to make this work? Can I somehow tell the game to not ignore the locked door in that cell, even when that cell is currently not loaded? What package should I use (and how should I configure it) to make the NPC use an idle marker forever (until a condition in that package prohibits that)? Any help would be appreciated! Link to comment Share on other sites More sharing options...
xkkmEl Posted Thursday at 04:30 AM Share Posted Thursday at 04:30 AM Not the expert on AI packages... I just use various aliases and move my NPCs from alias to alias, each with it's AI package. So, in your shoes, I'd set up a script that wakes up when it's time to change mode, and move the NPC into a new alias, and use moveto to teleport him where he needs to be (since you want a 'teleport'). Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName0 Posted Thursday at 01:25 PM Author Share Posted Thursday at 01:25 PM That is what I do. I use a script fragment attached to the quest stage that teleports the NPC to their prison cell and a AI package that should keep them using an idle marker there. But the NPC will NOT use that ai package forever, they will continue to use their normal packages, despite them beeing "disabled" by their conditons. Link to comment Share on other sites More sharing options...
xkkmEl Posted Thursday at 08:06 PM Share Posted Thursday at 08:06 PM Check the priority of the quest that puts the alias AI. It needs to beat all other quest-installed packages. Most default packages just do the one activation, then invalidate themselves. Try making a custom AI package that explicitly loops, or keeps him confined in a narrow sandbox. The CK wiki says it like the package will replay as long as it is the top valid package, but I have found that inconsistent and I am unsure of when or why it fails and succeeds. Looping (with a repeating sequence branch) works best for me. Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName0 Posted Thursday at 08:30 PM Author Share Posted Thursday at 08:30 PM (edited) What do you mean by that? My quest does not touch the AI packages directly. The quest just sets a global variable to 1. The packages check if that variable is set to 0 or 1. I tried editing the sequence thing of the package: I set the "Repeat when complete" in the procedure tree to true. I set the "Success completes package" to false in the "Procedure: Use Idle Marker". But that did not change anything. the NPC still walks back towards town after beeing teleported into her prison cell. The custom "Stay in prison" AI package is already the top AI package. Edit: Isn't there a quest like this in the normal game, I think it is a random quest you have to do for the compansions, a random citizen gets taken by bandits and you need to rescue them. I will look that up and see how that is implemented there ... Edit: I found that quest and the package that it uses, made a copy of it with another name and edited to use the marker that I use in my cell. That did not work, the NPC still walks towards town. I also tried to change the conditions of all packages of the NPC to check the quest stage instead of the global variable. I thought that maybe it is a a bug with checking global variables but it still does not work, the NPC heads right back to town. Edited Thursday at 09:10 PM by YouDoNotKnowMyName0 Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName0 Posted Thursday at 10:30 PM Author Share Posted Thursday at 10:30 PM I think I got it to work! I had a good look at how the companion quest that I mentioned was implemented (https://en.uesp.net/wiki/Skyrim:Rescue_Mission). And the "keep npc in place" package was added to the NPC in the quest alias of the quest. I tried that in my own quest and it works! The NPC stays in the cell after beeing teleported there and beeing told to reevaluate their packages by the quest script. I have never been so happy to see someone in a prison cell. (That sounds wrong, but you know what I mean) Thanks for the ideas and things to check! I consider this topic closed. Link to comment Share on other sites More sharing options...
Recommended Posts