Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

Tes5edit question: How do I add MGEF references to another Mod's Formlist? I am trying to Patch All Geared up and CACO Complete Alchemy Cooking Overhaul. The potions that CACO edits All Geared Up does not recognize. I'm told i can edit add the MGEF references for the potions from CACO to the FLST of All Geared Up and they will work together. Please advise me. Thanks very much!

It has been a while since I last added items to a formlist in xEdit. However, I want to say that all you need to do is load both mods in xEdit at the same time. Make sure that you have them loaded in the correct order. You locate the formlist record. Find on the record where the entries are listed. From there I believe you right click and add a new entry. Then you edit the new entry to point to whatever record you want. It may be a good idea to copy / paste the formID numbers of the desired records to add. That way you won't have to hunt for them, you can just paste the formID into the entry field and let xEdit populate with the correct data.

 

It would be best to save the edits into a patch file on the outside chance that one or both of the mods get updated. Wouldn't want to have to redo all the work. Better to just tweak a few things if necessary than repeat it all.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

 

I downloaded a sword mod but the blade is too thick...

Is there a way to make the blade thinner? If yes, how?

Learn how to edit the 3D mesh with a program like Blender. Easier said, than done.

 

You can try NifSkope for that purpose.

Transform>Scale Vertices.

Link to comment
Share on other sites

Thanks for all the help here my mod is now in final stages of cleanup and fixes before I release the beta. The one issue I'm having is the script takes almost 3 minutes to complete (Mod supports DLC individually instead of requiring them Original Skyrim release, not SE). Is there any way to speed up the scripts (functions handled in line or all at once?) without losing the functionality of the mod?

 

Edit: The script slowing the load time down is the item swapping. Can that be called only once for multiple items or does it need to be called each time for each item?

 

Edit: Also if my mod adds the item it's requesting for an item swap to a form list, do I need to call that function again?

Edited by LadyCrystyna
Link to comment
Share on other sites

Thanks for all the help here my mod is now in final stages of cleanup and fixes before I release the beta. The one issue I'm having is the script takes almost 3 minutes to complete (Mod supports DLC individually instead of requiring them Original Skyrim release, not SE). Is there any way to speed up the scripts (functions handled in line or all at once?) without losing the functionality of the mod?

 

Edit: The script slowing the load time down is the item swapping. Can that be called only once for multiple items or does it need to be called each time for each item?

 

Edit: Also if my mod adds the item it's requesting for an item swap to a form list, do I need to call that function again?

Without seeing the scripts in question, I doubt I could give you any definitive answers. Its like Schrodinger's cat... your scripts are both optimized and a complete mess until the 'box' is opened for them to be examined. :P

Link to comment
Share on other sites

LadyCrystyna, on 07 Jun 2018 - 12:07 PM, said:

Thanks for all the help here my mod is now in final stages of cleanup and fixes before I release the beta. The one issue I'm having is the script takes almost 3 minutes to complete (Mod supports DLC individually instead of requiring them Original Skyrim release, not SE). Is there any way to speed up the scripts (functions handled in line or all at once?) without losing the functionality of the mod?

Edit: The script slowing the load time down is the item swapping. Can that be called only once for multiple items or does it need to be called each time for each item?

Edit: Also if my mod adds the item it's requesting for an item swap to a form list, do I need to call that function again?

Without seeing the scripts in question, I doubt I could give you any definitive answers. Its like Schrodinger's cat... your scripts are both optimized and a complete mess until the 'box' is opened for them to be examined. :tongue:

Here are all the scripts. With these the load time clocks at around 2 minutes 33 seconds. I'd love to shorten the load time without losing functionality of the mod. I've been cleaning these up as best I can to shorten load times however, I'm not sure how to um improve the script. Thanks in advance for looking into this.

Startup Script



Scriptname LCCA_StartupScript extends Quest

bool property DLC1Loaded Auto Hidden ;Dawnguard
GlobalVariable Property LCCA_InstDawnguard Auto
GlobalVariable Property LCCA_DawnguardCompatibility Auto

bool property DLC2Loaded Auto Hidden ;Hearthfires
GlobalVariable Property LCCA_InstHearthfires Auto
GlobalVariable Property LCCA_HearthfiresCompatibility Auto

bool property DLC3Loaded Auto Hidden ;Dragonborn
GlobalVariable Property LCCA_InstDragonborn Auto
GlobalVariable Property LCCA_DragonbornCompatibility Auto

bool property MOD01Loaded Auto Hidden ;Clothing & Clutter Fixes Vanilla & Legendary
GlobalVariable Property LCCA_InstCCF Auto
GlobalVariable Property LCCA_CCFCompatibility Auto

LCCA_DLC_CompatibilityScript Property LCCA_MCMMenuQuest Auto

; -----------------------------------------------------------------------------

Event OnInit()
RegisterForSingleUpdate(2.0)
EndEvent

Event OnUpdate()
Debug.Notification("You have loaded LC's Crafting Addons for the first time, performing maintence via scripts.")
RunModCheck()
LCCA_MCMMenuQuest.SwitchItems_DLC()
UnregisterForUpdate()
Debug.Notification("LC's Crafting Addons maintence is now complete. Going to Active state inside the mod.")
GoToState("Active")
EndEvent

State Active
Event OnUpdate()
; Do nothing
EndEvent
EndState

Function RunModCheck()
Dawnguard_Check()
Hearthfires_Check()
Dragonborn_Check()
CCF_Check()
EndFunction

Function Dawnguard_Check()
If Game.GetModByName("Dawnguard.esm") != 255
LCCA_InstDawnguard.setValue(1)
LCCA_DawnguardCompatibility.setValue(1)
DLC1Loaded = true
Else
LCCA_InstDawnguard.setValue(0)
LCCA_DawnguardCompatibility.setValue(0)
DLC1Loaded = false
EndIf
EndFunction

Function Hearthfires_Check()
If Game.GetModByName("Hearthfires.esm") != 255
LCCA_InstHearthfires.setValue(1)
LCCA_HearthfiresCompatibility.setValue(1)
DLC2Loaded = true
Else
LCCA_InstHearthfires.setValue(0)
LCCA_HearthfiresCompatibility.setValue(0)
DLC2Loaded = false
EndIf
EndFunction

Function Dragonborn_Check()
If Game.GetModByName("Dragonborn.esm") != 255
LCCA_InstDragonborn.setValue(1)
LCCA_DragonbornCompatibility.setValue(1)
DLC3Loaded = true
Else
LCCA_InstDragonborn.setValue(0)
LCCA_DragonbornCompatibility.setValue(0)
DLC3Loaded = false
EndIf
EndFunction

Function CCF_Check()
If Game.GetModByName("Clothing & Clutter Fixes.esp") != 255
LCCA_InstCCF.setValue(1)
LCCA_CCFCompatibility.setValue(1)
Else
LCCA_InstCCF.setValue(0)
LCCA_CCFCompatibility.setValue(0)
EndIf
EndFunction

Player Alias Script



Scriptname LCCA_PlayerAliasScript extends ReferenceAlias

bool property DLC1Loaded Auto Hidden ;Dawnguard
GlobalVariable Property LCCA_InstDawnguard Auto
GlobalVariable Property LCCA_DawnguardCompatibility Auto

bool property DLC2Loaded Auto Hidden ;Hearthfires
GlobalVariable Property LCCA_InstHearthfires Auto
GlobalVariable Property LCCA_HearthfiresCompatibility Auto

bool property DLC3Loaded Auto Hidden ;Dragonborn
GlobalVariable Property LCCA_InstDragonborn Auto
GlobalVariable Property LCCA_DragonbornCompatibility Auto

bool property MOD01Loaded Auto Hidden ;Clothing & Clutter Fixes Vanilla & Legendary
GlobalVariable Property LCCA_InstCCF Auto
GlobalVariable Property LCCA_CCFCompatibility Auto

LCCA_DLC_CompatibilityScript Property LCCA_MCMMenuQuest Auto

; -------------------------------------------------------------------------------------

Event OnPlayerLoadGame()
Debug.Notification("You have loaded a saved game, LC's Crafting Addons is performing maintence via scripts.")
RunModCheck()
LCCA_MCMMenuQuest.SwitchItems_DLC()
Debug.Notification("LC's Crafting Addons maintence is now complete. Going to Active state inside the mod.")
GoToState("Active")
EndEvent

State Active
Event OnUpdate()
; Do nothing
EndEvent
EndState

Function RunModCheck()
Dawnguard_Check()
Hearthfires_Check()
Dragonborn_Check()
CCF_Check()
EndFunction

Function Dawnguard_Check()
If Game.GetModByName("Dawnguard.esm") != 255
LCCA_InstDawnguard.setValue(1)
LCCA_DawnguardCompatibility.setValue(1)
DLC1Loaded = true
Else
LCCA_InstDawnguard.setValue(0)
LCCA_DawnguardCompatibility.setValue(0)
DLC1Loaded = false
EndIf
EndFunction

Function Hearthfires_Check()
If Game.GetModByName("Hearthfires.esm") != 255
LCCA_InstHearthfires.setValue(1)
LCCA_HearthfiresCompatibility.setValue(1)
DLC2Loaded = true
Else
LCCA_InstHearthfires.setValue(0)
LCCA_HearthfiresCompatibility.setValue(0)
DLC2Loaded = false
EndIf
EndFunction

Function Dragonborn_Check()
If Game.GetModByName("Dragonborn.esm") != 255
LCCA_InstDragonborn.setValue(1)
LCCA_DragonbornCompatibility.setValue(1)
DLC3Loaded = true
Else
LCCA_InstDragonborn.setValue(0)
LCCA_DragonbornCompatibility.setValue(0)
DLC3Loaded = false
EndIf
EndFunction

Function CCF_Check()
If Game.GetModByName("Clothing & Clutter Fixes.esp") != 255
LCCA_InstCCF.setValue(1)
LCCA_CCFCompatibility.setValue(1)
Else
LCCA_InstCCF.setValue(0)
LCCA_CCFCompatibility.setValue(0)
EndIf
EndFunction

Dawnguard Compatibility



Scriptname LCCA_DG_CompatibilityScript extends Quest

FormList Property LCCA_DawnguardRecipes Auto
GlobalVariable Property LCCA_InstDawnguard Auto
Ingredient Property BearClaws Auto
Ingredient Property BoneMeal Auto
Ingredient Property Ectoplasm Auto
Ingredient Property FireSalts Auto
Ingredient Property FrostSalts Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property CraftingTanningRack Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHTanningRack_LCCA Auto
MiscObject Property Basket01 Auto
MiscObject Property Basket02 Auto
MiscObject Property Basket03 Auto
MiscObject Property Basket04 Auto
MiscObject Property DeerHide Auto
MiscObject Property SabreCatPelt Auto
Potion Property RestoreHealth01 Auto
Potion Property FirebrandWine Auto
Potion Property DLC1RedwaterDenSkooma Auto ; Redwater Skooma ; FirebrandWine
Ingredient Property DLC01MothWingAncestor Auto ; Ancestor Moth Wing ; BearClaws
Ingredient Property DLC01ChaurusHunterAntennae Auto ; Chaurus Hunter Antennae ; BoneMeal
Ingredient Property DLC01GlowPlant01Ingredient Auto ; Gleamblossom ; Ectoplasm
Ingredient Property DLC01PoisonBloom Auto ; Poison Bloom ; FireSalts
Ingredient Property DLC1MountainFlower01Yellow Auto ; Yellow Mountain Flower ; FrostSalts
MiscObject Property DLC1DeerHide Auto ; Vale Deer Hide ; DeerHide
MiscObject Property DLC1SabreCatHide Auto ; Vale Sabrecat Hide ; SabrecatPelt
MiscObject Property DLC1BoneHawkClaw Auto ; Bone Hawk Claw ; Basket01
MiscObject Property DLC1BoneHawkFeathers Auto ; Bone Hawk Feathers ; Basket02
MiscObject Property DLC1BoneHawkSkull Auto ; Bone Hawk Skull ; Basket03
MiscObject Property DLC1ShellbugChitin Auto ; Shellbug Chitin ; Basket04
Potion Property DLC1BloodPotion Auto ; Potion of Blood ; RestoreHealth01

LCCA_HF_CompatibilityScript Property LCCA_MCMMenuQuest Auto

; --------------------------------------------------------------------------------------------------------------------------------

Function DG_SwitchItems()
If LCCA_InstDawnguard.getValue() == 1
DLC1DeerHide = Game.GetFormFromFile(0x02011999, "Dawnguard.esm") As MiscObject ; Vale Deer Hide
DLC1SabreCatHide = Game.GetFormFromFile(0x0201199A, "Dawnguard.esm") As MiscObject ; Vale Sabrecat Hide
DLC1BoneHawkClaw = Game.GetFormFromFile(0x02011CF7, "Dawnguard.esm") As MiscObject ; Bone Hawk Claw
DLC1BoneHawkFeathers = Game.GetFormFromFile(0x02002994, "Dawnguard.esm") As MiscObject ; Bone Hawk Feathers
DLC1BoneHawkSkull = Game.GetFormFromFile(0x02002993, "Dawnguard.esm") As MiscObject ; Bone Hawk Skull
DLC1ShellbugChitin = Game.GetFormFromFile(0x020195AA, "Dawnguard.esm") As MiscObject ; Shellbug Chitin
DLC01MothWingAncestor = Game.GetFormFromFile(0x020059BA, "Dawnguard.esm") As Ingredient ; Ancestor Moth Wing
DLC01ChaurusHunterAntennae = Game.GetFormFromFile(0x020183B7, "Dawnguard.esm") As Ingredient ; Chaurus Hunter Antennae
DLC01GlowPlant01Ingredient = Game.GetFormFromFile(0x0200B097, "Dawnguard.esm") As Ingredient ; Gleamblossom
DLC01PoisonBloom = Game.GetFormFromFile(0x020185FB, "Dawnguard.esm") As Ingredient ; Poison Bloom
DLC1MountainFlower01Yellow = Game.GetFormFromFile(0x02002A78, "Dawnguard.esm") As Ingredient ; Yellow Mountain Flower
DLC1BloodPotion = Game.GetFormFromFile(0x02018EF3, "Dawnguard.esm") As Potion ; Potion of Blood
DLC1RedwaterDenSkooma = Game.GetFormFromFile(0x0201391D, "Dawnguard.esm") As Potion ; Redwater Skooma
DG_SwitchToAncestorMothWing()
DG_SwitchToChaurusHunterAntennae()
DG_SwitchToGleamblossom()
DG_SwitchToPoisonBloom()
DG_SwitchToYellowMountainFlower()
DG_SwitchToBoneHawkClaw()
DG_SwitchToBoneHawkFeathers()
DG_SwitchToBoneHawkSkull()
DG_SwitchToShellbugChitin()
DG_SwitchToValeDeerHide()
DG_SwitchToValeSabrecatHide()
DG_SwitchToBloodPotion()
DG_SwitchToRedwaterSkooma()
DG_SwitchCookpotWorkbenchOn()
DG_SwitchTanningRackWorkbenchOn()
DG_SwitchSmithingForgeWorkbenchOn()
EndIf
LCCA_MCMMenuQuest.HF_SwitchItems()
EndFunction

Function DG_SwitchToAncestorMothWing()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == BearClaws
CurrentRecipe.SetResult(DLC01MothWingAncestor)
EndIf
EndWhile
EndFunction

Function DG_SwitchToChaurusHunterAntennae()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == BoneMeal
CurrentRecipe.SetResult(DLC01ChaurusHunterAntennae)
EndIf
EndWhile
EndFunction

Function DG_SwitchToGleamblossom()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Ectoplasm
CurrentRecipe.SetResult(DLC01GlowPlant01Ingredient)
EndIf
EndWhile
EndFunction

Function DG_SwitchToPoisonBloom()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FireSalts
CurrentRecipe.SetResult(DLC01PoisonBloom)
EndIf
EndWhile
EndFunction

Function DG_SwitchToYellowMountainFlower()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FrostSalts
CurrentRecipe.SetResult(DLC1MountainFlower01Yellow)
EndIf
EndWhile
EndFunction

Function DG_SwitchToBoneHawkClaw()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Basket01
CurrentRecipe.SetResult(DLC1BoneHawkClaw)
EndIf
EndWhile
EndFunction

Function DG_SwitchToBoneHawkFeathers()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Basket02
CurrentRecipe.SetResult(DLC1BoneHawkFeathers)
EndIf
EndWhile
EndFunction

Function DG_SwitchToBoneHawkSkull()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Basket03
CurrentRecipe.SetResult(DLC1BoneHawkSkull)
EndIf
EndWhile
EndFunction

Function DG_SwitchToShellbugChitin()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Basket04
CurrentRecipe.SetResult(DLC1ShellbugChitin)
EndIf
EndWhile
EndFunction

Function DG_SwitchToValeDeerHide()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == DeerHide
CurrentRecipe.SetResult(DLC1DeerHide)
EndIf
EndWhile
EndFunction

Function DG_SwitchToValeSabrecatHide()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == SabrecatPelt
CurrentRecipe.SetResult(DLC1SabreCatHide)
EndIf
EndWhile
EndFunction

Function DG_SwitchToBloodPotion()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == RestoreHealth01
CurrentRecipe.SetResult(DLC1BloodPotion)
EndIf
EndWhile
EndFunction

Function DG_SwitchToRedwaterSkooma()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FirebrandWine
CurrentRecipe.SetResult(DLC1RedwaterDenSkooma)
EndIf
EndWhile
EndFunction


Function DG_SwitchCookpotWorkbenchOn()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHCookPot_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingCookpot)
EndIf
EndWhile
EndFunction

Function DG_SwitchTanningRackWorkbenchOn()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHTanningRack_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingTanningRack)
EndIf
EndWhile
EndFunction

Function DG_SwitchSmithingForgeWorkbenchOn()
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHForge_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingSmithingForge)
EndIf
EndWhile
EndFunction

Hearthfires Compatibility



Scriptname LCCA_HF_CompatibilityScript extends Quest

FormList Property LCCA_HearthfiresRecipes Auto
GlobalVariable Property LCCA_InstHearthfires Auto
Ingredient Property deathBell Auto
Ingredient Property Lavender Auto
Ingredient Property Snowberry Auto
Ingredient Property Taproot Auto
Ingredient Property VoidSalts Auto
Ingredient Property Wheat Auto
Keyword Property BYOHCraftingOven Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmelter Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHCraftingOven_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHSmelter_LCCA Auto
MiscObject Property ClothesIron Auto
MiscObject Property GemAmethyst Auto
MiscObject Property GemDiamond Auto
MiscObject Property GemEmerald Auto
MiscObject Property GemGarnet Auto
MiscObject Property GemRuby Auto
MiscObject Property GemSapphire Auto
MiscObject Property Kettle01 Auto
MiscObject Property Lantern01 Auto
MiscObject Property Lute Auto
Potion Property FoodBeefCooked Auto
Potion Property FoodCarrot Auto
Potion Property FoodChickenCooked Auto
Potion Property FoodGoatMeatCooked Auto
Potion Property FoodHorkerMeatCooked Auto
Potion Property FoodMead Auto
Potion Property FoodPheasantCooked Auto
Potion Property FoodRabbit Auto
Potion Property FoodRabbitCooked Auto
Potion Property FoodSalmonCooked Auto
Potion Property FoodSlaughterfishCooked Auto
Potion Property FoodVenisonCooked Auto
Potion Property RestoreHealth02 Auto
Potion Property RestoreHealth03 Auto
Potion Property RestoreHealth04 Auto
Potion Property BYOHFoodAppleDumpling01 Auto ; Apple Dumplings ; FoodBeefCooked
Potion Property BYOHFoodBraidedBread01 Auto ; Braided Bread ; FoodGoatMeatCooked
Potion Property BYOHFoodChickenDumpling01 Auto ; Chicken Dumplings ; FoodHorkerMeatCooked
Potion Property BYOHFoodClamChowder Auto ; Clam Chowder ; deathBell
Potion Property BYOHFoodGarlicBread01 Auto ; Garlic Bread ; FoodMead
Potion Property BYOHFoodJazbayCrostata Auto ; Jazbay Crostata ; FoodPheasantCooked
Potion Property BYOHFoodJuniperBerryCrostata Auto ; Juniperberry Crostata ; VoidSalts
Potion Property BYOHFoodLavenderDumpling01 Auto ; Lavender Dumplings ; FoodRabbitCooked
Potion Property BYOHFoodPotatoBread01A Auto ; Potato Bread ; FoodSlaughterfishCooked
Potion Property FoodPotatoSoup Auto ; Potato Soup ; FoodVenisonCooked
Potion Property BYOHFoodSnowberryCrostata Auto ; Snowberry Crostata ; FoodCarrot
Potion Property BYOHFoodMudcrabLegsCooked Auto ; Steamed Mudcrab Legs ; FoodRabbit
Potion Property BYOHFoodWineBottle04 Auto ; Argonian Bloodwine ; FoodChickenCooked
Potion Property BYOHFoodWineBottle03 Auto ; Surilie Brothers Wine ; Snowberry
Potion Property BYOHFoodMudcrabLegs Auto ; Mudcrab Meat ; Taproot
Potion Property FoodAppleCabbageStew Auto ; Apple Cabbage Stew NM
Potion Property FoodBeefStew Auto ; Beef Stew NM
Potion Property FoodCabbagePotatoSoup Auto ; Cabbage Potato Soup NM
Potion Property FoodElsweyrFondue Auto ; Elsweyr Fondue NM
Potion Property FoodHorkerStew Auto ; Horker Stew NM
;Potion Property BYOHFoodSalmonCooked02 Auto ; Salmon Steak NM ; FoodSalmonCooked
Potion Property FoodTomatoSoup Auto ; Tomato Soup NM
Potion Property FoodVegetableSoup Auto ; Vegetable Soup NM
Potion Property FoodVenisonStew Auto ; Venison Stew NM
Ingredient Property BYOHHawkEgg01 Auto ; Hawk Egg ; Wheat
Ingredient Property BYOHSalmonRoe01 Auto ; Salmon Roe ; Lavender
Potion Property BYOHFoodButter Auto ; Butter ; RestoreHealth02
Potion Property BYOHFoodFlour Auto ; Flour ; RestoreHealth03
Potion Property BYOHFoodMilk Auto ; Milk ; RestoreHealth04
MiscObject Property BYOHMaterialClay Auto ; Clay ; GemAmethyst
MiscObject Property BYOHMaterialGlass Auto ; Glass ; GemDiamond
MiscObject Property BYOHMaterialHornGoat Auto ; Goat Horns ; GemEmerald
MiscObject Property BYOHMaterialHinge Auto ; Hinge ; GemGarnet
MiscObject Property BYOHMaterialFittingsIron Auto ; Iron Fittings ; GemRuby
MiscObject Property BYOHMaterialLock Auto ; Lock ; GemSapphire
MiscObject Property BYOHMaterialNails Auto ; Nails ; ClothesIron
MiscObject Property BYOHMaterialStoneBlock Auto ; Quarried Stone ; Lute
MiscObject Property BYOHMaterialLog Auto ; Sawn Log ; Kettle01
MiscObject Property BYOHMaterialStraw Auto ; Straw ; Lantern01

LCCA_DB_CompatibilityScript Property LCCA_MCMMenuQuest Auto

; ------------------------------------------------------------------------------------------------------------------------------------

Function HF_SwitchItems()
If LCCA_InstHearthfires.getValue() == 1
FoodAppleCabbageStew = Game.GetFormFromFile(0x000EBA01, "Hearthfires.esm") As Potion ; Apple Cabbage Stew (New Mesh)
BYOHFoodAppleDumpling01 = Game.GetFormFromFile(0x03003533, "Hearthfires.esm") As Potion ; Apple Dumplings
BYOHFoodWineBottle04 = Game.GetFormFromFile(0x03003535, "Hearthfires.esm") As Potion ; Argonian Bloodwine
FoodBeefStew = Game.GetFormFromFile(0x000F4314, "Hearthfires.esm") As Potion ; Beef Stew (New Mesh)
BYOHFoodBraidedBread01 = Game.GetFormFromFile(0x030009DB, "Hearthfires.esm") As Potion ; Braided Bread
BYOHFoodButter = Game.GetFormFromFile(0x0300353C, "Hearthfires.esm") As Potion ; Butter
FoodCabbagePotatoSoup = Game.GetFormFromFile(0x000F431B, "Hearthfires.esm") As Potion ; Cabbage Potato Soup (New Mesh)
BYOHFoodChickenDumpling01 = Game.GetFormFromFile(0x030117FF, "Hearthfires.esm") As Potion ; Chicken Dumplings
BYOHFoodClamChowder = Game.GetFormFromFile(0x0300353E, "Hearthfires.esm") As Potion ; Clam Chowder
FoodElsweyrFondue = Game.GetFormFromFile(0x000F4320, "Hearthfires.esm") As Potion ; Elsweyr Fondue (New Mesh)
BYOHFoodFlour = Game.GetFormFromFile(0x03003538, "Hearthfires.esm") As Potion ; Flour
BYOHFoodGarlicBread01 = Game.GetFormFromFile(0x030009DC, "Hearthfires.esm") As Potion ; Garlic Bread
FoodHorkerStew = Game.GetFormFromFile(0x000F4315, "Hearthfires.esm") As Potion ; Horker Stew (New Mesh)
BYOHFoodJazbayCrostata = Game.GetFormFromFile(0x0300353A, "Hearthfires.esm") As Potion ; Jazbay Crostata
BYOHFoodJuniperBerryCrostata = Game.GetFormFromFile(0x03003539, "Hearthfires.esm") As Potion ; Juniper Berry Crostata
BYOHFoodLavenderDumpling01 = Game.GetFormFromFile(0x03011801, "Hearthfires.esm") As Potion ; Lavender Dumplings
BYOHFoodMilk = Game.GetFormFromFile(0x03003534, "Hearthfires.esm") As Potion ; Milk
BYOHFoodMudcrabLegs = Game.GetFormFromFile(0x03003540, "Hearthfires.esm") As Potion ; Mudcrab Legs
BYOHFoodPotatoBread01A = Game.GetFormFromFile(0x03003537, "Hearthfires.esm") As Potion ; Potato Bread
FoodPotatoSoup = Game.GetFormFromFile(0x0300353D, "Hearthfires.esm") As Potion ; Potato Soup
BYOHFoodSnowberryCrostata = Game.GetFormFromFile(0x0300353B, "Hearthfires.esm") As Potion ; Snowberry Crostata
BYOHFoodMudcrabLegsCooked = Game.GetFormFromFile(0x0300353F, "Hearthfires.esm") As Potion ; Steamed Mudcrab Legs
BYOHFoodWineBottle03 = Game.GetFormFromFile(0x03003536, "Hearthfires.esm") As Potion ; Surilie Brothers Wine
FoodTomatoSoup = Game.GetFormFromFile(0x000F431C, "Hearthfires.esm") As Potion ; Tomato Soup (New Mesh)
FoodVegetableSoup = Game.GetFormFromFile(0x000F431E, "Hearthfires.esm") As Potion ; Vegetable Soup (New Mesh)
FoodVenisonStew = Game.GetFormFromFile(0x000F431D, "Hearthfires.esm") As Potion ; Venison Stew (New Mesh)
BYOHHawkEgg01 = Game.GetFormFromFile(0x0300F1CC, "Hearthfires.esm") As Ingredient ; Hawk Egg
BYOHSalmonRoe01 = Game.GetFormFromFile(0x03003545, "Hearthfires.esm") As Ingredient ; Salmon Roe
BYOHMaterialClay = Game.GetFormFromFile(0x03003043, "Hearthfires.esm") As MiscObject ; Clay
BYOHMaterialGlass = Game.GetFormFromFile(0x03005A69, "Hearthfires.esm") As MiscObject ; Glass
BYOHMaterialHornGoat = Game.GetFormFromFile(0x0300303F, "Hearthfires.esm") As MiscObject ; Goat Horns
BYOHMaterialHinge = Game.GetFormFromFile(0x03003011, "Hearthfires.esm") As MiscObject ; Hinge
BYOHMaterialFittingsIron = Game.GetFormFromFile(0x03003035, "Hearthfires.esm") As MiscObject ; Iron Fittings
BYOHMaterialLock = Game.GetFormFromFile(0x03003012, "Hearthfires.esm") As MiscObject ; Lock
BYOHMaterialNails = Game.GetFormFromFile(0x0300300F, "Hearthfires.esm") As MiscObject ; Nails
BYOHMaterialStoneBlock = Game.GetFormFromFile(0x0300306C, "Hearthfires.esm") As MiscObject ; Quarried Stone
BYOHMaterialLog = Game.GetFormFromFile(0x0300300E, "Hearthfires.esm") As MiscObject ; Sawn Log
BYOHMaterialStraw = Game.GetFormFromFile(0x03005A68, "Hearthfires.esm") As MiscObject ; Straw
BYOHCraftingOven = Game.GetFormFromFile(0x030117F7, "Hearthfires.esm") As Keyword ; Crafting Oven
HF_SwitchToAppleDumpling()
HF_SwitchToBraidedBread()
HF_SwitchToChickenDumplings()
HF_SwitchToGarlicBread()
HF_SwitchToJazbayCrostata()
HF_SwitchToJuniperBerryCrostata()
HF_SwitchToMudcrabLegs()
HF_SwitchToLavenderDumplings()
HF_SwitchToPotatoBread()
HF_SwitchToSnowberryCrostata()
HF_SwitchToArgonianBloodWine()
HF_SwitchToClamChowder()
HF_SwitchToPotatoSoup()
HF_SwitchToSteamedMudcrab()
HF_SwitchToSurilieBrothers()
HF_SwitchToButter()
HF_SwitchToFlour()
HF_SwitchToMilk()
HF_SwitchToHawkEgg()
HF_SwitchToSalmonRoe()
HF_SwitchToClay()
HF_SwitchToGlass()
HF_SwitchToGoatHorn()
HF_SwitchToHinge()
HF_SwitchToIronFitting()
HF_SwitchToLock()
HF_SwitchToNail()
HF_SwitchToQuarriedStone()
HF_SwitchToSawnLog()
HF_SwitchToStraw()
HF_SwitchOvenWorkbenchOn()
HF_SwitchCookpotWorkbenchOn()
HF_SwitchForgeWorkbenchOn()
HF_SwitchSmelterWorkbenchOn()
EndIf
LCCA_MCMMenuQuest.DB_SwitchItems()
EndFunction

Function HF_SwitchToAppleDumpling()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodBeefCooked
CurrentRecipe.SetResult(BYOHFoodAppleDumpling01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToBraidedBread()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodGoatMeatCooked
CurrentRecipe.SetResult(BYOHFoodBraidedBread01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToChickenDumplings()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodHorkerMeatCooked
CurrentRecipe.SetResult(BYOHFoodChickenDumpling01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToGarlicBread()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodMead
CurrentRecipe.SetResult(BYOHFoodGarlicBread01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToJazbayCrostata()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodPheasantCooked
CurrentRecipe.SetResult(BYOHFoodJazbayCrostata)
EndIf
EndWhile
EndFunction

Function HF_SwitchToJuniperBerryCrostata()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == VoidSalts
CurrentRecipe.SetResult(BYOHFoodJuniperBerryCrostata)
EndIf
EndWhile
EndFunction

Function HF_SwitchToMudcrabLegs()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Taproot
CurrentRecipe.SetResult(BYOHFoodMudcrabLegs)
EndIf
EndWhile
EndFunction

Function HF_SwitchToLavenderDumplings()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodRabbitCooked
CurrentRecipe.SetResult(BYOHFoodLavenderDumpling01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToPotatoBread()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodSlaughterfishCooked
CurrentRecipe.SetResult(BYOHFoodPotatoBread01A)
EndIf
EndWhile
EndFunction

Function HF_SwitchToSnowberryCrostata()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodCarrot
CurrentRecipe.SetResult(BYOHFoodSnowberryCrostata)
EndIf
EndWhile
EndFunction

Function HF_SwitchToArgonianBloodWine()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodChickenCooked
CurrentRecipe.SetResult(BYOHFoodWineBottle04)
EndIf
EndWhile
EndFunction

Function HF_SwitchToClamChowder()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == deathBell
CurrentRecipe.SetResult(BYOHFoodClamChowder)
EndIf
EndWhile
EndFunction

Function HF_SwitchToPotatoSoup()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodVenisonCooked
CurrentRecipe.SetResult(FoodPotatoSoup)
EndIf
EndWhile

EndFunction

Function HF_SwitchToSteamedMudcrab()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodRabbit
CurrentRecipe.SetResult(BYOHFoodMudcrabLegsCooked)
EndIf
EndWhile
EndFunction

Function HF_SwitchToSurilieBrothers()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Snowberry
CurrentRecipe.SetResult(BYOHFoodWineBottle03)
EndIf
EndWhile
EndFunction

Function HF_SwitchToButter()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == RestoreHealth02
CurrentRecipe.SetResult(BYOHFoodButter)
EndIf
EndWhile
EndFunction

Function HF_SwitchToFlour()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == RestoreHealth03
CurrentRecipe.SetResult(BYOHFoodFlour)
EndIf
EndWhile
EndFunction

Function HF_SwitchToMilk()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == RestoreHealth04
CurrentRecipe.SetResult(BYOHFoodMilk)
EndIf
EndWhile
EndFunction

Function HF_SwitchToHawkEgg()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Wheat
CurrentRecipe.SetResult(BYOHHawkEgg01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToSalmonRoe()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Lavender
CurrentRecipe.SetResult(BYOHSalmonRoe01)
EndIf
EndWhile
EndFunction

Function HF_SwitchToClay()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemAmethyst
CurrentRecipe.SetResult(BYOHMaterialClay)
EndIf
EndWhile
EndFunction

Function HF_SwitchToGlass()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemDiamond
CurrentRecipe.SetResult(BYOHMaterialGlass)
EndIf
EndWhile
EndFunction

Function HF_SwitchToGoatHorn()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemEmerald
CurrentRecipe.SetResult(BYOHMaterialHornGoat)
EndIf
EndWhile
EndFunction

Function HF_SwitchToHinge()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemGarnet
CurrentRecipe.SetResult(BYOHMaterialHinge)
EndIf
EndWhile
EndFunction

Function HF_SwitchToIronFitting()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemRuby
CurrentRecipe.SetResult(BYOHMaterialFittingsIron)
EndIf
EndWhile
EndFunction

Function HF_SwitchToLock()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == GemSapphire
CurrentRecipe.SetResult(BYOHMaterialLock)
EndIf
EndWhile
EndFunction

Function HF_SwitchToNail()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == ClothesIron
CurrentRecipe.SetResult(BYOHMaterialNails)
EndIf
EndWhile
EndFunction

Function HF_SwitchToQuarriedStone()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Lute
CurrentRecipe.SetResult(BYOHMaterialStoneBlock)
EndIf
EndWhile
EndFunction

Function HF_SwitchToSawnLog()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Kettle01
CurrentRecipe.SetResult(BYOHMaterialLog)
EndIf
EndWhile
EndFunction

Function HF_SwitchToStraw()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Lantern01
CurrentRecipe.SetResult(BYOHMaterialStraw)
EndIf
EndWhile
EndFunction

Function HF_SwitchOvenWorkbenchOn()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHCraftingOven_LCCA
CurrentRecipe.setWorkbenchKeyword(BYOHCraftingOven)
EndIf
EndWhile
EndFunction

Function HF_SwitchCookpotWorkbenchOn()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHCookPot_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingCookpot)
EndIf
EndWhile
EndFunction

Function HF_SwitchForgeWorkbenchOn()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHForge_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingSmithingForge)
EndIf
EndWhile
EndFunction

Function HF_SwitchSmelterWorkbenchOn()
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHSmelter_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingSmelter)
EndIf
EndWhile
EndFunction

Dragonborn Compatibility



Scriptname LCCA_DB_CompatibilityScript extends Quest

FormList Property LCCA_DragonbornRecipes Auto
GlobalVariable Property LCCA_InstDragonborn Auto
Ingredient Property BirdEgg01 Auto
Ingredient Property BirdEgg02 Auto
Ingredient Property BirdEgg03 Auto
Ingredient Property ElvesEar Auto
Ingredient Property Garlic Auto
Ingredient Property Mushroom01 Auto
Ingredient Property Mushroom02 Auto
Ingredient Property Mushroom03 Auto
Ingredient Property Mushroom04 Auto
Ingredient Property Mushroom05 Auto
Ingredient Property Mushroom06 Auto
Ingredient Property SaltPile Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmelter Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property CraftingTanningRack Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHSmelter_LCCA Auto
Keyword Property WBPHTanningRack_LCCA Auto
MiscObject Property Charcoal Auto
MiscObject Property LeatherStrips Auto
MiscObject Property WolfPelt Auto
Potion Property Ale Auto
Potion Property FoodApple Auto
Potion Property FoodBeef Auto
Potion Property FoodChicken Auto
Potion Property FoodDogMeat Auto
Potion Property FoodGourd Auto
Potion Property FoodHoney Auto
Potion Property FoodLeek Auto
Potion Property FoodTomato Auto
Potion Property FoodVenison Auto
Ingredient Property DLC2AshCreepCluster Auto ; Ash Creep Cluster ; Mushroom01
Ingredient Property DLC2AshHopperJelly Auto ; Ash Hopper Jelly ; Mushroom02
Ingredient Property DLC2BoarTusk Auto ; Boar Tusk ; Mushroom04
Ingredient Property DLC2BurntSprigganWood Auto ; Burnt Spriggan Wood ; Mushroom05
Ingredient Property DLC2GhoulAsh Auto ; Spawn Ash ; BirdEgg02
Ingredient Property DLC2HangingMoss Auto ; Emperor Parasol Moss ; Mushroom06
Ingredient Property DLC2NetchJelly Auto ; Netch Jelly ; SaltPile
Ingredient Property DLC2Scathecraw01 Auto ; Scathecraw ; BirdEgg01
Ingredient Property DLC2SpikyGrassAsh01 Auto ; Ashen Grass Pod ; Mushroom03
Ingredient Property DLC2TernFeathers Auto ; Felsaad Tern Feathers ; Garlic
Ingredient Property DLC2TramaRoot01 Auto ; Trama Root ; BirdEgg03
MiscObject Property DLC2ChitinPlate Auto ; Chitin Plate ; WolfPelt
MiscObject Property DLC2NetchLeather Auto ; Netch Leather ; LeatherStrips
MiscObject Property DLC2OreStalhrim Auto ; Stalhrim ; Charcoal
Potion Property DLC2Flin Auto ; Flin ; FoodVenison
Potion Property DLC2FoodAshfireMead Auto ; Ashfire Mead ; Ale
Potion Property DLC2FoodAshYam Auto ; Ash Yam ; FoodHoney
Potion Property DLC2FoodBoarMeat Auto ; Boar Meat ; FoodTomato
Potion Property DLC2FoodBoarMeatCooked Auto ; Cooked Boar Meat ; FoodBeef
Potion Property DLC2FoodHorkerAshYamStew Auto ; Horker Ash Yam Stew ; FoodLeek
Potion Property DLC2Matze Auto ; Matze ; FoodDogMeat
Potion Property DLC2Shein Auto ; Shein ; FoodChicken
Potion Property DLC2Sujamma Auto ; Sujamma ; FoodGourd
Potion Property FoodCabbageSoup Auto ; Cabbage Soup NM

; ---------------------------------------------------------------------------------------------------------------------

Function EnableDB()
DB_SwitchItems()
EndFunction

Function DB_SwitchItems()
If LCCA_InstDragonborn.getValue() == 1
DLC2FoodAshYam = Game.GetFormFromFile(0x040206E7, "Dragonborn.esm") As Potion ; Ash Yam
DLC2FoodAshfireMead = Game.GetFormFromFile(0x0403572F, "Dragonborn.esm") As Potion ; Ashfire Mead
DLC2FoodBoarMeat = Game.GetFormFromFile(0x0403BD14, "Dragonborn.esm") As Potion ; Boar Meat
FoodCabbageSoup = Game.GetFormFromFile(0x000EBA02, "Dragonborn.esm") As Potion ; Cabbage Soup (New Mesh)
DLC2FoodBoarMeatCooked = Game.GetFormFromFile(0x0403CF72, "Dragonborn.esm") As Potion ; Cooked Boar Meat
DLC2Flin = Game.GetFormFromFile(0x040207E5, "Dragonborn.esm") As Potion ; Flin
DLC2FoodHorkerAshYamStew = Game.GetFormFromFile(0x0403CD5B, "Dragonborn.esm") As Potion ; Horker Ash Yam Stew
DLC2Matze = Game.GetFormFromFile(0x040248CE, "Dragonborn.esm") As Potion ; Matze
DLC2Shein = Game.GetFormFromFile(0x040248CC, "Dragonborn.esm") As Potion ; Shein
DLC2Sujamma = Game.GetFormFromFile(0x040207E6, "Dragonborn.esm") As Potion ; Sujamma
DLC2AshCreepCluster = Game.GetFormFromFile(0x0401CD74, "Dragonborn.esm") As Ingredient ; Ash Creep Cluster
DLC2AshHopperJelly = Game.GetFormFromFile(0x0401CD71, "Dragonborn.esm") As Ingredient ; Ash Hopper Jelly
DLC2SpikyGrassAsh01 = Game.GetFormFromFile(0x04016E26, "Dragonborn.esm") As Ingredient ; Ashen Grass Pod
DLC2BoarTusk = Game.GetFormFromFile(0x0401CD6F, "Dragonborn.esm") As Ingredient ; Boar Tusk
DLC2BurntSprigganWood = Game.GetFormFromFile(0x0401CD6E, "Dragonborn.esm") As Ingredient ; Burnt Spriggan Wood
DLC2HangingMoss = Game.GetFormFromFile(0x0401FF75, "Dragonborn.esm") As Ingredient ; Emperor Parasol Moss
DLC2TernFeathers = Game.GetFormFromFile(0x0403CD8E, "Dragonborn.esm") As Ingredient ; Felsaad Tern Feathers
DLC2NetchJelly = Game.GetFormFromFile(0x0401CD72, "Dragonborn.esm") As Ingredient ; Netch Jelly
DLC2Scathecraw01 = Game.GetFormFromFile(0x04017E97, "Dragonborn.esm") As Ingredient ; Scathecraw
DLC2GhoulAsh = Game.GetFormFromFile(0x0401CD6D, "Dragonborn.esm") As Ingredient ; Spawn Ash
DLC2TramaRoot01 = Game.GetFormFromFile(0x04017008, "Dragonborn.esm") As Ingredient ; Trama Root
DLC2NetchLeather = Game.GetFormFromFile(0x0401CD7C, "Dragonborn.esm") As MiscObject ; Netch Leather
DLC2ChitinPlate = Game.GetFormFromFile(0x0402B04E, "Dragonborn.esm") As MiscObject ; Chitin Plate
DLC2OreStalhrim = Game.GetFormFromFile(0x0402B06B, "Dragonborn.esm") As MiscObject ; Stalhrim Ore
DB_SwitchToAshfireMead()
DB_SwitchToCookedBoarMeat()
DB_SwitchToFlin()
DB_SwitchToHorkerAshYamStew()
DB_SwitchToMatze()
DB_SwitchToShein()
DB_SwitchToSujamma()
DB_SwitchToAshCreepCluster()
DB_SwitchToAshHopperJelly()
DB_SwitchToAshenGrassPod()
DB_SwitchToBoarTusk()
DB_SwitchToBurntSprigganWood()
DB_SwitchToEmperorParasolMoss()
DB_SwitchToFelsaadTernFeathers()
DB_SwitchToNetchJelly()
DB_SwitchToScathecraw()
DB_SwitchToSpawnAsh()
DB_SwitchToTramaRoot()
DB_SwitchToBoarMeat()
DB_SwitchToAshYam()
DB_SwitchToNetchLeather()
DB_SwitchToChitinPlate()
DB_SwitchToStalhrim()
DB_SwitchCookpotWorkbenchOn()
DB_SwitchSmelterWorkbenchOn()
DB_SwitchForgeWorkbenchOn()
DB_TanningWorkbenchOn()
EndIf
EndFunction

Function DB_SwitchToAshfireMead()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Ale
CurrentRecipe.SetResult(DLC2FoodAshfireMead)
EndIf
EndWhile
EndFunction

Function DB_SwitchToCookedBoarMeat()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodBeef
CurrentRecipe.SetResult(DLC2FoodBoarMeatCooked)
EndIf
EndWhile
EndFunction

Function DB_SwitchToFlin()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodVenison
CurrentRecipe.SetResult(DLC2Flin)
EndIf
EndWhile
EndFunction

Function DB_SwitchToHorkerAshYamStew()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodLeek
CurrentRecipe.SetResult(DLC2FoodHorkerAshYamStew)
EndIf
EndWhile
EndFunction

Function DB_SwitchToMatze()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodDogMeat
CurrentRecipe.SetResult(DLC2Matze)
EndIf
EndWhile
EndFunction

Function DB_SwitchToShein()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodChicken
CurrentRecipe.SetResult(DLC2Shein)
EndIf
EndWhile
EndFunction

Function DB_SwitchToSujamma()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodGourd
CurrentRecipe.SetResult(DLC2Sujamma)
EndIf
EndWhile
EndFunction

Function DB_SwitchToAshCreepCluster()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom01
CurrentRecipe.SetResult(DLC2AshCreepCluster)
EndIf
EndWhile

EndFunction

Function DB_SwitchToAshHopperJelly()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom02
CurrentRecipe.SetResult(DLC2AshHopperJelly)
EndIf
EndWhile
EndFunction

Function DB_SwitchToAshenGrassPod()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom03
CurrentRecipe.SetResult(DLC2SpikyGrassAsh01)
EndIf
EndWhile
EndFunction

Function DB_SwitchToBoarTusk()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom04
CurrentRecipe.SetResult(DLC2BoarTusk)
EndIf
EndWhile
EndFunction

Function DB_SwitchToBurntSprigganWood()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom05
CurrentRecipe.SetResult(DLC2BurntSprigganWood)
EndIf
EndWhile
EndFunction

Function DB_SwitchToEmperorParasolMoss()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Mushroom06
CurrentRecipe.SetResult(DLC2HangingMoss)
EndIf
EndWhile
EndFunction

Function DB_SwitchToFelsaadTernFeathers()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Garlic
CurrentRecipe.SetResult(DLC2TernFeathers)
EndIf
EndWhile
EndFunction

Function DB_SwitchToNetchJelly()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == SaltPile
CurrentRecipe.SetResult(DLC2NetchJelly)
EndIf
EndWhile
EndFunction

Function DB_SwitchToScathecraw()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == BirdEgg01
CurrentRecipe.SetResult(DLC2Scathecraw01)
EndIf
EndWhile
EndFunction

Function DB_SwitchToSpawnAsh()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == BirdEgg02
CurrentRecipe.SetResult(DLC2GhoulAsh)
EndIf
EndWhile
EndFunction

Function DB_SwitchToTramaRoot()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == BirdEgg03
CurrentRecipe.SetResult(DLC2TramaRoot01)
EndIf
EndWhile
EndFunction

Function DB_SwitchToBoarMeat()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodTomato
CurrentRecipe.SetResult(DLC2FoodBoarMeat)
EndIf
EndWhile
EndFunction

Function DB_SwitchToAshYam()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == FoodHoney
CurrentRecipe.SetResult(DLC2FoodAshYam)
EndIf
EndWhile
EndFunction

Function DB_SwitchToNetchLeather()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == LeatherStrips
CurrentRecipe.SetResult(DLC2NetchLeather)
EndIf
EndWhile
EndFunction

Function DB_SwitchToChitinPlate()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == WolfPelt
CurrentRecipe.SetResult(DLC2ChitinPlate)
EndIf
EndWhile
EndFunction

Function DB_SwitchToStalhrim()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetResult() == Charcoal
CurrentRecipe.SetResult(DLC2OreStalhrim)
EndIf
EndWhile
EndFunction

Function DB_SwitchCookpotWorkbenchOn()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHCookPot_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingCookpot)
EndIf
EndWhile
EndFunction


Function DB_SwitchSmelterWorkbenchOn()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHSmelter_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingSmelter)
EndIf
EndWhile
EndFunction

Function DB_SwitchForgeWorkbenchOn()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHForge_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingSmithingForge)
EndIf
EndWhile
EndFunction

Function DB_TanningWorkbenchOn()
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == WBPHTanningRack_LCCA
CurrentRecipe.setWorkbenchKeyword(CraftingTanningRack)
EndIf
EndWhile
EndFunction

MCM Script



Scriptname LCCA_MCMScript extends SKI_ConfigBase

; PRIVATE VARIABLES ------------------------------------------------------------------------------------
; --- Version 1 ---
; OIDs
; Text (t: Text)
Int tEnable
Int tDisable
Int tUninstall
; Slider
; Toggles (d: DLC, b: Toggle, p: Potion, u: Upgrades)
Int dDawnguard
Int dDragonborn
Int dHearthfires
Int bAlchemy
Int bAlternative
Int bAnimal
Int bCcf
Int bCooking
Int bCostless
Int bEmpty
Int bFilled
Int bFlawed
Int bFlawless
Int bFood
Int bIngot
Int bLeather
Int bMaterial
Int bOre
Int bWine
Int pBuff
Int pCure
Int pPoison
Int pRegen
Int pResist
Int pRestore
Int pSkill
Int pThief
Int pWeakness
Int uBuff
Int uPoison
Int uRegen
Int uResist
Int uRestore
Int uSkill
Int uThief
Int uWeakness

; PROPERTIES -------------------------------------------------------------------------------------------
GlobalVariable Property LCCA_CCFCompatibility Auto ; Activates Clothing & Clutter Fixes Compatibility
GlobalVariable Property LCCA_DawnguardCompatibility Auto ; Toggle and Linked to Dawnguard Recipes
GlobalVariable Property LCCA_DragonbornCompatibility Auto ; Toggle and Linked to Dragonborn Recipes
GlobalVariable Property LCCA_HearthfiresCompatibility Auto ; Toggle and Linked to Hearthfires Recipes
GlobalVariable Property LCCA_InstCCF Auto ; MCM Script used only on startup, if not found this Clothing & Clutter Fixes toggle option is diabled
GlobalVariable Property LCCA_InstDawnguard Auto ; MCM Script used only on startup, if not found this Dawnguard toggle option is diabled
GlobalVariable Property LCCA_InstDragonborn Auto ; MCM Script used only on startup, if not found this Dragonborn toggle option is diabled
GlobalVariable Property LCCA_InstHearthfires Auto ; MCM Script used only on startup, if not found this Hearthfires toggle option is diabled
GlobalVariable Property LCCA_OptionAlchemy Auto ; Activates Alchemy Ingredient Recipes at the Cookpot
GlobalVariable Property LCCA_OptionAnimal Auto ; Activates Animal Part Ingredient Recipes at the Cookpot
GlobalVariable Property LCCA_OptionBuff Auto ; Activates Buff Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionBuffUpgrade Auto ; Activates Buff Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionCooking Auto ; Activates Cooking Recipes at the Cookpot
GlobalVariable Property LCCA_OptionCure Auto ; Activates Cure Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionEmpty Auto ; Activates Empty Soul Gems at the Smelter
GlobalVariable Property LCCA_OptionFilled Auto ; Activates Filled Soul Gems at the Soul
GlobalVariable Property LCCA_OptionFlawed Auto ; Activates Flawed Gemstones Recipes at the Forge.
GlobalVariable Property LCCA_OptionFlawless Auto ; Activates Flawless Gemstones Recipes at the Forge.
GlobalVariable Property LCCA_OptionFood Auto ; Activates Food Recipes at the Cookpot & Crafting Oven (Requires Hearthfires)
GlobalVariable Property LCCA_OptionIngot Auto ; Activates Ingot Recipes at the Smelter
GlobalVariable Property LCCA_OptionLeather Auto ; Activates Leather Recipes at the Tanning Rack
GlobalVariable Property LCCA_OptionMaterial Auto ; Activates Material Recipes at the Smelter & Forge
GlobalVariable Property LCCA_OptionOre Auto ; Activates Ore Recipes at the Smelter
GlobalVariable Property LCCA_OptionPoison Auto ; Activates Poison Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionPoisonUpgrade Auto ; Activates Poison Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionRegen Auto ; Activates Regen Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionRegenUpgrade Auto ; Activates Regen Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionResist Auto ; Activates Resist Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionResistUpgrade Auto ; Activates Resist Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionRestore Auto ; Activates Retorative Potion Recipes at the cookpot
GlobalVariable Property LCCA_OptionRestoreUpgrade Auto ; Activates Restorative Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionSkill Auto ; Activates Skill Enhancing Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionSkillUpgrade Auto ; Activates Skill Enhancing Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionThief Auto ; Activates Thieves Guild Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionThiefUpgrade Auto ; Activates Thieves Guild Potion Upgrades at the Cookpot
GlobalVariable Property LCCA_OptionWeakness Auto ; Activates Weakness Poison Potion Recipes at the Cookpot
GlobalVariable Property LCCA_OptionWeaknessUpgrade Auto ; Activates Weakness Poison Potion Upgrades at the Cookpot - Requires 2 same potions to upgrade to higher tier
GlobalVariable Property LCCA_OptionWine Auto ; Activates Drink Recipes at the Cookpot
GlobalVariable Property LCCA_TextEnable Auto ; Controls the quick enable text toggle
GlobalVariable Property LCCA_TypeAlternative Auto ; Controls & Activates Gold Cost Recipes
GlobalVariable Property LCCA_TypeCostless Auto ; Controls & Activates no Ingredient Cost Recipes
Message Property UninstallLCCAMessage Auto
LCCA_CompatibilityScript Property LCCA_MCMMenuQuest Auto

; SCRIPT VERSION ---------------------------------------------------------------------------------------
; History
; 1 - Initial Release

int function GetVersion()
return 1 ; New Script Version
endFunction

Event OnVersionUpdate(int a_version)
If (a_version > 1) ; Called when a version update of this script has been detected
Debug.Trace("LC's Crafting Addons is updating script version " + a_version)
OnConfigInit()
EndIf
EndEvent

; INITIALIZATION ---------------------------------------------------------------------------------------
Event OnConfigInit()
Pages = New String[3]
Pages[0] = "Mod Settings"
Pages[1] = "Recipe Options"
Pages[2] = "Uninstall"
EndEvent

; Splash Page-------------------------------------------------------------------------------------------
Event OnPageReset(string page)
If (page == "")
LoadCustomContent("LadyCrystynasCraftingAddons/LCCATitle.dds", 52, 100)
return
Else
UnloadCustomContent()
EndIf

; Mod Settings Page-------------------------------------------------------------------------------------
If (page == "Mod Settings")
SetCursorPosition(0)
SetCursorFillMode(TOP_TO_BOTTOM)
AddHeaderOption("Detected Compatibility")
If LCCA_InstCCF.getValue() == 1
bCcf = AddToggleOption("Clothing & Clutter Fixes", LCCA_CCFCompatibility.getValue(), OPTION_FLAG_NONE)
Else
bCcf = AddToggleOption("Clothing & Clutter Fixes", LCCA_CCFCompatibility.getValue(), OPTION_FLAG_DISABLED)
EndIf
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
AddHeaderOption("Detected DLC")
If LCCA_InstDawnguard.getValue() == 1
dDawnguard = AddToggleOption("Dawnguard", LCCA_DawnguardCompatibility.getValue(), OPTION_FLAG_NONE)
Else
dDawnguard = AddToggleOption("Dawnguard", LCCA_DawnguardCompatibility.getValue(), OPTION_FLAG_DISABLED)
EndIf
If LCCA_InstHearthfires.getValue() == 1
dHearthfires = AddToggleOption("Hearthfires", LCCA_HearthfiresCompatibility.getValue(), OPTION_FLAG_NONE)
Else
dHearthfires = AddToggleOption("Hearthfires", LCCA_HearthfiresCompatibility.getValue(), OPTION_FLAG_DISABLED)
EndIf
If LCCA_InstDragonborn.getValue() == 1
dDragonborn = AddToggleOption("Dragonborn", LCCA_DragonbornCompatibility.getValue(), OPTION_FLAG_NONE)
Else
dDragonborn = AddToggleOption("Dragonborn", LCCA_DragonbornCompatibility.getValue(), OPTION_FLAG_DISABLED)
EndIf

SetCursorPosition(1) ;start right-hand column
AddHeaderOption("Mod Options")
IF LCCA_TextEnable.GetValue() == 0
tEnable = AddTextOption("Enable", "Custom Recipes")
Else
tEnable = AddTextOption("Enable", "All Recipes")
EndIf
tDisable = AddTextOption("Disable All Recipes", "")
AddEmptyOption()
AddEmptyOption()
AddEmptyOption()
AddHeaderOption("Recipe Type")
bAlternative = AddToggleOption("Alternative", LCCA_TypeAlternative.getValue())
bCostless = AddToggleOption("Costless", LCCA_TypeCostless.getValue())

; Recipes Options Page----------------------------------------------------------------------------------
ElseIf (page == "Recipe Options")
SetCursorPosition(0)
SetCursorFillMode(TOP_TO_BOTTOM)
AddHeaderOption("Recipe Options")
If LCCA_TypeAlternative.getValue() == 1 || LCCA_TypeCostless.getValue() == 1
bAlchemy = AddToggleOption("Alchemy Ingredients", LCCA_OptionAlchemy.getValue(), OPTION_FLAG_NONE)
bWine = AddToggleOption("Alcohols & Drugs", LCCA_OptionWine.getValue(), OPTION_FLAG_NONE)
bAnimal = AddToggleOption("Animal Parts", LCCA_OptionAnimal.getValue(), OPTION_FLAG_NONE)
bFood = AddToggleOption("Cooked Foods", LCCA_OptionFood.getValue(), OPTION_FLAG_NONE)
bCooking = AddToggleOption("Cooking Ingredients", LCCA_OptionCooking.getValue(), OPTION_FLAG_NONE)
bIngot = AddToggleOption("Crafted Ingots", LCCA_OptionIngot.getValue(), OPTION_FLAG_NONE)
bLeather = AddToggleOption("Crafted Leathers", LCCA_OptionLeather.getValue(), OPTION_FLAG_NONE)
bEmpty = AddToggleOption("Empty Soul Gems", LCCA_OptionEmpty.getValue(), OPTION_FLAG_NONE)
bFilled = AddToggleOption("Filled Soul Gems", LCCA_OptionFilled.getValue(), OPTION_FLAG_NONE)
bFlawed = AddToggleOption("Flawed Cut Gemstones", LCCA_OptionFlawed.getValue(), OPTION_FLAG_NONE)
bFlawless = AddToggleOption("Flawless Cut Gemstones", LCCA_OptionFlawless.getValue(), OPTION_FLAG_NONE)

bOre = AddToggleOption("Raw Ores", LCCA_OptionOre.getValue(), OPTION_FLAG_NONE)
Else
bAlchemy = AddToggleOption("Alchemy Ingredients", LCCA_OptionAlchemy.getValue(), OPTION_FLAG_DISABLED)
bWine = AddToggleOption("Alcohols & Drugs", LCCA_OptionWine.getValue(), OPTION_FLAG_DISABLED)
bAnimal = AddToggleOption("Animal Parts", LCCA_OptionAnimal.getValue(), OPTION_FLAG_DISABLED)
bFood = AddToggleOption("Cooked Foods", LCCA_OptionFood.getValue(), OPTION_FLAG_DISABLED)
bCooking = AddToggleOption("Cooking Ingredients", LCCA_OptionCooking.getValue(), OPTION_FLAG_DISABLED)
bIngot = AddToggleOption("Crafted Ingots", LCCA_OptionIngot.getValue(), OPTION_FLAG_DISABLED)
bLeather = AddToggleOption("Crafted Leathers", LCCA_OptionLeather.getValue(), OPTION_FLAG_DISABLED)
bEmpty = AddToggleOption("Empty Soul Gems", LCCA_OptionEmpty.getValue(), OPTION_FLAG_DISABLED)
bFilled = AddToggleOption("Filled Soul Gems", LCCA_OptionFilled.getValue(), OPTION_FLAG_DISABLED)
bFlawed = AddToggleOption("Flawed Cut Gemstones", LCCA_OptionFlawed.getValue(), OPTION_FLAG_DISABLED)
bFlawless = AddToggleOption("Flawless Cut Gemstones", LCCA_OptionFlawless.getValue(), OPTION_FLAG_DISABLED)
bOre = AddToggleOption("Raw Ores", LCCA_OptionOre.getValue(), OPTION_FLAG_DISABLED)
EndIf
If LCCA_HearthfiresCompatibility.getValue() == 1
If LCCA_TypeAlternative.getValue() == 1 || LCCA_TypeCostless.getValue() == 1
bMaterial = AddToggleOption("House Building Materials", LCCA_OptionMaterial.getValue(), OPTION_FLAG_NONE)
Else
bMaterial = AddToggleOption ("House Building Materials", LCCA_OptionMaterial.getValue(), OPTION_FLAG_HIDDEN)
EndIf
EndIF

SetCursorPosition(1) ;start right-hand column
AddHeaderOption("Potion Options")
If LCCA_TypeAlternative.getValue() == 1 || LCCA_TypeCostless.getValue() == 1
pBuff = AddToggleOption("Buffs", LCCA_OptionBuff.getValue(), OPTION_FLAG_NONE)
pCure = AddToggleOption("Cures", LCCA_OptionCure.getValue(), OPTION_FLAG_NONE)
pPoison = AddToggleOption("Poisons", LCCA_OptionPoison.getValue(), OPTION_FLAG_NONE)
pRegen = AddToggleOption("Regens", LCCA_OptionRegen.getValue(), OPTION_FLAG_NONE)
pResist = AddToggleOption("Resists", LCCA_OptionResist.getValue(), OPTION_FLAG_NONE)
pRestore = AddToggleOption("Restores", LCCA_OptionRestore.getValue(), OPTION_FLAG_NONE)
pThief = AddToggleOption("Thieves", LCCA_OptionThief.getValue(), OPTION_FLAG_NONE)
pSkill = AddToggleOption("Skills", LCCA_OptionSkill.getValue(), OPTION_FLAG_NONE)
pWeakness = AddToggleOption("Weakness", LCCA_OptionWeakness.getValue(), OPTION_FLAG_NONE)
Else
pBuff = AddToggleOption("Buffs", LCCA_OptionBuff.getValue(), OPTION_FLAG_DISABLED)
pCure = AddToggleOption("Cures", LCCA_OptionCure.getValue(), OPTION_FLAG_DISABLED)
pPoison = AddToggleOption("Poisons", LCCA_OptionPoison.getValue(), OPTION_FLAG_DISABLED)
pRegen = AddToggleOption("Regens", LCCA_OptionRegen.getValue(), OPTION_FLAG_DISABLED)
pResist = AddToggleOption("Resists", LCCA_OptionResist.getValue(), OPTION_FLAG_DISABLED)
pRestore = AddToggleOption("Restores", LCCA_OptionRestore.getValue(), OPTION_FLAG_DISABLED)
pSkill = AddToggleOption("Skills", LCCA_OptionSkill.getValue(), OPTION_FLAG_DISABLED)
pThief = AddToggleOption("Thieves", LCCA_OptionThief.getValue(), OPTION_FLAG_DISABLED)
pWeakness = AddToggleOption("Weakness", LCCA_OptionWeakness.getValue(), OPTION_FLAG_DISABLED)
EndIf
AddEmptyOption()
AddHeaderOption("Potion Upgrades")
uBuff = AddToggleOption("Buffs", LCCA_OptionBuffUpgrade.getValue())
uPoison = AddToggleOption("Poisons", LCCA_OptionPoisonUpgrade.getValue())
uRegen = AddToggleOption("Regens", LCCA_OptionRegenUpgrade.getValue())
uResist = AddToggleOption("Resists", LCCA_OptionResistUpgrade.getValue())
uRestore = AddToggleOption("Restores", LCCA_OptionRestoreUpgrade.getValue())
uSkill = AddToggleOption("Skills", LCCA_OptionSkillUpgrade.getValue())
uThief = AddToggleOption("Thieves", LCCA_OptionThiefUpgrade.getValue())
uWeakness = AddToggleOption("Weakness", LCCA_OptionWeaknessUpgrade.getValue())

; Uninstall Page-------------------------------------------------------------------------------------
ElseIf (Page == "Uninstall")
SetCursorPosition(0)
SetCursorFillMode(TOP_TO_BOTTOM)
tUninstall = AddTextOption("Uninstall LC's Crafting Addons", "")
EndIf
EndEvent

; Option Select-----------------------------------------------------------------------------------------
Event OnOptionSelect(Int Option)
If (Option == tEnable)
If LCCA_TextEnable.getValue() == 0 ; All
LCCA_TextEnable.setValue(1)
LCCA_OptionAlchemy.setValue(1)
LCCA_OptionAnimal.setValue(1)
LCCA_OptionBuff.setValue(1)
LCCA_OptionBuffUpgrade.setValue(1)
LCCA_OptionCooking.setValue(1)
LCCA_OptionCure.setValue(1)
LCCA_OptionEmpty.setValue(1)
LCCA_OptionFilled.setValue(1)
LCCA_OptionFlawed.setValue(1)
LCCA_OptionFlawless.setValue(1)
LCCA_OptionFood.setValue(1)
LCCA_OptionIngot.setValue(1)
LCCA_OptionLeather.setValue(1)
LCCA_OptionMaterial.setValue(1)
LCCA_OptionOre.setValue(1)
LCCA_OptionPoison.setValue(1)
LCCA_OptionPoisonUpgrade.setValue(1)
LCCA_OptionRegen.setValue(1)
LCCA_OptionRegenUpgrade.setValue(1)
LCCA_OptionResist.setValue(1)
LCCA_OptionResistUpgrade.setValue(1)
LCCA_OptionRestore.setValue(1)
LCCA_OptionRestoreUpgrade.setValue(1)
LCCA_OptionSkill.setValue(1)
LCCA_OptionSkillUpgrade.setValue(1)
LCCA_OptionThief.setValue(1)
LCCA_OptionThiefUpgrade.setValue(1)
LCCA_OptionWeakness.setValue(1)
LCCA_OptionWeaknessUpgrade.setValue(1)
LCCA_OptionWine.setValue(1)
LCCA_TypeAlternative.setValue(1)
LCCA_TypeCostless.setValue(1)
ForcePageReset()
Else ; Custom
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (Option == tDisable)
LCCA_OptionAlchemy.setValue(0)
LCCA_OptionAnimal.setValue(0)
LCCA_OptionBuff.setValue(0)
LCCA_OptionBuffUpgrade.setValue(0)
LCCA_OptionCooking.setValue(0)
LCCA_OptionCure.setValue(0)
LCCA_OptionEmpty.setValue(0)
LCCA_OptionFilled.setValue(0)
LCCA_OptionFlawed.setValue(0)
LCCA_OptionFlawless.setValue(0)
LCCA_OptionFood.setValue(0)
LCCA_OptionIngot.setValue(0)
LCCA_OptionLeather.setValue(0)
LCCA_OptionMaterial.setValue(0)
LCCA_OptionOre.setValue(0)
LCCA_OptionPoison.setValue(0)
LCCA_OptionPoisonUpgrade.setValue(0)
LCCA_OptionRegen.setValue(0)
LCCA_OptionRegenUpgrade.setValue(0)
LCCA_OptionResist.setValue(0)
LCCA_OptionResistUpgrade.setValue(0)
LCCA_OptionRestore.setValue(0)
LCCA_OptionRestoreUpgrade.setValue(0)
LCCA_OptionSkill.setValue(0)
LCCA_OptionSkillUpgrade.setValue(0)
LCCA_OptionThief.setValue(0)
LCCA_OptionThiefUpgrade.setValue(0)
LCCA_OptionWeakness.setValue(0)
LCCA_OptionWeaknessUpgrade.setValue(0)
LCCA_OptionWine.setValue(0)
LCCA_TextEnable.setValue(0)
LCCA_TypeAlternative.setValue(0)
LCCA_TypeCostless.setValue(0)
ForcePageReset()
ElseIf (option == bCcf)
If LCCA_CCFCompatibility.getValue() == 0
LCCA_CCFCompatibility.setValue(1)
ForcePageReset()
Else
LCCA_CCFCompatibility.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == dDawnguard)
If LCCA_DawnguardCompatibility.getValue() == 0
LCCA_DawnguardCompatibility.setValue(1)
ForcePageReset()
Else
LCCA_DawnguardCompatibility.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == dDragonborn)
If LCCA_DragonbornCompatibility.getValue() == 0
LCCA_DragonbornCompatibility.setValue(1)
ForcePageReset()
Else
LCCA_DragonbornCompatibility.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == dHearthfires)
If LCCA_HearthfiresCompatibility.getValue() == 0
LCCA_HearthfiresCompatibility.setValue(1)
ForcePageReset()
Else
LCCA_HearthfiresCompatibility.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bAlternative)
If LCCA_TypeAlternative.getValue() == 0
LCCA_TypeAlternative.setValue(1)
ForcePageReset()
Else
LCCA_TypeAlternative.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bCostless)
If LCCA_TypeCostless.getValue() == 0
LCCA_TypeCostless.setValue(1)
ForcePageReset()
Else
LCCA_TypeCostless.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bAlchemy)
If LCCA_OptionAlchemy.getValue() == 0
LCCA_OptionAlchemy.setValue(1)
ForcePageReset()
Else
LCCA_OptionAlchemy.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bAnimal)
If LCCA_OptionAnimal.getValue() == 0
LCCA_OptionAnimal.setValue(1)
ForcePageReset()
Else
LCCA_OptionAnimal.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bCooking)
If LCCA_OptionCooking.getValue() == 0
LCCA_OptionCooking.setValue(1)
ForcePageReset()
Else
LCCA_OptionCooking.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bEmpty)
If LCCA_OptionEmpty.getValue() == 0
LCCA_OptionEmpty.setValue(1)
ForcePageReset()
Else
LCCA_OptionEmpty.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bFilled)
If LCCA_OptionFilled.getValue() == 0
LCCA_OptionFilled.setValue(1)
ForcePageReset()
Else
LCCA_OptionFilled.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bFlawed)
If LCCA_OptionFlawed.getValue() == 0
LCCA_OptionFlawed.setValue(1)
ForcePageReset()
Else
LCCA_OptionFlawed.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bFlawless)
If LCCA_OptionFlawless.getValue() == 0
LCCA_OptionFlawless.setValue(1)
ForcePageReset()
Else
LCCA_OptionFlawless.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bFood)
If LCCA_OptionFood.getValue() == 0
LCCA_OptionFood.setValue(1)
ForcePageReset()
Else
LCCA_OptionFood.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bIngot)
If LCCA_OptionIngot.getValue() == 0
LCCA_OptionIngot.setValue(1)
ForcePageReset()
Else
LCCA_OptionIngot.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bLeather)
If LCCA_OptionLeather.getValue() == 0
LCCA_OptionLeather.setValue(1)
ForcePageReset()
Else
LCCA_OptionLeather.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bMaterial)
If LCCA_OptionMaterial.getValue() == 0
LCCA_OptionMaterial.setValue(1)
ForcePageReset()
Else
LCCA_OptionMaterial.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bOre)
If LCCA_OptionOre.getValue() == 0
LCCA_OptionOre.setValue(1)
ForcePageReset()
Else
LCCA_OptionOre.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == bWine)
If LCCA_OptionWine.getValue() == 0
LCCA_OptionWine.setValue(1)
ForcePageReset()
Else
LCCA_OptionWine.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pBuff)
If LCCA_OptionBuff.getValue() == 0
LCCA_OptionBuff.setValue(1)
ForcePageReset()
Else
LCCA_OptionBuff.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pCure)
If LCCA_OptionCure.getValue() == 0
LCCA_OptionCure.setValue(1)
ForcePageReset()
Else
LCCA_OptionCure.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pPoison)
If LCCA_OptionPoison.getValue() == 0
LCCA_OptionPoison.setValue(1)
ForcePageReset()
Else
LCCA_OptionPoison.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pRegen)
If LCCA_OptionRegen.getValue() == 0
LCCA_OptionRegen.setValue(1)
ForcePageReset()
Else
LCCA_OptionRegen.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pResist)
If LCCA_OptionResist.getValue() == 0
LCCA_OptionResist.setValue(1)
ForcePageReset()
Else
LCCA_OptionResist.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pRestore)
If LCCA_OptionRestore.getValue() == 0
LCCA_OptionRestore.setValue(1)
ForcePageReset()
Else
LCCA_OptionRestore.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pSkill)
If LCCA_OptionSkill.getValue() == 0
LCCA_OptionSkill.setValue(1)
ForcePageReset()
Else
LCCA_OptionSkill.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pThief)
If LCCA_OptionThief.getValue() == 0
LCCA_OptionThief.setValue(1)
ForcePageReset()
Else
LCCA_OptionThief.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == pWeakness)
If LCCA_OptionWeakness.getValue() == 0
LCCA_OptionWeakness.setValue(1)
ForcePageReset()
Else
LCCA_OptionWeakness.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uBuff)
If LCCA_OptionBuffUpgrade.getValue() == 0
LCCA_OptionBuffUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionBuffUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uPoison)
If LCCA_OptionPoisonUpgrade.getValue() == 0
LCCA_OptionPoisonUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionPoisonUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uRegen)
If LCCA_OptionRegenUpgrade.getValue() == 0
LCCA_OptionRegenUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionRegenUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uResist)
If LCCA_OptionResistUpgrade.getValue() == 0
LCCA_OptionResistUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionResistUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uRestore)
If LCCA_OptionRestoreUpgrade.getValue() == 0
LCCA_OptionRestoreUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionRestoreUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uSkill)
If LCCA_OptionSkillUpgrade.getValue() == 0
LCCA_OptionSkillUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionSkillUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uThief)
If LCCA_OptionThiefUpgrade.getValue() == 0
LCCA_OptionThiefUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionThiefUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == uWeakness)
If LCCA_OptionWeaknessUpgrade.getValue() == 0
LCCA_OptionWeaknessUpgrade.setValue(1)
ForcePageReset()
Else
LCCA_OptionWeaknessUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
ElseIf (option == tUninstall)
SetTextOptionValue(tUninstall, "Working.....")
LCCA_MCMMenuQuest.UninstallLCCA()
SetTextOptionValue(tUninstall, "Disabled.")
Debug.MessageBox("Uninstall Complete.\n\nYou may now save your game and deactivate LadyCrystyna's Crafting Addons.")
EndIf
EndEvent

; Option Default---------------------------------------------------------------------------------------
Event OnOptionDefault(Int Option)
If (option == bCcf)
LCCA_CCFCompatibility.setValue(0)
ForcePageReset()
ElseIf (option == dDawnguard)
LCCA_DawnguardCompatibility.setValue(0)
ForcePageReset()
ElseIf (option == dDragonborn)
LCCA_DragonbornCompatibility.setValue(0)
ForcePageReset()
ElseIf (option == dHearthfires)
LCCA_HearthfiresCompatibility.setValue(0)
ForcePageReset()
ElseIf (option == bAlternative)
LCCA_TypeAlternative.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bCostless)
LCCA_TypeCostless.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bAlchemy)
LCCA_OptionAlchemy.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bAnimal)
LCCA_OptionAnimal.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bCooking)
LCCA_OptionCooking.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bEmpty)
LCCA_OptionEmpty.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bFilled)
LCCA_OptionFilled.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bFlawed)
LCCA_OptionFlawed.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bFlawless)
LCCA_OptionFlawless.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bFood)
LCCA_OptionFood.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bIngot)
LCCA_OptionIngot.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bLeather)
LCCA_OptionLeather.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bMaterial)
LCCA_OptionMaterial.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bOre)
LCCA_OptionOre.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == bWine)
LCCA_OptionWine.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pBuff)
LCCA_OptionBuff.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pCure)
LCCA_OptionCure.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pPoison)
LCCA_OptionPoison.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pRegen)
LCCA_OptionRegen.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pResist)
LCCA_OptionResist.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pRestore)
LCCA_OptionRestore.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pSkill)
LCCA_OptionSkill.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pThief)
LCCA_OptionThief.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == pWeakness)
LCCA_OptionWeakness.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uBuff)
LCCA_OptionBuffUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uPoison)
LCCA_OptionPoisonUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uRegen)
LCCA_OptionRegenUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uResist)
LCCA_OptionResistUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uRestore)
LCCA_OptionRestoreUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uSkill)
LCCA_OptionSkillUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uThief)
LCCA_OptionThiefUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
ElseIf (option == uWeakness)
LCCA_OptionWeaknessUpgrade.setValue(0)
LCCA_TextEnable.setValue(0)
ForcePageReset()
EndIf
EndEvent

; Option Highlight--------------------------------------------------------------------------------------
Event OnOptionHighlight(int option)
If (option == bCcf)
SetInfoText("Enables value accurate recipes to be consistant with Clothing & Clutter Fixes gold cost values.\nNOTE: This is automatically detected on startup and upon loading of a saved game.")
ElseIf (option == dDawnguard)
SetInfoText("Enables Dawnguard recipes.\nNOTE: This is automatically detected on startup and upon loading of a saved game.")
ElseIf (option == dHearthfires)
SetInfoText("Enables Hearthfires recipes.\nNOTE: This is automatically detected on startup and upon loading of a saved game.")
ElseIf (option == dDragonborn)
SetInfoText("Enables Dragonborn recipes.\nNOTE: This is automatically detected on startup and upon loading of a saved game.")
ElseIf (option == tUninstall)
SetInfoText("Uninstalls LC's Crafting Addons and reverts any changes made.")
ElseIf (Option == tEnable)
SetInfoText("Selecting this will enable all recipe options.\nCustom = recipes you select manually will be enabled.\nAll = recipes with with gold cost based on value & no gold or ingredient cost will be enabled.\nNOTE: When using Custom you still need to enable either Alternative or Costless for the toggle options to work.")
ElseIf (Option == tDisable)
SetInfoText("Selecting this will disable all recipe options.\nDLC and CCF Compatibility will remain unaltered.\nNOTE: If you wish to also disable DLC & CCF compatibility you can deselect them manually.")
ElseIf (Option == bAlternative)
SetInfoText("Enables gold cost based on value.")
ElseIf (option == bCostless)
SetInfoText("Enables no gold or ingredient cost.")
ElseIf (option == bWine)
SetInfoText("Enables Ales, Meads, Wines & Skooma crafting at the Cook Pot.")
ElseIf (option == bAlchemy)
SetInfoText("Enables Alchemy Ingredients crafting at the Cook Pot.")
ElseIf (Option == bAnimal)
SetInfoText("Enables Animal Part Ingredients crafting at the Blacksmithing Forge.\nAnimal Parts = items dropped by killing monsters.")
ElseIf (option == bCooking)
SetInfoText("Enables Cooking Ingredients crafting at the Cook Pot.")
ElseIf (option == bEmpty)
SetInfoText("Enables Empty Soul Gems crafting at the Blacksmithing Forge.")
ElseIf (option == bFilled)
SetInfoText("Enables Filled Soul Gems crafting at the Blacksmithing Forge.")
ElseIf (option == bFlawed)
SetInfoText("Enables Flawed Gemstones crafting at the Blacksmithing Forge.")
ElseIf (option == bFlawless)
SetInfoText("Enables Flawless Gemstones crafting at the Blacksmithing Forge.")
ElseIf (option == bFood)
SetInfoText("Enables Cooked Foods crafting at the Cook Pot & Crafting Oven.\nNOTE: Crafting Oven recipes require Hearthfires.")
ElseIf (option == bIngot)
SetInfoText("Enables Crafted Ingots crafting at the Smelter.")
ElseIf (option == bLeather)
SetInfoText("Enables Crafted Leathers crafting at the Tanning Rack.")
ElseIf (Option == bMaterial)
SetInfoText("Enable Building Materials crafting at the Smelter & Blacksmithing Forge.\nRequires Hearthfires.")
ElseIf (Option == bOre)
SetInfoText("Enables Raw Ores crafting at the Smelter.")
ElseIf (option == pBuff)
SetInfoText("Enables Buff Potions crafting at the Cook Pot.\nBuffs = Fortify Health, Magicka, Stamina & Strength. Invisibility & Waterbreathing potions.")
ElseIf (option == pCure)
SetInfoText("Enables Cure Potions crafting at the Cook Pot.\nCures = Curing of Disease or Poison & Potion of Blood.\nPotion of Blood requires Dawnguard.")
ElseIf (option == pPoison)
SetInfoText("Enables Poison Potions crafting at the Cook Pot.\nPoisons = Fear, Frenzy, Magicka, Paralysis, Poison, & Stamina.\nThese are potions that give a status debuff or do instant damage.")
ElseIf (option == pRegen)
SetInfoText("Enables Regen Potions crafting at the Cook Pot.\nRegens = Lasting Potency, Regeneration & Vigor.\nThese are potions that have effects that heal over time.")
ElseIf (option == pResist)
SetInfoText("Enables Resistance Potions crafting at the Cook Pot.\nResists = Cold, Fire, Magic & Shock.\nThese are potions that give you a resistance to magic.")
ElseIf (option == pRestore)
SetInfoText("Enables Restorative Potions crafting at the Cook Pot.\nRestores = Healing, Magicka & Stamina.\nThese are potions that instantly heal a stat.")
ElseIf (option == pSkill)
SetInfoText("Enables Skill Enhancing potions crafting at the Cook Pot.\nSkills = Alteration, Berserker, Blacksmith, Conjurer, Destruction, Enchanter, Glibness, Haggling, Healer \nIllusion, Knight, Light Feet, Lockpicking, Pickpocketing, Skirmisher, True Shot & Warrior.\nThese are potions that give a bonus beyond your current skill level.")
ElseIf (option == pThief)
SetInfoText("Enables Thieves Guild Potions crafting at the Cook Pot.\nThieves = Conflict, Escape, Keenshot, Larceny & Plunder.\nThese are potions that can only be obtained in thieves guild caches.")
ElseIf (option == pWeakness)
SetInfoText("Enables Weakness Potions crafting at the Cook Pot.\nWeakness = Fire, Frost, Magic & Shock.\nThese are potions that make the target weak to magic.")
ElseIf (option == uBuff)
SetInfoText("Enables Upgrading of Buff Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uPoison)
SetInfoText("Enables Upgrading of Poison Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uRegen)
SetInfoText("Enables Upgrading of Regen Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uResist)
SetInfoText("Enables Upgrading of Resistance Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uRestore)
SetInfoText("Enables Upgrading of Restorative Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uSkill)
SetInfoText("Enables Upgrading of Skill Enhancing Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uThief)
SetInfoText("Enables Upgrading of Thieves Guild Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
ElseIf (option == uWeakness)
SetInfoText("Enables Upgrading of Weakness Potions at the Cook Pot.\nRequires 2 of the same potions to make the higher level potion.")
EndIf
EndEvent

Compatibility Script



Scriptname LCCA_CompatibilityScript extends Quest

FormList Property LCCA_DawnguardItems Auto
FormList Property LCCA_DawnguardRecipes Auto
FormList Property LCCA_DragonbornItems Auto
FormList Property LCCA_DragonbornRecipes Auto
FormList Property LCCA_HearthfiresItems Auto
FormList Property LCCA_HearthfiresRecipes Auto
Keyword Property BYOHCraftingOven Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmelter Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property CraftingTanningRack Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHCraftingOven_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHSmelter_LCCA Auto
Keyword Property WBPHTanningRack_LCCA Auto
GlobalVariable Property LCCA_CCFCompatibility Auto
GlobalVariable Property LCCA_DawnguardCompatibility Auto
GlobalVariable Property LCCA_DragonbornCompatibility Auto
GlobalVariable Property LCCA_HearthfiresCompatibility Auto
GlobalVariable Property LCCA_InstCCF Auto
GlobalVariable Property LCCA_InstDawnguard Auto
GlobalVariable Property LCCA_InstDragonborn Auto
GlobalVariable Property LCCA_InstHearthfires Auto
GlobalVariable Property LCCA_OptionAlchemy Auto
GlobalVariable Property LCCA_OptionAnimal Auto
GlobalVariable Property LCCA_OptionBuff Auto
GlobalVariable Property LCCA_OptionBuffUpgrade Auto
GlobalVariable Property LCCA_OptionCooking Auto
GlobalVariable Property LCCA_OptionCure Auto
GlobalVariable Property LCCA_OptionEmpty Auto
GlobalVariable Property LCCA_OptionFilled Auto
GlobalVariable Property LCCA_OptionFlawed Auto
GlobalVariable Property LCCA_OptionFlawless Auto
GlobalVariable Property LCCA_OptionFood Auto
GlobalVariable Property LCCA_OptionIngot Auto
GlobalVariable Property LCCA_OptionLeather Auto
GlobalVariable Property LCCA_OptionMaterial Auto
GlobalVariable Property LCCA_OptionOre Auto
GlobalVariable Property LCCA_OptionPoison Auto
GlobalVariable Property LCCA_OptionPoisonUpgrade Auto
GlobalVariable Property LCCA_OptionRegen Auto
GlobalVariable Property LCCA_OptionRegenUpgrade Auto
GlobalVariable Property LCCA_OptionResist Auto
GlobalVariable Property LCCA_OptionResistUpgrade Auto
GlobalVariable Property LCCA_OptionRestore Auto
GlobalVariable Property LCCA_OptionRestoreUpgrade Auto
GlobalVariable Property LCCA_OptionSkill Auto
GlobalVariable Property LCCA_OptionSkillUpgrade Auto
GlobalVariable Property LCCA_OptionThief Auto
GlobalVariable Property LCCA_OptionThiefUpgrade Auto
GlobalVariable Property LCCA_OptionWeakness Auto
GlobalVariable Property LCCA_OptionWeaknessUpgrade Auto
GlobalVariable Property LCCA_OptionWine Auto
GlobalVariable Property LCCA_TextEnable Auto
GlobalVariable Property LCCA_TypeAlternative Auto
GlobalVariable Property LCCA_TypeCostless Auto

LCCA_DLC_CompatibilityScript Property LCCA_MCMMenuQuest Auto


; Enable DLC Check-----------------------------------------------------------------------
Function Enable_DLC()
Enable_DG()
Enable_HF()
Enable_DB()
LCCA_MCMMenuQuest.SwitchItems_DLC()
EndFunction

Function Enable_DG()
If LCCA_InstDawnguard.getValue() == 1
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02011999, "Dawnguard.esm")) ; Vale Deer Hide
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x0201199A, "Dawnguard.esm")) ; Vale Sabrecat Hide
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02011CF7, "Dawnguard.esm")) ; Bone Hawk Claw
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02002994, "Dawnguard.esm")) ; Bone Hawk Feathers
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02002993, "Dawnguard.esm")) ; Bone Hawk Skull
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x020195AA, "Dawnguard.esm")) ; Shellbug Chitin
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ; Ancestor Moth Wing
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x020183B7, "Dawnguard.esm")) ; Chaurus Hunter Antennae
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x0200B097, "Dawnguard.esm")) ; Gleamblossom
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x020185FB, "Dawnguard.esm")) ; Poison Bloom
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02002A78, "Dawnguard.esm")) ; Yellow Mountain Flower
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x02018EF3, "Dawnguard.esm")) ; Potion of Blood
LCCA_DawnguardItems.AddForm(Game.GetFormFromFile(0x0201391D, "Dawnguard.esm")) ; Redwater Skooma
Else
Debug.Notification("LC's Crafing Addons didn't detect the DLC Dawnguard.")
EndIf
EndFunction

Function Enable_HF()
If LCCA_InstHearthfires.getValue() == 1
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000EBA01, "Hearthfires.esm")) ; Apple Cabbage Stew (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003533, "Hearthfires.esm")) ; Apple Dumplings
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003535, "Hearthfires.esm")) ; Argonian Bloodwine
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F4314, "Hearthfires.esm")) ; Beef Stew (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x030009DB, "Hearthfires.esm")) ; Braided Bread
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353C, "Hearthfires.esm")) ; Butter
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F431B, "Hearthfires.esm")) ; Cabbage Potato Soup (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x030117FF, "Hearthfires.esm")) ; Chicken Dumplings
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353E, "Hearthfires.esm")) ; Clam Chowder
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F4320, "Hearthfires.esm")) ; Elsweyr Fondue (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003538, "Hearthfires.esm")) ; Flour
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x030009DC, "Hearthfires.esm")) ; Garlic Bread
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F4315, "Hearthfires.esm")) ; Horker Stew (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353A, "Hearthfires.esm")) ; Jazbay Crostata
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003539, "Hearthfires.esm")) ; Juniper Berry Crostata
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03011801, "Hearthfires.esm")) ; Lavender Dumplings
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003534, "Hearthfires.esm")) ; Milk
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003540, "Hearthfires.esm")) ; Mudcrab Legs
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003537, "Hearthfires.esm")) ; Potato Bread
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353D, "Hearthfires.esm")) ; Potato Soup
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353B, "Hearthfires.esm")) ; Snowberry Crostata
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300353F, "Hearthfires.esm")) ; Steamed Mudcrab Legs
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003536, "Hearthfires.esm")) ; Surilie Brothers Wine
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F431C, "Hearthfires.esm")) ; Tomato Soup (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F431E, "Hearthfires.esm")) ; Vegetable Soup (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x000F431D, "Hearthfires.esm")) ; Venison Stew (New Mesh)
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300F1CC, "Hearthfires.esm")) ; Hawk Egg
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003545, "Hearthfires.esm")) ; Salmon Roe
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003043, "Hearthfires.esm")) ; Clay
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03005A69, "Hearthfires.esm")) ; Glass
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300303F, "Hearthfires.esm")) ; Goat Horns
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003011, "Hearthfires.esm")) ; Hinge
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003035, "Hearthfires.esm")) ; Iron Fittings
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03003012, "Hearthfires.esm")) ; Lock
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300300F, "Hearthfires.esm")) ; Nails
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300306C, "Hearthfires.esm")) ; Quarried Stone
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x0300300E, "Hearthfires.esm")) ; Sawn Log
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x03005A68, "Hearthfires.esm")) ; Straw
LCCA_HearthfiresItems.AddForm(Game.GetFormFromFile(0x030117F7, "Hearthfires.esm")) ; Crafting Oven
Else
Debug.Notification("LC's Crafing Addons didn't detect the DLC Hearthfires.")
EndIf
EndFunction

Function Enable_DB()
If LCCA_InstDragonborn.getValue() == 1
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x040206E7, "Dragonborn.esm")) ; Ash Yam
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0403572F, "Dragonborn.esm")) ; Ashfire Mead
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0403BD14, "Dragonborn.esm")) ; Boar Meat
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x000EBA02, "Dragonborn.esm")) ; Cabbage Soup (New Mesh)
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0403CF72, "Dragonborn.esm")) ; Cooked Boar Meat
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x040207E5, "Dragonborn.esm")) ; Flin
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0403CD5B, "Dragonborn.esm")) ; Horker Ash Yam Stew
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x040248CE, "Dragonborn.esm")) ; Matze
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x040248CC, "Dragonborn.esm")) ; Shein
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x040207E6, "Dragonborn.esm")) ; Sujamma
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD74, "Dragonborn.esm")) ; Ash Creep Cluster
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD71, "Dragonborn.esm")) ; Ash Hopper Jelly
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x04016E26, "Dragonborn.esm")) ; Ashen Grass Pod
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD6F, "Dragonborn.esm")) ; Boar Tusk
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD6E, "Dragonborn.esm")) ; Burnt Spriggan Wood
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401FF75, "Dragonborn.esm")) ; Emperor Parasol Moss
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0403CD8E, "Dragonborn.esm")) ; Felsaad Tern Feathers
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD72, "Dragonborn.esm")) ; Netch Jelly
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x04017E97, "Dragonborn.esm")) ; Scathecraw
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD6D, "Dragonborn.esm")) ; Spawn Ash
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x04017008, "Dragonborn.esm")) ; Trama Root
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0401CD7C, "Dragonborn.esm")) ; Netch Leather
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0402B04E, "Dragonborn.esm")) ; Chitin Plate
LCCA_DragonbornItems.AddForm(Game.GetFormFromFile(0x0402B06B, "Dragonborn.esm")) ; Stalhrim Ore
Else
Debug.Notification("LC's Crafing Addons didn't detect the DLC Dragonborn.")
EndIf
EndFunction



; Uninstall LC's Crafting Addons----------------------------------------------------------------
Function UninstallLCCA()
LCCA_CCFCompatibility.setValue(0)
LCCA_DawnguardCompatibility.setValue(0)
LCCA_DragonbornCompatibility.setValue(0)
LCCA_HearthfiresCompatibility.setValue(0)
LCCA_InstCCF.setValue(0)
LCCA_InstDawnguard.setValue(0)
LCCA_InstDragonborn.setValue(0)
LCCA_InstHearthfires.setValue(0)
LCCA_OptionAlchemy.setValue(0)
LCCA_OptionAnimal.setValue(0)
LCCA_OptionBuff.setValue(0)
LCCA_OptionBuffUpgrade.setValue(0)
LCCA_OptionCooking.setValue(0)
LCCA_OptionCure.setValue(0)
LCCA_OptionEmpty.setValue(0)
LCCA_OptionFilled.setValue(0)
LCCA_OptionFlawed.setValue(0)
LCCA_OptionFlawless.setValue(0)
LCCA_OptionFood.setValue(0)
LCCA_OptionIngot.setValue(0)
LCCA_OptionLeather.setValue(0)
LCCA_OptionMaterial.setValue(0)
LCCA_OptionOre.setValue(0)
LCCA_OptionPoison.setValue(0)
LCCA_OptionPoisonUpgrade.setValue(0)
LCCA_OptionRegen.setValue(0)
LCCA_OptionRegenUpgrade.setValue(0)
LCCA_OptionResist.setValue(0)
LCCA_OptionResistUpgrade.setValue(0)
LCCA_OptionRestore.setValue(0)
LCCA_OptionRestoreUpgrade.setValue(0)
LCCA_OptionSkill.setValue(0)
LCCA_OptionSkillUpgrade.setValue(0)
LCCA_OptionThief.setValue(0)
LCCA_OptionThiefUpgrade.setValue(0)
LCCA_OptionWeakness.setValue(0)
LCCA_OptionWeaknessUpgrade.setValue(0)
LCCA_OptionWine.setValue(0)
LCCA_TextEnable.setValue(0)
LCCA_TypeAlternative.setValue(0)
LCCA_TypeCostless.setValue(0)
RevertFormLists()
EndFunction

Function RevertFormLists()
LCCA_DawnguardItems.Revert()
LCCA_HearthfiresItems.Revert()
LCCA_DragonbornItems.Revert()
LCCA_DawnguardRecipes.Revert()
LCCA_HearthfiresRecipes.Revert()
LCCA_DragonbornRecipes.Revert()
DG_DisableCookpotWorkbench()
DG_DisableTanningRackWorkbench()
DG_DisableSmithingForgeWorkbench()
HF_DisableOvenWorkbench()
HF_DisableCookpotWorkbench()
HF_DisableForgeWorkbench()
HF_DisableSmelterWorkbench()
DB_DisableCookpotWorkbench()
DB_DisableSmelterWorkbench()
DB_DisableForgeWorkbench()
DB_DisableTanningWorkbench()
LCCA_MCMMenuQuest.setStage(100)
EndFunction



; Disable Dawnguard Recipes---------------------------------------------------------------------------
Function DG_DisableCookpotWorkbench()
If LCCA_InstDawnguard.getValue() == 0
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingCookpot
CurrentRecipe.setWorkbenchKeyword(WBPHCookPot_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function DG_DisableTanningRackWorkbench()
If LCCA_InstDawnguard.getValue() == 0
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingTanningRack
CurrentRecipe.setWorkbenchKeyword(WBPHTanningRack_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function DG_DisableSmithingForgeWorkbench()
If LCCA_InstDawnguard.getValue() == 0
Int RecipeListCount = LCCA_DawnguardRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DawnguardRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingSmithingForge
CurrentRecipe.setWorkbenchKeyword(WBPHForge_LCCA)
EndIf
EndWhile
EndIf
EndFunction



; Disable Hearthfires Recipes---------------------------------------------------------------------------
Function HF_DisableOvenWorkbench()
If LCCA_InstHearthfires.getValue() == 0
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == BYOHCraftingOven
CurrentRecipe.setWorkbenchKeyword(WBPHCraftingOven_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function HF_DisableCookpotWorkbench()
If LCCA_InstHearthfires.getValue() == 0
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingCookpot
CurrentRecipe.setWorkbenchKeyword(WBPHCookPot_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function HF_DisableForgeWorkbench()
If LCCA_InstHearthfires.getValue() == 0
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingSmithingForge
CurrentRecipe.setWorkbenchKeyword(WBPHForge_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function HF_DisableSmelterWorkbench()
If LCCA_InstHearthfires.getValue() == 0
Int RecipeListCount = LCCA_HearthfiresRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_HearthfiresRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingSmelter
CurrentRecipe.setWorkbenchKeyword(WBPHSmelter_LCCA)
EndIf
EndWhile
EndIf
EndFunction



; Disable Dragonborn Recipes---------------------------------------------------------------------------
Function DB_DisableCookpotWorkbench()
If LCCA_InstDragonborn.getValue() == 0
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingCookpot
CurrentRecipe.setWorkbenchKeyword(WBPHCookPot_LCCA)
EndIf
EndWhile
EndIf
EndFunction


Function DB_DisableSmelterWorkbench()
If LCCA_InstDragonborn.getValue() == 0
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingSmelter
CurrentRecipe.setWorkbenchKeyword(WBPHSmelter_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function DB_DisableForgeWorkbench()
If LCCA_InstDragonborn.getValue() == 0
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingSmithingForge
CurrentRecipe.setWorkbenchKeyword(WBPHForge_LCCA)
EndIf
EndWhile
EndIf
EndFunction

Function DB_DisableTanningWorkbench()
If LCCA_InstDragonborn.getValue() == 0
Int RecipeListCount = LCCA_DragonbornRecipes.GetSize()
While RecipeListCount >= 0
RecipeListCount -= 1
ConstructibleObject CurrentRecipe = LCCA_DragonbornRecipes.GetAt(RecipeListCount) As ConstructibleObject
If CurrentRecipe.GetWorkbenchKeyword() == CraftingTanningRack
CurrentRecipe.setWorkbenchKeyword(WBPHTanningRack_LCCA)
EndIf
EndWhile
EndIf
EndFunction

 

Edited by LadyCrystyna
Link to comment
Share on other sites

1. Why use a state on the Player Alias script? Doesn't that defeat the purpose of future checks should you add to the mod and incorporate compatibility with other mods? Also, no need to duplicate the mod check code on both scripts. Use the starter script as a maintenance code holder and call the functions on it. You're already using that process with a different script's functions / variables so you know how to set it up.

 

2. Your compatibility scripts where you loop through a formlist of recipes and change one thing. Each one of those functions loops through the same list. This is why it is taking forever. Would be better to make a single function which loops once and looks for each item you need to swap out. This is where either another formlist or array would come in handy.

 

Here is a reworked example using your Dawnguard compatibility script, please note it has not been tested for compilation or function.

 

 

Scriptname LCCA_DG_CompatibilityScript extends Quest
 
FormList Property LCCA_DawnguardRecipes Auto
GlobalVariable Property LCCA_InstDawnguard Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property CraftingTanningRack Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHTanningRack_LCCA Auto
 
LCCA_HF_CompatibilityScript Property LCCA_MCMMenuQuest Auto

Formlist Property OldIngredients Auto
;assign in CK in following order
;BearClaws 			- index 12
;BoneMeal 			- index 11
;Ectoplasm			- index 10
;FireSalts			- index  9
;FrostSalts			- index  8
;Basket01			- index  7
;Basket02			- index  6
;Basket03			- index  5
;Basket04			- index  4
;DeerHide 			- index  3
;SabreCatPelt 		- index  2
;RestoreHealth01 	- index  1
;FirebrandWine 		- index  0

FormList Property NewIngredients Auto
;empty list in CK - assign via script - see below
 
; --------------------------------------------------------------------------------------------------------------------------------
 
Function AddToList(FormList TheList, Form TheItem)
	If !(TheList.HasForm(TheItem))
		TheList.AddForm(TheItem)
	EndIf
EndFunction	

Function DG_SwitchItems()
	If LCCA_InstDawnguard.getValue() == 1

		AddToList(NewIngredients, Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ; Ancestor Moth Wing 			;index 12 - replaces BearClaws
		AddToList(NewIngredients, Game.GetFormFromFile(0x020183B7, "Dawnguard.esm")) ; Chaurus Hunter Antennae 		;index 11 - replaces BoneMeal
		AddToList(NewIngredients, Game.GetFormFromFile(0x0200B097, "Dawnguard.esm")) ; Gleamblossom 				;index 10 - replaces Ectoplasm
		AddToList(NewIngredients, Game.GetFormFromFile(0x020185FB, "Dawnguard.esm")) ; Poison Bloom 				;index  9 - replaces FireSalts
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002A78, "Dawnguard.esm")) ; Yellow Mountain Flower 		;index  8 - replaces FrostSalts
		AddToList(NewIngredients, Game.GetFormFromFile(0x02011CF7, "Dawnguard.esm")) ; Bone Hawk Claw 				;index  7 - replaces Basket01
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002994, "Dawnguard.esm")) ; Bone Hawk Feathers 			;index  6 - replaces Basket02
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002993, "Dawnguard.esm")) ; Bone Hawk Skull 				;index  5 - replaces Basket03
		AddToList(NewIngredients, Game.GetFormFromFile(0x020195AA, "Dawnguard.esm")) ; Shellbug Chitin 				;index  4 - replaces Basket04
		AddToList(NewIngredients, Game.GetFormFromFile(0x02011999, "Dawnguard.esm")) ; Vale Deer Hide 				;index  3 - replaces DeerHide
		AddToList(NewIngredients, Game.GetFormFromFile(0x0201199A, "Dawnguard.esm")) ; Vale Sabrecat Hide 			;index  2 - replaces SabreCatPelt
		AddToList(NewIngredients, Game.GetFormFromFile(0x02018EF3, "Dawnguard.esm")) ; Potion of Blood 				;index  1 - replaces RestoreHealth01
		AddToList(NewIngredients, Game.GetFormFromFile(0x0201391D, "Dawnguard.esm")) ; Redwater Skooma 				;index  0 - replaces FirebrandWine
		;NOTE - AddForm adds items at index 0 changing the index of each previous entry by one.
		;Thus we add the replacement items in reverse order so that index entries match between the old list and the new list

		SwitchItems(LCCA_DawnguardRecipes,OldIngredients,NewIngredients)
	EndIf
	LCCA_MCMMenuQuest.HF_SwitchItems()
EndFunction
 
Function SwitchItems(FormList RecipeList, FormList OldList, FormList NewList)
	Int Size = RecipeList.GetSize()
	While Size >= 0
		Size -= 1
		ConstructibleObject CurrentRecipe = RecipeList.GetAt(Size) as ConstructibleObject
                Int OSize = OldList.GetSize()
		While OSize >= 0
			OSize -= 1
			If CurrentRecipe.GetResult() == OldList.GetAt(OSize)
				CurrentRecipe.SetResult(NewList.GetAt(Osize))
                                OSize = -1 ;got what we need, did what we need stop loop
			EndIf
		EndWhile
		;with only three workbenches to deal with, we skip the formlist build and compare direcly
		If CurrentRecipe.GetWorkbenchKeyword() == WBPHCookPot_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingCookpot)
		ElseIf CurrentRecipe.GetWorkbenchKeyword() == WBPHTanningRack_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingTanningRack)
		ElseIf CurrentRecipe.GetWorkbenchKeyword() == WBPHForge_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingSmithingForge)
		EndIf
	EndWhile
EndFunction

 

 

 

As far as your MCM script, I'm not even going to get into it. Those things by nature are long and hard to keep track of what is going on. I'd suggest taking a look at the state variation of the MCM script. However, changing one that is already working in the old way to the 'newer' state way is a royal pain. So if it is working and the above suggestion for the compatibility scripts reduces your processing time sufficiently, then no need to make changes to the MCM.

 

EDIT: tweaked code a bit

Edited by IsharaMeradin
Link to comment
Share on other sites

1. Why use a state on the Player Alias script? Doesn't that defeat the purpose of future checks should you add to the mod and incorporate compatibility with other mods? Also, no need to duplicate the mod check code on both scripts. Use the starter script as a maintenance code holder and call the functions on it. You're already using that process with a different script's functions / variables so you know how to set it up.

 

2. Your compatibility scripts where you loop through a formlist of recipes and change one thing. Each one of those functions loops through the same list. This is why it is taking forever. Would be better to make a single function which loops once and looks for each item you need to swap out. This is where either another formlist or array would come in handy.

 

Here is a reworked example using your Dawnguard compatibility script, please note it has not been tested for compilation or function.

 

 

Scriptname LCCA_DG_CompatibilityScript extends Quest
 
FormList Property LCCA_DawnguardRecipes Auto
GlobalVariable Property LCCA_InstDawnguard Auto
Keyword Property CraftingCookpot Auto
Keyword Property CraftingSmithingForge Auto
Keyword Property CraftingTanningRack Auto
Keyword Property WBPHCookPot_LCCA Auto
Keyword Property WBPHForge_LCCA Auto
Keyword Property WBPHTanningRack_LCCA Auto
 
LCCA_HF_CompatibilityScript Property LCCA_MCMMenuQuest Auto

Formlist Property OldIngredients Auto
;assign in CK in following order
;BearClaws 			- index 12
;BoneMeal 			- index 11
;Ectoplasm			- index 10
;FireSalts			- index  9
;FrostSalts			- index  8
;Basket01			- index  7
;Basket02			- index  6
;Basket03			- index  5
;Basket04			- index  4
;DeerHide 			- index  3
;SabreCatPelt 		- index  2
;RestoreHealth01 	- index  1
;FirebrandWine 		- index  0

FormList Property NewIngredients Auto
;empty list in CK - assign via script - see below
 
; --------------------------------------------------------------------------------------------------------------------------------
 
Function AddToList(FormList TheList, Form TheItem)
	If !(TheList.HasForm(TheItem))
		TheList.AddForm(TheItem)
	EndIf
EndFunction	

Function DG_SwitchItems()
	If LCCA_InstDawnguard.getValue() == 1

		AddToList(NewIngredients, Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ; Ancestor Moth Wing 			;index 12 - replaces BearClaws
		AddToList(NewIngredients, Game.GetFormFromFile(0x020183B7, "Dawnguard.esm")) ; Chaurus Hunter Antennae 		;index 11 - replaces BoneMeal
		AddToList(NewIngredients, Game.GetFormFromFile(0x0200B097, "Dawnguard.esm")) ; Gleamblossom 				;index 10 - replaces Ectoplasm
		AddToList(NewIngredients, Game.GetFormFromFile(0x020185FB, "Dawnguard.esm")) ; Poison Bloom 				;index  9 - replaces FireSalts
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002A78, "Dawnguard.esm")) ; Yellow Mountain Flower 		;index  8 - replaces FrostSalts
		AddToList(NewIngredients, Game.GetFormFromFile(0x02011CF7, "Dawnguard.esm")) ; Bone Hawk Claw 				;index  7 - replaces Basket01
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002994, "Dawnguard.esm")) ; Bone Hawk Feathers 			;index  6 - replaces Basket02
		AddToList(NewIngredients, Game.GetFormFromFile(0x02002993, "Dawnguard.esm")) ; Bone Hawk Skull 				;index  5 - replaces Basket03
		AddToList(NewIngredients, Game.GetFormFromFile(0x020195AA, "Dawnguard.esm")) ; Shellbug Chitin 				;index  4 - replaces Basket04
		AddToList(NewIngredients, Game.GetFormFromFile(0x02011999, "Dawnguard.esm")) ; Vale Deer Hide 				;index  3 - replaces DeerHide
		AddToList(NewIngredients, Game.GetFormFromFile(0x0201199A, "Dawnguard.esm")) ; Vale Sabrecat Hide 			;index  2 - replaces SabreCatPelt
		AddToList(NewIngredients, Game.GetFormFromFile(0x02018EF3, "Dawnguard.esm")) ; Potion of Blood 				;index  1 - replaces RestoreHealth01
		AddToList(NewIngredients, Game.GetFormFromFile(0x0201391D, "Dawnguard.esm")) ; Redwater Skooma 				;index  0 - replaces FirebrandWine
		;NOTE - AddForm adds items at index 0 changing the index of each previous entry by one.
		;Thus we add the replacement items in reverse order so that index entries match between the old list and the new list

		SwitchItems(LCCA_DawnguardRecipes,OldIngredients,NewIngredients)
	EndIf
	LCCA_MCMMenuQuest.HF_SwitchItems()
EndFunction
 
Function SwitchItems(FormList RecipeList, FormList OldList, FormList NewList)
	Int Size = RecipeList.GetSize()
	While Size >= 0
		Size -= 1
		ConstructibleObject CurrentRecipe = RecipeList.GetAt(Size) as ConstructibleObject
                Int OSize = OldList.GetSize()
		While OSize >= 0
			OSize -= 1
			If CurrentRecipe.GetResult() == OldList.GetAt(OSize)
				CurrentRecipe.SetResult(NewList.GetAt(Osize))
                                OSize = -1 ;got what we need, did what we need stop loop
			EndIf
		EndWhile
		;with only three workbenches to deal with, we skip the formlist build and compare direcly
		If CurrentRecipe.GetWorkbenchKeyword() == WBPHCookPot_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingCookpot)
		ElseIf CurrentRecipe.GetWorkbenchKeyword() == WBPHTanningRack_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingTanningRack)
		ElseIf CurrentRecipe.GetWorkbenchKeyword() == WBPHForge_LCCA
			CurrentRecipe.setWorkbenchKeyword(CraftingSmithingForge)
		EndIf
	EndWhile
EndFunction

 

 

 

As far as your MCM script, I'm not even going to get into it. Those things by nature are long and hard to keep track of what is going on. I'd suggest taking a look at the state variation of the MCM script. However, changing one that is already working in the old way to the 'newer' state way is a royal pain. So if it is working and the above suggestion for the compatibility scripts reduces your processing time sufficiently, then no need to make changes to the MCM.

 

EDIT: tweaked code a bit

 

Thank you so much I'll rework the codes, if I have more errors or issues I'll post the new code for help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...