Jump to content

[LE] Optimizing a monster script


Recommended Posts

Well this is disheartening, I just used the "fixed" script and it ran at 5:39

 

I am going to go back to my revised version of your original and see what it runs at now with the same setup. Here is what I ran on that 5:39 test

 

DBM_PrepStationScript2

 

 

Scriptname DBM_PrepStationScript2 extends DBM_PrepStationScript2Extender ; ObjectReference
{rewritten by ReDragon 2017, original by iceCreamAssassin}
; https://forums.nexusmods.com/index.php?/topic/5458177-optimizing-a-monster-script/

; Purpose: "This script basically checks to see if references on various fomlists are enabled and
; if not checks if a player has an item on a matching list index and then goes about 'displaying the item'."

; Issue: ".. there are so many lists and items on these lists that the while loop setup
; really slows things down and it can take up to 3 minutes to run the whole thing."
; -------------------------------------------------------------------------------------

Quest PROPERTY DBM_GuidebookHandler auto
Message PROPERTY SortMsg auto
GlobalVariable PROPERTY DBM_SortWait auto

Actor PROPERTY PlayerRef auto ; DO NOT USE !!!

;FormList ITEMLIST
;FormList DISPLAYLIST

;ObjectReference O
;Form f
;Weapon M
;Armor N
;Int Index
;Int Index2

Bool bArmoryDone ; added by ReDragon


; -- FUNCTION --

;/ *** older version ***
;------------------------------------------------------------------------------
FUNCTION ArmorySort(Actor aRef, FormList DisplayList, FormList ItemList = None)
;------------------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()
; Note: "ItemList == DisplayList"

form fm
objectReference oRef
objectReference asRef = ArmorySafe

ItemList = DisplayList

float f = 0 ; (0) init variables
int i = DisplayList.GetSize()
WHILE (i > 0)
i = i - 1
;;; oRef = DisplayList.GetAt(i) as ObjectReference

;;; IF (oRef) && oRef.IsDisabled()
fm = ItemList.GetAt(i) ; missing in original !!!

IF (!fm) || Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (asRef.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
form fmBase = oRef.GetBaseObject() ; store the baseobject
IF (fmBase as Weapon) || (fmBase as Armor)
aRef.RemoveItem(fm, 1, TRUE, asRef)
f = f + 1
oRef.Enable()
ENDIF
ENDIF
;;; ENDIF
ENDWHILE
myF_UpdateGlobal(f)
ENDFUNCTION
*** /;

;------------------------------------------------------------------------------
FUNCTION ArmorySort(Actor aRef, FormList DisplayList, FormList ItemList = None) ; older version was not good enough
;------------------------------------------------------------------------------
; "aRef" is Game.GetPlayer(), see OnUpdateGameTime()
; Note: "ItemList == DisplayList"

form fm
objectReference oRef
;;; objectReference asRef = ArmorySafe

;;; ItemList = DisplayList

float f = 0 ; (0) init variables
int i = DisplayList.GetSize()
WHILE (i > 0)
i = i - 1
oRef = DisplayList.GetAt(i) as ObjectReference

IF (oRef) && oRef.IsDisabled()
fm = oRef as Form ; == ItemList.GetAt(i)

IF Game.IsObjectFavorited(fm) || (ArmorySafe.GetItemCount(fm) > 0) || DBM_ExcludeList.HasForm(fm)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
;;; form fmBase = oRef.GetBaseObject() ; store the baseobject
;;; IF (fmBase as Weapon) || (fmBase as Armor)
IF (fm as Weapon) || (fm as Armor)
aRef.RemoveItem(fm, 1, TRUE, ArmorySafe)
f = f + 1
oRef.Enable()
ENDIF
ENDIF
ENDIF
ENDWHILE
myF_UpdateGlobal(f) ; see parent script
ENDFUNCTION


; -- EVENTs -- "Busy" + "ready"

;=========================================================
state busy
;=========
EVENT OnActivate(ObjectReference actionRef)
IF (actionRef == PlayerRef)
ELSE
RETURN ; - STOP - not the player
ENDIF
;---------------------
Debug.MessageBox("Please wait.. until sorting operation is completed!")
ENDEVENT

EVENT OnUpdateGameTime()
ArmorySafe.BlockActivation(TRUE)
; --------------------------
Utility.Wait(0.1)
actor aRef = Game.GetPlayer()

ArmorySort(aRef, DBM_ArmoryIron)
;;; ArmorySort(aRef, DBM_Armory.GetAt(0)) ; see parent script "DBM_PrepStationScript2Extender.psc" for optimization
;;; ArmorySort(aRef, DBM_ArmoryList[0])

ArmorySort(aRef, DBM_ArmorySteel)
;;; ArmorySort(aRef, DBM_Armory.GetAt(1)) ; variant 1: one formlist for 16
;;; ArmorySort(aRef, DBM_ArmoryList[1]) ; variant 2: one array which contains 16 formlists (my favorite)

ArmorySort(aRef, DBM_ArmoryNordic)
ArmorySort(aRef, DBM_ArmoryElven)
ArmorySort(aRef, DBM_ArmoryGlass)
ArmorySort(aRef, DBM_ArmoryOrcish)
ArmorySort(aRef, DBM_ArmoryDwarven)
ArmorySort(aRef, DBM_ArmoryEbony)
ArmorySort(aRef, DBM_ArmoryDaedric)
ArmorySort(aRef, DBM_ArmoryDragon)
ArmorySort(aRef, DBM_ArmoryFalmer)
ArmorySort(aRef, DBM_ArmoryForsworn)
ArmorySort(aRef, DBM_ArmoryBlades)
ArmorySort(aRef, DBM_ArmoryAncientNord)
ArmorySort(aRef, DBM_ArmoryDawnguard) ; DLC1 required
ArmorySort(aRef, DBM_ArmoryStalhrim) ; DLC2 required
; --------------------------
ArmorySafe.BlockActivation(False)

bArmoryDone = TRUE
Debug.Notification("Armory sorting done!") ; ***
ENDEVENT
;=======
endState


;=========================================================
auto state ready
;===============
EVENT OnActivate(ObjectReference actionRef)
IF (actionRef == PlayerRef)
ELSE
RETURN ; - STOP - not the player
ENDIF
myF_Test(actionRef as Actor)
;---------------------
IF DBM_SortWait.GetValue() == 1
Debug.MessageBox("You must wait for the current sorting operation to complete before removing displays")
RETURN ; - STOP - I am busy while sorting!
ENDIF
;---------------------
IF (SortMsg.Show() == 1)
RETURN ; - STOP - cancel, no sorting
ENDIF
;===================== if SortBtn == 0 ; Sort all display items

gotostate("busy") ; ### STATE ###
DBM_SortWait.SetValue(1)

Debug.Notification("All items being displayed, this will take a while..")

; #####################
bArmoryDone = False
RegisterForSingleUpdateGameTime(0.0) ; armory sorting not sequential, let it run parallel with another thread
; ######################################


; ****************************************************************
;;; SortGroup(Actor aRef, FormList DisplayList, FormList ItemList)
; ****************************************************************

; JEWELRY SORTING
SortJewelry(PlayerRef, DBM_JewelryUnique, DBM_JewelryUnique, JewelryCase, JewelryDisplays)

; MAIN MUSEUM
SortGroup(PlayerRef, DisplayActivators, DisplayItems) ; edited

; UPPER GALLERY
SortGroup(PlayerRef, UpperDisplays, UpperItems) ; edited


Debug.Notification("Still sorting displays 1") ; ***
; ------------------

; DAEDRIC GALLERY
SortGroup(PlayerRef, DBM_DaedricDisplays, DBM_DaedricItems)

; HALL OF LOST EMPIRES
SortGroup(PlayerRef, DBM_HOLEDisplays, DBM_HOLEItems)

; HALL OF SECRETS
SortGroup(PlayerRef, DBM_HOSDisplays, DBM_HOSItems)

; HALL OF ODDITIES
SortGroup(PlayerRef, OddityDisplays, OddityItems)


Debug.Notification("Still sorting displays 2") ; ***
; ------------------

; LIBRARY SORTING
SortBooks(PlayerRef, DBM_BCSDisplays, DBM_BCSItems)


; ####################################### see event OnUpdateGameTime()
;; ARMORY
; ArmorySafe.BlockActivation(TRUE)
;
; ArmorySort(PlayerRef, DBM_ArmoryIron)
; ArmorySort(PlayerRef, DBM_ArmorySteel)
; ArmorySort(PlayerRef, DBM_ArmoryNordic)
; ArmorySort(PlayerRef, DBM_ArmoryElven)
; ArmorySort(PlayerRef, DBM_ArmoryGlass)
; ArmorySort(PlayerRef, DBM_ArmoryOrcish)
; ArmorySort(PlayerRef, DBM_ArmoryDwarven)
; ArmorySort(PlayerRef, DBM_ArmoryStalhrim) ; DLC2 required
; ArmorySort(PlayerRef, DBM_ArmoryEbony)
; ArmorySort(PlayerRef, DBM_ArmoryDaedric)
; ArmorySort(PlayerRef, DBM_ArmoryDragon)
; ArmorySort(PlayerRef, DBM_ArmoryDawnguard) ; DLC1 required
; ArmorySort(PlayerRef, DBM_ArmoryFalmer)
; ArmorySort(PlayerRef, DBM_ArmoryForsworn)
; ArmorySort(PlayerRef, DBM_ArmoryBlades)
; ArmorySort(PlayerRef, DBM_ArmoryAncientNord)
;
; ArmorySafe.BlockActivation(False)
;; end of ARMORY
; ##############################################


; GEMSTONE DISPLAYS
SortGroup(PlayerRef, GemstoneDisplays, Gemstonelist)

; SHELL DISPLAYS
SortGroup(PlayerRef, ShellDisplays, ShellList)


Debug.Notification("Still sorting displays 3") ; ***
; ------------------

; ***************************************************************************
;;; myF_SortByMOD(String s, FormList DisplayList, FormList ItemList, Int n=0)
; ***************************************************************************
; n = 0 --> SortGroup()
; n = 1 --> SortJewelry()
; n = 2 --> SortJewelry2()
; n = 3 --> SortScales()
; n = 4 --> SortBooks()

; ElementalDragons
myF_SortByMOD("Elemental_Dragons.esp", DBM_EDDisplays, DBM_EDItems, 3) ; // SortScales()

; AMULETS OF SKYRIM SORTING
myF_SortByMOD("SL01AmuletsSkyrim.esp", DBM_AOSCaseList, DBM_AOSCaseList, 2) ; // SortJewelry2()

; SUT COLLECTION
myF_SortByMOD("SkyrimsUniqueTreasures.esp", DBM_UTDisplays, DBM_UTItems) ; // SortGroup() 0 by Default

; TROPHY HEADS
myF_SortByMOD("BGTrophyHeads.esp", DBM_HeadsDisplays, DBM_HeadsItems)

; JAR COLLECTION
myF_SortByMOD("BadGremlinsJarHunt.esp", DBM_JarDisplays, DBM_JarItems)


Debug.Notification("Still sorting displays 4") ; ***
; ------------------


; AETHERIUM COLLECTION
myF_SortByMOD("AetheriumSwordsnArmor.esp", DBM_AetherealDisplays, DBM_AetherealItems)

; MORE INTERESTING LOOT
myF_SortByMOD("More Interesting Loot for Skyrim.esp", DBM_MILDisplays, DBM_MILItems)

; CAPTURED FAIRIES
myF_SortByMOD("BGTheCapturedFairies.esp", DBM_FairyDisplays, DBM_FairyItems)

; MAD MASKER
myF_SortByMOD("TheMadMasker.esp", DBM_MadMaskerDisplays, DBM_MadMaskerItems)

; FISH DISPLAYS
myF_SortByMOD("BGSomethingFishy.esp", DBM_FishDisplays, DBM_FishItems)

; HELGEN
myF_SortByMOD("Helgen Reborn.esp", DBM_HelgenDisplays, DBM_HelgenItems)


Debug.Notification("Still sorting displays 5") ; ***
; ------------------


; GrayCowl
myF_SortByMOD("Gray Fox Cowl.esm", DBM_GrayCowlDisplays, DBM_GrayCowlItems) ; ESM-file

; WYRMSTOOTH
myF_SortByMOD("Wyrmstooth.esp", DBM_WyrmstoothDisplays, DBM_WyrmstoothItems)

; FALSKAAR
myF_SortByMOD("Falskaar.esm", DBM_FalskaarDisplays, DBM_FalskaarItems) ; ESM-file

; WHEELS OF LULL
myF_SortByMOD("WheelsOfLull.esp", DBM_LullDisplaysList, DBM_LullItems)

; MOON AND STAR
myF_SortByMOD("Moonandstar_MAS.esp", DBM_MASDisplays, DBM_MASItems)

; IWIA
myF_SortByMOD("Immersive Weapons.esp", DBM_IWIADisplays, DBM_IWIAItems)
myF_SortByMOD("Hothtrooper44_ArmorCompilation.esp", DBM_IWIADisplays, DBM_IWIAItems)


Debug.Notification("Still sorting displays 6") ; ***
; ------------------


; KA displays
myF_SortByMOD("Konahrik_Accoutrements.esp", DBM_KADisplays, DBM_KAItems)

; AOB Displays
myF_SortByMOD("ArtifactsOfBoethiah.esp", DBM_AOBDisplays, DBM_AOBItems)

; Oblivion artifacts Displays
myF_SortByMOD("escutcheonredwave.esp", DBM_OAPDisplays, DBM_OAPItems)

; Skyrim Underground
myF_SortByMOD("akskyrimunderground.esp", DBM_SUGDisplays, DBM_SUGItems)

; Royal Armory
myF_SortByMOD("PrvtIRoyalArmory.esp", DBM_RADisplays, DBM_RAItems) ; SortGroup()

;----------------------------------------------------------------------
IF ( !bArmoryDone ) ; (bArmoryDone == False)
Debug.Notification("Sorting of displays done.. waiting for armory") ; ***
ENDIF

WHILE (!bArmoryDone)
Utility.Wait(0.25) ; We are waiting for armory!!
ENDWHILE
; ----------------------

Debug.Messagebox("Done! All items displayed..") ; *** END ***
DBM_GuidebookHandler.SetStage(10) ; update quest stages

IF DBM_Utils.GetSharingEnabled()
SendModEvent("DBM_Message", "DoFullScan")
ENDIF

DBM_SortWait.SetValue(0)
gotoState("ready") ; ### STATE ###
ENDEVENT
;=======
endState

 

 

 

DBM_PrepStationScript2Extender

 

 

Scriptname DBM_PrepStationScript2Extender extends ObjectReference
{written by ReDragon 2017, parent of "DBM_PrepStationScript2"}

; contains outsourced Functions and Properties
; https://forums.nexusmods.com/index.php?/topic/5458177-optimizing-a-monster-script/


GlobalVariable PROPERTY DBM_DisplayMAX auto

; Do you need all three scripts here, not only one for the object? (ReDragon)
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; answer: ?

DBM_JewelryDisplayScript PROPERTY ScaleDisplays auto
DBM_JewelryDisplayScript PROPERTY JewelryDisplays auto
DBM_JewelryDisplayScript PROPERTY JewelryDisplays2 auto


; How many objects have that script attached? (ReDragon)
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; answer: ?

ObjectReference PROPERTY DisplaySafe auto ; SortGroup()
ObjectReference PROPERTY DisplaySafe2 auto ; SortBooks()
ObjectReference PROPERTY ArmorySafe auto ; ArmorySort()
ObjectReference PROPERTY JewelryCase auto ; SortJewelry()
ObjectReference PROPERTY JewelryCase2 auto ; SortJewelry2()
ObjectReference PROPERTY ScaleCase auto ; SortScales()


; -- FUNCTIONs -- 2 + 2 + 4 = 8

;---------------------------------------------------------------------------------
FUNCTION myF_SortByMOD(String s, FormList DisplayList, FormList ItemList, Int n=0) ; helper
;---------------------------------------------------------------------------------
; s = "ModName.esp"
; n = 0 --> SortGroup()
; n = 1 --> SortJewelry()
; n = 2 --> SortJewelry2()
; n = 3 --> SortScales()
; n = 4 --> SortBooks()

IF (Game.GetModByName(s) == 255) ; SKSE required
;; Debug.Trace(self+" Mod: " +s+ " not found!")
RETURN ; - STOP - mod not found
ENDIF
;---------------------
IF (n == 0)
SortGroup(Game.GetPlayer(), DisplayList, ItemList)

ELSEIF (n == 1)
SortJewelry(Game.GetPlayer(), DisplayList, ItemList, JewelryCase, JewelryDisplays)

ELSEIF (n == 2)
SortJewelry2(Game.GetPlayer(), DisplayList, ItemList, JewelryCase2, JewelryDisplays2)

ELSEIF (n == 3)
SortScales(Game.GetPlayer(), DisplayList, ItemList, ScaleCase, ScaleDisplays)

ELSEIF (n == 4)
SortBooks(Game.GetPlayer(), DisplayList, ItemList)
ENDIF
ENDFUNCTION


;---------------------------------
FUNCTION myF_UpdateGlobal(Float f) ; helper
;---------------------------------
f = f + DBM_DisplayMax.GetValue()
DBM_DisplayMax.SetValue(f) ; set globalVar
ENDFUNCTION


;----------------------------------------------------------------------
FUNCTION SortGroup(Actor aRef, FormList DisplayList, FormList ItemList)
;----------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()

form fm
objectReference oRef
objectReference dsRef = DisplaySafe

float f = 0 ; (0) init variables
int i = DisplayList.GetSize()
WHILE (i > 0)
i = i - 1
oRef = DisplayList.GetAt(i) as ObjectReference ; (1) get the object Ref

IF (oRef) && oRef.IsDisabled() ; (2) is it valid and currently disabled
fm = ItemList.GetAt(i) ; (3) get the item now

IF (!fm) || Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (dsRef.GetItemCount(fm) > 0)
; do nothing // SKSE: "Game.IsObjectFavorited(fm)"
; http://www.creationkit.com/index.php?title=IsObjectFavorited_-_Game

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, dsRef) ; (4) object is disabled, move it to DisplaySafe
f = f + 1
oRef.Enable() ; (5) enable it
ENDIF
ENDIF
ENDWHILE
myF_UpdateGlobal(f) ; (6) update globalVar
ENDFUNCTION


;----------------------------------------------------------------------
FUNCTION SortBooks(Actor aRef, FormList DisplayList, FormList ItemList)
;----------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()

form fm
objectReference oRef
objectReference ds2Ref = DisplaySafe2

float f = 0 ; (0) init variables
int i = DisplayList.GetSize()
WHILE (i > 0)
i = i - 1
oRef = DisplayList.GetAt(i) as ObjectReference

IF (oRef) && oRef.IsDisabled()
fm = ItemList.GetAt(i)

IF (!fm) || Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (ds2Ref.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, ds2Ref)
f = f + 1
oRef.Enable()
ENDIF
ENDIF
ENDWHILE
myF_UpdateGlobal(f)
ENDFUNCTION


;-------------------------------------------------------------------
FUNCTION Sort_SubList(Actor aRef, Form fmL, ObjectReference caseRef) ; helper for the next three functions
;-------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()
; "caseRef" is property ScaleCase, JewelryCase or JewelryCase2

;;; formList Sublist = fmL as FormList
form fm

int i = (fmL as FormList).GetSize()
WHILE (i > 0)
i = i - 1
fm = (fmL as FormList).GetAt(i)

IF (fm as Armor)
IF Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (caseRef.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, caseRef)
ENDIF
ENDIF
ENDWHILE
ENDFUNCTION

;---------------------------------------------------------------------------------------------------------------------------
FUNCTION SortScales(Actor aRef, FormList DisplayList, FormList ItemList, ObjectReference scRef, DBM_JewelryDisplayScript ps)
;---------------------------------------------------------------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()
; "scRef" is property ScaleCase
; "ps" is property ScaleDisplays

form fm
;;; objectReference oRef

int i = ItemList.GetSize()
WHILE (i > 0)
i = i - 1
;;; oRef = DisplayList.GetAt(i) as Objectreference ; missing in original !!!

;;; IF (oRef) && oRef.IsDisabled() ; missing in original !!!
fm = ItemList.GetAt(i)

IF (fm as Armor)
IF Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (scRef.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, scRef)
ENDIF

ELSEIF (fm as FormList)
Sort_SubList(aRef, fm, scRef)
ENDIF
;;; ENDIF
ENDWHILE

; ScaleDisplays
ps.ResetDisplay() ; How much time consume these both functions?
ps.UpdateDisplay()
ENDFUNCTION

;----------------------------------------------------------------------------------------------------------------------------
FUNCTION myF_Test(Actor aRef)
;----------------------------------------------------------------------------------------------------------------------------
; do nothing
ENDFUNCTION

;----------------------------------------------------------------------------------------------------------------------------
FUNCTION SortJewelry(Actor aRef, FormList DisplayList, FormList ItemList, ObjectReference jcRef, DBM_JewelryDisplayScript ps)
;----------------------------------------------------------------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()
; "scRef" is property JewelryCase
; "ps" is property JewelryDisplays

form fm
;;; objectReference oRef

int i = ItemList.GetSize()
WHILE (i > 0)
i = i - 1
;;; oRef = DisplayList.GetAt(i) as Objectreference ; missing in original !!!

;;; IF (oRef) && oRef.IsDisabled() ; missing in original !!!
fm = ItemList.GetAt(i)

IF (fm as Armor)
IF Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (jcRef.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, jcRef)
ENDIF

ELSEIF (fm as FormList)
Sort_SubList(aRef, fm, jcRef)
ENDIF
;;; ENDIF
ENDWHILE

; JewelryDisplays
ps.ResetDisplay()
ps.UpdateDisplay()
ENDFUNCTION


;------------------------------------------------------------------------------------------------------------------------------
FUNCTION SortJewelry2(Actor aRef, FormList DisplayList, FormList ItemList, ObjectReference jc2Ref, DBM_JewelryDisplayScript ps)
;------------------------------------------------------------------------------------------------------------------------------
; "aRef" should be actionRef, which is Game.GetPlayer()
; "scRef" is property JewelryCase2
; "ps" is property JewelryDisplays2

form fm
;;; objectReference oRef

int i = ItemList.GetSize()
WHILE (i > 0)
i = i - 1
;;; oRef = DisplayList.GetAt(i) as Objectreference ; missing in original !!!

;;; IF (oRef) && oRef.IsDisabled() ; missing in original !!!
fm = ItemList.GetAt(i)

IF (fm as Armor)
IF Game.IsObjectFavorited(fm) || DBM_ExcludeList.HasForm(fm) || (jc2Ref.GetItemCount(fm) > 0)
; do nothing // SKSE required

ELSEIF (aRef.GetItemCount(fm) > 0) && !aRef.IsEquipped(fm)
aRef.RemoveItem(fm, 1, TRUE, jc2Ref)
ENDIF

ELSEIF (fm as FormList)
Sort_SubList(aRef, fm, jc2Ref)
ENDIF
;;; ENDIF
ENDWHILE

; JewelryDisplays2
ps.ResetDisplay()
ps.UpdateDisplay()
ENDFUNCTION


;###################################################################
;### FormLists ###
;#################

FormList Property DBM_ExcludeList Auto

FormList Property DisplayActivators Auto
FormList Property DisplayItems Auto

FormList Property DBM_DaedricDisplays Auto
FormList Property DBM_DaedricItems Auto

FormList Property OddityDisplays Auto
FormList Property OddityItems Auto

FormList Property DBM_HOLEDisplays Auto
FormList Property DBM_HOLEItems Auto

FormList Property DBM_HOSDisplays Auto
FormList Property DBM_HOSItems Auto

FormList Property DBM_BCSDisplays Auto
FormList Property DBM_BCSItems Auto

FormList Property DBM_UTDisplays Auto
FormList Property DBM_UTItems Auto

FormList Property DBM_KADisplays Auto
FormList Property DBM_KAItems Auto

FormList Property DBM_JARDisplays Auto
FormList Property DBM_JARItems Auto

FormList Property DBM_AetherealDisplays Auto
FormList Property DBM_AetherealItems Auto

FormList Property DBM_MILDisplays Auto
FormList Property DBM_MILItems Auto

FormList Property DBM_FairyDisplays Auto
FormList Property DBM_FairyItems Auto

FormList Property DBM_MadMaskerDisplays Auto
FormList Property DBM_MadMaskerItems Auto

FormList Property DBM_HelgenDisplays Auto
FormList Property DBM_HelgenItems Auto

FormList Property DBM_GrayCowlDisplays Auto
FormList Property DBM_GrayCowlItems Auto

FormList Property DBM_WyrmstoothDisplays Auto
FormList Property DBM_WyrmstoothItems Auto

FormList Property DBM_FalskaarDisplays Auto
FormList Property DBM_FalskaarItems Auto

FormList Property DBM_LullDisplaysList Auto
FormList Property DBM_LullItems Auto

FormList Property DBM_HeadsDisplays Auto
FormList Property DBM_HeadsItems Auto

FormList Property UpperDisplays Auto
FormList Property UpperItems Auto

FormList Property GemstoneDisplays Auto
FormList Property GemstoneList Auto

FormList Property ShellDisplays Auto
FormList Property ShellList Auto

FormList Property DBM_FishDisplays Auto
FormList Property DBM_FishItems Auto

FormList Property DBM_IWIADisplays Auto
FormList Property DBM_IWIAItems Auto

FormList Property DBM_JewelryUnique Auto

FormList Property DBM_MASItems Auto
FormList Property DBM_MASDisplays Auto

FormList Property DBM_AOBItems Auto
FormList Property DBM_AOBDisplays Auto

FormList Property DBM_OAPItems Auto
FormList Property DBM_OAPDisplays Auto

FormList Property DBM_SUGItems Auto
FormList Property DBM_SUGDisplays Auto

FormList Property DBM_RAItems Auto
FormList Property DBM_RADisplays Auto

FormList Property DBM_EDItems Auto
FormList Property DBM_EDDisplays Auto

FormList Property DBM_AOSCaseList Auto

;-------------------------------------------------
;;; FormList PROPERTY DBM_Armory auto ; variant 1: Try to use 1 armory formlist instead of 16!
; DBM_Armory.GetAt(0) = DBM_ArmoryIron
; DBM_Armory.GetAt(1) = DBM_ArmorySteel
; ...
; DBM_Armory.GetAt(13)= DBM_ArmoryAncientNord

;;; FormList[] PROPERTY DBM_ArmoryList auto ; variant 2: Try to use 1 armory array instead of 16 formlist properties!!
; DBM_ArmoryList[0] = DBM_ArmoryIron
; DBM_ArmoryList[1] = DBM_ArmorySteel
; ...
; DBM_ArmoryList[13]= DBM_ArmoryAncientNord

FormList Property DBM_ArmoryIron Auto ; 16x
FormList Property DBM_ArmorySteel Auto
FormList Property DBM_ArmoryNordic Auto
FormList Property DBM_ArmoryElven Auto
FormList Property DBM_ArmoryGlass Auto
FormList Property DBM_ArmoryOrcish Auto
FormList Property DBM_ArmoryDwarven Auto
FormList Property DBM_ArmoryEbony Auto
FormList Property DBM_ArmoryDaedric Auto
FormList Property DBM_ArmoryDragon Auto
FormList Property DBM_ArmoryFalmer Auto
FormList Property DBM_ArmoryBlades Auto
FormList Property DBM_ArmoryForsworn Auto
FormList Property DBM_ArmoryAncientNord Auto
FormList Property DBM_ArmoryDawnguard Auto ; DLC1
FormList Property DBM_ArmoryStalhrim Auto ; DLC2

 

 

 

I do not attach the extender script at all and fill all the properties in the child script of course.

 

EDIT: Ok, the first version I reworked came in at 5:08 so must be a general slowdown on my PC at the moment for some reason compared to the other day when I had it just over 4:00... guess I'll keep fiddling with it and see what I could do. Thanks for the help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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