How to connect 2 different scripts in different quests?

Post » Thu Jan 31, 2013 7:24 am

I still trying to find a good solution to reset NPCs changed by Realistic Body System.

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?
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Thu Jan 31, 2013 2:05 am

You can't declare RBSCorrectNPC script as a quest property in RBSSkyUI and just called the Function resetNPCs() ?
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am


Return to V - Skyrim