Now i made a SkyUI menu. If user clicks on "click to reset NPCs" the resetNPCs script should run to reset the npcs.
This is the SkyUI script in a RBSSkyUI Quest:
scriptname RBSSkyUI extends SKI_ConfigBaseRBSCorrectNPCs Property RBSCorrectNPCsProperty autoint resetOID_T ; _T for textevent OnPageReset(string page)resetOID_T = AddTextOption("Reset NPCs:","click to reset NPCs")endEventevent OnOptionDefault(int option)if (option == resetOID_T) SetTextOptionValue(resetOID_T, "click to reset NPCs")endIfendEventevent OnOptionSelect(int option)if (option == resetOID_T) SetTextOptionValue(resetOID_T, "resetting NPCs...") Debug.MessageBox("test") RBSCorrectNPCsProperty.resetNPCs()endIfendEvent
This is the RBSCorrectNPCs Script in a questRBSInit quest:
Scriptname RBSCorrectNPCs extends QuestFormList Property RBSFormList AutoFunction resetNPCs()Utility.SetINIBool("bUseFaceGenPreprocessedHeads:General", false)Debug.MessageBox("RBS starting update...")Debug.MessageBox(RBSFormList.getSize() + " NPCs found")int i = RBSFormList.GetSize() while i actor f = Game.GetForm(RBSFormList.GetAt(i).GetFormID()) as ACTOR f.Resurrect() f.QueueNiNodeUpdate() i -= 1endwhileDebug.MessageBox("RBS updated")EndFunction
because SkyUI script is made with ck and RBSCorrectNPCs is created by Skyproc i cant put them together in one quest.
Debug.MessageBox("test") works if i click on the button, but resetNPCs does not run.
What am i doing wrong? What should i do to get it working?