Jump to content
ℹ️ Intermittent Download History issues ×

Modding Question


ZephyrX

Recommended Posts

I'm starting to think that maybe those NPCs get moved out of the cell when you leave. The GetFirstRef/GetNextRef wouldn't ignore disabled objects. That flag only applies to whether objects are "taken" (and only normal GECK objects).

 

It could be that you need to keep track of those NPCs some other way, like using variables in your quest script rather than using the GetFirstRef/GetNextRef loops. So, you could have like nine variables for up to nine NPCs, and they could keep track of each of your prisoners (so, even if they did escape the cell while disabled, you could just move them back before enabling them).

 

It's interesting that AI apparently takes priority over placement whether an NPC is even enabled or not.

Link to comment
Share on other sites

Hmm, I was hoping to avoid using variables only because they limit the scope of the mod. Then again, my computer would probably explode if I put more than 10 NPCs in a cell at a time, so I guess it doesn't matter :biggrin: . I'll try the moveto method first and then the variable way, but whenever I enable the NPCs through the console they seem to be in the exact same place they were before I left the cell, making me think that they aren't moving. Besides disabling them the NPCs, what do you think about moving the NPCs to a dummy cell that only has an xmarker to move them to when the player leaves the cell? They could be moved back and the script package can be added back to them on return. That way, they would never be disabled so getfirstref and getnextref should work. The NPCs shouldn't be able to leave the cell because there wouldn't be any door leading out.
Link to comment
Share on other sites

NPCs do have a knack for teleporting around when you're not in the cell with them. I doubt it matters whether you leave them in a prison or move them to a dummy cell.

 

Maybe a high-priority quest that works on a custom faction which contains some dialog with an NPC you have in the prison cell by default, and you AddToFaction that prisoner when they are put in. I wonder if dialog has priority over normal AI. Well, that would give them something to do other than sandbox, and it might prevent them from teleporting out.

Link to comment
Share on other sites

I tried the technique of moving the NPCs to a dummy cell and found that it worked perfectly with everything I could think of! I used the getfirstref and getnextref functions to move the NPCs between the cells and took your advice to implement addscriptpackage on the returning script. I couldn't have figured it out without you and I'm really thankful that you took a lot of your time to help me with this! Hope you learned something new and useful from this as I most definitely have. :thanks:
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...