NSWorking Slaves Disable NPC Spawn on Workplace location bug...
Dear Reader!
This blog entry going to bit deep dive into Papyrus scripting, and modding. I try to use very simple tearms and examples for non papyrus programers.
The information i write here may not toaly accurate, if you spot mistake i made here or my understand the situation is wrong or you have any advice how to fix let me know some way!
I far from Master level papyrus scripter the time of writing this post ( but this is about to change
[ i hope
] ).
The problem, disgine to solve, and the soultion of the problem:
The problem this system i named Disable NPC Spawn at workplace (in sort from now "disable npc" ) in Working slaves is a future intended porpuse to preverent npcs to repsawn on the captured working workplace that player owns. This system by default inactive, player need to initiate the disable spawn procces.
The disigen to solve is this: npc spawn only controled by form settings that canot be changed in runtime by papyrus script. So only way to disable the spawn using scripts, to disable the npcs it self. (best of my knowlage )
To know what need to be disabled all npcs added a FormList ( Form list = list of things that you can put anything), This list refered from on now NPCList.
This list used to indentify what need to be disabled and this way preverent them respawn.
This disable operation only allowed to happen if player cleared the workplace location AND workplace quest started.
The problem:
"Peristance"
This case the problem is the NPC list make all npc "persistent".
At first this is seams not a big deal, i my self tought to.
Well turn out it is a big deal, if i wish keep my mod compatible with other mods... here is why:
Last day i made a new workplace for my self made mod: SLOS-SlaversLair.esp
This one contain a special interiort cell that ideal for Pahe slaves to work/stored. Someting similar that PAHE Manor slave chambers.
Then after i made my new workplace i dicided to change few thing in the SlaversLair.esp:
Deleted few npc to give player more chance to survive and conqure the place.
Well the deleted npcs not removed from my workplace!
Using Xedit i discovered the fallowing thing:
My NPCList made the npcs persitent, becuse the npc list made a separate ESP file that depended on Slavers Lair, all the deleted npc "reamined" if my workplace in the play.
To fix this issue i needed manualy delete all the reamining invalid npc from my workplace.esp using xedit.
This show why need duble check before realise in one hand, other hand show a sirus disigne flaw of my npc disabler system:
All of my workplace make all npc permanent if a mod added to load order that delete any of them the npc reamin or my scripts run a fatal error as try proces a wrong entry in the NPClist.
Okay this sound sirius issue but not realy is that sirus ( at least i hope XD ).
For this problem i found the fallowing soulutions at the time of writing:
1 - Remove the NPC disable system that uses form list, players has acces other way of npc removal any way that uses aliases to detect npcs, but that one not as easy and realibe the form list soulution.
2 - ignore the issue / let users solve them self /use compatibility patches. This means in case the form lists make conflict a patch can made that remove the npc from the list or add new one to them so no problem npc persisteance solved. ( from my point of standing propbably this is the secund most easy solution in sort run), This is not a real big issue any way if not a lot of mod make changes the workplaces....
3 - in theory based on what i read on creation kit wiki and other places possible use a quest to detect all npcs in a location. Add them the quest aliases then this quest aliases can be added a new npc list, that can be proccesed the usual way.
My problem with this sulution is this ( if i can make it happen, propbably can, not tryed the time of writing):
-if a player enter the workplace the player also collected as actor in the location
-slaver players tend to walk with slaves around plus followers
-player may leve fallower/slave a location when this script/quest runing here
-what if other quest adds quest critical npcs to the location that not okay to disable?
yes i can add a filter that contain all the type of enemys that can be found the locations and filter out the ones that not on the list. this is agin may proble problematic like pretier bandits may add new bandits that not on the list.
i can try use factions or keywords to filter out but probably that one not 100% realible.
Closing words:
The npc list simple and realible for this need. So the moment i looking for a soulution that proves same realibility without persistance propblem.
Propoably the ebst soultion is the 3th one with additional workorund options: maybe give a tool to player mark their chompanions and other npcs that need not to be disabled. This way detect all actor and disable them can be used in realibe way.
I hope this article may help others avoid same problems.
0 Comments
Recommended Comments
There are no comments to display.