Tes4Mod:Cobl/Modding/Alchemical Sorter
The UESPWiki – Your source for The Elder Scrolls since 1995
COBL (Common Oblivion) contains an alchemical sorter by PhoenixAmon (nee Daleth). Detailed usage notes are given below. Note that COBL will likely soon include an OBSE override for the default vanilla version described here.
Note: The following docs were written for the original version of the Cobl Alchemical sorters. Editors ids have changed somewhat since then and an OBSE mode has been added. Hence the docs may be somewhat in error. Use your head.
Contents |
[edit] Modder Basics
Simplest usage by modders is to drop one of the existing alchemical sorter containers in their mod. These are single containers that have the appearance of a shelf of containers (i.e., although the mesh looks like several different containers, it's actually just one.) You'll find these under containers -- their editors ids start with with cobAlsShelf (LC, MC and UC indicate Lower Class, Middle Class and Upper Class respectively).
If you want to use a different container mesh (standard chest, standard cabinet, etc.) just create the container object as desired, and set its script to cobAlsTriggerOS. (Note: Make sure that the container is not set to respawn.)
Most likely, that's all you'll need to do. However, if you want to do more (create portable sorters, use multiple containers, etc.), then read on...
Tip: If you would like the shelves to look like they're built into the wall, you might use cobAlsShelfMC and push it back into the wall until the backing is hidden. If the backing sticks out slightly to the side of a narrow wall, then try changing the scale of the reference to shrink it.
[edit] Remote Access
By default, the sorter stores all ingredients in one container and all 3 of its functions are triggered by that container. If you want to use that default behavior, you only need to add your own storage container using whatever mesh you like, make sure it is not set to respawn, and attach the Trigger script.
You can set this up differently, and the trigger script is commented more heavily than you probably need. :) The main thing you need to know is if you want objects or actors other than the storage bin to trigger the effects, you needs your storage container to be a Persistent Reference with a unique name. You'll then need to clone the parts of the trigger script you want to use and replace "GetSelf" with the name of your container reference.
[edit] Multiple Containers
If you want to use multiple containers to store your alchemy ingredients, you need to do a bit more work. I'll do my best to explain that here. First off, you still need a main storage container. This container should be placed in the gameworld somewhere outside of the player's sight (the way merchant containers are). Make sure it is not set to respawn. Once it's placed, make it a Persistent Reference and give it a unique name. In my samples, I'll call it "MyMainContainerRef".
You will need an object or actor to trigger the Storage part of the sorter, with a trimmed-down version of the trigger script mentioned above. If you look at the trigger script, it'll be easy to see what you need.
At this point you can choose to use a separate container for each ingredient name or a separate container for each potion effect.
[edit] Separate Containers by Ingredient
You need one container for every ingredient name. There are several sets you can download or you can make your own. You do not need to make these containers persistent references. Each container needs to have a script like the following:
scn AlchContAlkanetFlower
short iCount
ref rContainer
ref rIngredient
Begin OnActivate player
set rContainer to GetSelf
set rIngredient to AlkanetFlower
set iCount to MyMainContainerRef.GetItemCount rIngredient
If iCount > 0
MyMainContainerRef.RemoveItem rIngredient iCount
rContainer.AddItem rIngredient iCount
EndIf
Activate
End
Each script only needs 2 things changed: the script name and the "set rIngredient to " line. Of course you also need to change "MyMainContainerRef" to the reference name you gave to your main container. Now after your trigger object or actor has put the ingredients away into the main storage container, the player can activate the small containers to take ingredients out by name.
[edit] Separate Containers by Effect
You need one container for every potion effect the player can make. I don't know of any downloadable sets for this. You do not need to make these containers persistent. Each container needs to have a script like the following:
scn AlchContBurdenScr
short bActive
short bEmpty
float Timer
Begin OnActivate player
set cobAlsSorter1.iBurden to 1
set cobAlsCounterVars.bEffectContainers to 1
set cobAlsCounter1.rContainer to MyMainContainerRef
set cobAlsCounter1.iAlchSkill to player.GetBaseAV Alchemy
set cobAlsSorter1.fQuestDelayTime to 0.01
set bActive to 1
StartQuest cobAlsSorter1
End
Begin GameMode
If bActive == 1
If Timer < 0.7
set Timer to Timer + GetSecondsPassed
Else
cobAlchTempRef.Activate player
set Timer to 0
set bEmpty to 1
set bActive to 0
EndIf
EndIf
If bEmpty == 1
cobAlchTempRef.RemoveAllItems MyMainContainerRef
set bEmpty to 0
EndIf
End
That might look a little horrid, but you only need to change a few things for each effect container. Each needs it's own script name. Each needs "MyMainContainerRef" changed to the name of your main container reference.
The only other line to worry about is "set cobAlsSorter1.iBurden to 1". In that line, you need to change "Burden" to the name of the effect for the particular container. Remove any spaces or dashes (-) from the effect name, like the ones listed below.
In that same line, you need to set the right quest name for the effect you're working on. I tried to put all those variables in a single script, but it didn't work as I'd hoped so I had to split them up. The correct quest names are as follows:
cobAlsSorter1 --
iBurden
iChameleon
iCureDisease
iCureParalysis
iCurePoison
iDamageAgility
iDamageEndurance
iDamageFatigue
iDamageHealth
iDamageIntelligence
iDamageLuck
iDamageMagicka
cobAlsSorter2 --
iDamagePersonality
iDamageSpeed
iDamageStrength
iDamageWillpower
iDetectLife
iDispel
iDrainHealth
iFeather
iFireDamage
iFireShield
iFortifyAgility
iFortifyEndurance
iFortifyFatigue
iFortifyHealth
iFortifyIntelligence
iFortifyLuck
iFortifyMagicka
iFortifyPersonality
iFortifySpeed
iFortifyStrength
iFortifyWillpower
cobAlsSorter3 --
iFrostDamage
iFrostShield
iInvisibility
iLight
iNightEye
iParalyze
iReflectDamage
iReflectSpell
iResistDisease
iResistFire
iResistFrost
iResistParalysis
iResistPoison
iResistShock
iRestoreAgility
iRestoreEndurance
iRestoreFatigue
iRestoreHealth
iRestoreIntelligence
iRestoreLuck
iRestoreMagicka
iRestorePersonality
iRestoreSpeed
iRestoreStrength
iRestoreWillpower
cobAlsSorter4 --
iShield
iShockDamage
iShockShield
iSilence
iWaterBreathing
iWaterWalking

![[Content is available under Attribution-ShareAlike]](http://www.uesp.net/w/images/Somerights.png)