Jokerine Posted June 25, 2015 Share Posted June 25, 2015 Hello everybody! So, I have this little dungeon in a mod I'm making, and my plan is to make it so only the player can enter and any followers will stay outside and only enter the cell once an NPC is killed. I have set up a trigger and a hack-job script that is working, but I was wondering if there would be some other way to do this that would be a bit more lightweight (I am using OnTrigger, and if I remember correctly, that one fires up each frame - I tried OnTriggerEnter and OnTriggerLeave but the NPCs would just flicker in and out of sight, or not be disabled/enabled at all). If this was an ideal world without mods I would be watching a movie right now I could just call for specific REFs to be disabled when entering the trigger - say, Boone or Veronica. But since we do have mods I was hoping to find a way to disable all possible NPCs that could be following the player. I mean, I could ask the players not to bring followers and leave it at that, but when has anybody ever listened to a mod author's request? :laugh: Anyway, here's the script. Really basic, as you can see. scn CompanionBeGoneTriggerScript ref NPCEnteringDungeon Begin onTrigger if ( NPCREF.NPCHasDied == 0 ) set NPCEnteringDungeon to GetActionRef NPCEnteringDungeon.disable else NPCEnteringDungeon.enable NPCEnteringDungeon.MoveTo Player, 50, 0, 0 endif END I tried putting in a DoOnce, but then only the first out of the two followers I brought was disabled and the other just stood there staring at me. :pinch: I plan on disabling and MarkForDelete'ing the trigger later, once it's all done, so it won't be sticking around forever looping its script, but I do worry about it running while the player is in my dungeon... I may have to remove the MoveTo Player line later, too, because then companions would constantly be dragged behind the player until I disable the trigger, right? Gah, so complicated. But most companions' AI packages should make them approach the player anyway once they are enabled, so I guess I can remove that line later after all. So... Would this trigger script be a problem with save bloat or whatnot? Does anybody know of some other way I could make this work? It would be most appreciated. Thank you! :yes: Link to comment Share on other sites More sharing options...
RoyBatterian Posted June 25, 2015 Share Posted June 25, 2015 Hrm, what about making a "holding" area where the actual door links to with a trigger volume in it, and then move the player to a marker. You could detect what NPC's are in the cell ... that might be a lutana script function tho... or nvse. If you want to avoid that you can use the 0 damage explosion method to get the refs for all entities in the radius... hmmm Maybe someone else has a better idea. Link to comment Share on other sites More sharing options...
Nimboss Posted June 27, 2015 Share Posted June 27, 2015 In general you want a Prevent NV Companions from enter cell?http://forums.nexusmods.com/index.php?/topic/1905484-prevent-nv-companions-from-entering-a-cell/?hl=+followers I admit I have not scrutinized your script if you already read and follow the ideas from that post, but sure a lot heavy scripters was involved discussing methods to do just what you want. Hope it gives you new ideas. Link to comment Share on other sites More sharing options...
rickerhk Posted June 27, 2015 Share Posted June 27, 2015 It's not going to cause bloat. Scripts don't cause bloat in fallout unless they place something in the world. AFAIK really the only thing that causes bloat in fallout is placeatme objects that aren't cleaned up, and ash piles. I can't think of a simpler vanilla solution than your script. I think disabling followers is a good idea rather than messing with scriptpackages or their NPC variables. The things I would be concerned about about is a for-sure way of knowing when it's safe to disable the trigger (all followers have been re-enabled). Though waiting a sufficient amount of time should just take care of it - if the player is locked in the cell - once the player enters the trigger they probably shouldn't be allowed to leave the cell until your timer for safe disabling the trigger expires. The script won't run if the player leaves the cell. Another more complicated Vanilla way would be a script on the door to the cell, that when activated launches a quest script that bounces a touch spell (or explosion) that runs an effect script to get actor REFs with a package target equal to the player. It would fill ref variables (maybe up to 10) in the quest and after a small delay set a variable so the door knows it's ok to activate. Then the quest script tracks when the certain actor is dead then re-enable and moves followers given the ref variables. The quest script then halts itself (also doesn't let itself get launched again by the door script if it's already running. NVSE can simplify the quest script with a ref walk and a form list. The JIP NVSE plugin has a GetFollowers that fills a formlist for you http://geck.bethsoft.com/index.php?title=GetFollowers but IDK if that is teammates only or any actor that has the player as a package target. Link to comment Share on other sites More sharing options...
Jokerine Posted June 28, 2015 Author Share Posted June 28, 2015 Thanks for the input, rickerhk! Glad to hear bloat shouldn't be an issue. I'm thinking I'll probably stall the player a bit with a dash of backtracking once it's all done, to give the script time to re-enable all followers. The player will already be locked into the cell until the quest is done, yup. Unless they decide to purposefully break stuff by using the console, I think it should all work correctly. I'll probably have to do quite a bit of testing with this, in any case. Appreciate the responses, everybody! Y'all rock! :dance: Link to comment Share on other sites More sharing options...
Recommended Posts