I'll have to look to see how Alchemy Storage Helper works. Does it require MWSE? if it does (it sounds like it would) it will move by ID type and not ID which is what
I was thinking of make a Alchemy Room Mod that either you can attach to your own house or has a ring to get there. I was thinking of having and esm that adds all the ingredients i can come across and make storage containers for them though i have found that some like Provincial Bath Shop(sp?) have a lot of ingredients with the same effects. so i'm not sure how to handle that PBS has 114 ingred but 70 have the same effect.
I have a database for MW+T+B, TR, abotWaterLife, , Pearls Enhanced - Colored Pearls, Morrowind Crafting, Complete Morrowind - Tribunal & Bloodmoon, abotWhereAreAllBirdsGoing, CreaturesX, Sris_Alchemy_BM, Nom 3.0, Nom 2.13.
the nom database is on its own since it changes the effects of MW ingred, i'm going to make one that would cover the changes for SA and another for BTB's...if there are any other ingredient adding Mods that add a lot point them out. I also have tried to work in ingred that are the same in mods but have different ID's so that they will end up in the same container.
it's a bit ambitious but i have gotten the sort unsort script creation down to a science... one day i may divulge my secret.
Yes, Alchemy Storage Helper works with MWSE. It uses three scripts:
Script 1
begin ASH_Inv_S
; is attached to the inventory icon for the satchel
; equipping the satchel allows you to transfer all ingreds to or from the satchel/your inventory
; dropping it activates the sack container
short onPCEquip
short onPCDrop
short msg
short button
long cID
long cQuant
long cType
long junk
long cNextRef
long guyRef
long plrRef
float crap
if ( menuMode == 0 )
return ; only need when inventory is open
endif
ifx ( onPCDrop ) ; player drops the inv item
; xlogmessage "sack dropped."
set onPCDrop to 0
placeAtPC "ASH_Dead_Sack" 1 128 0 ; the interactive satchel container
positionCell 0 0 0 0 "ASH_Test" ; get rid of reference
endif
if ( msg == 1 ) ; waiting for choice
set button to getButtonPressed
if ( button == -1 ) ; no choice yet
return
elseif ( button == 2 ) ; chose "Cancel"
set msg to 0
return
endif ; all other options handled further down
endif
if ( onPCEquip ) ; player equips from inventory
set onPCEquip to 0
messageBox "Transfer all ingredients" "From satchel to inventory" "From inventory to satchel" "Cancel"
set msg to 1
return ; was missing this, big problem
elseif ( msg == 0 ) ; msg is 1 if we have recently made a choice from above
return
endif
; below only runs after making a choice when equipping satchel
;xLogMessage "Transferring ingredients."
setx plrRef to xGetRef "player"
setx guyRef to xGetRef "ASH_Helper"
;setx junk to plrRef->xRefID
;xLogMessage "player ID == %s" junk
;setx junk to guyRef->xRefID
;xLogMessage "guy ID == %s" junk
ifx ( button ) ; inv to satchel
; xLogMessage "From inv to satchel"
setx cId cQuant cType junk crap junk cNextRef to plrRef->xContentList 0
xFileRewind "ASH_Temp" ; temporarily stores ingreds removed from player's inventory
whilex ( cNextRef )
; xLogMessage "Contents: ID=%s count=%d type=%d" cID cQuant cType
set junk to ( cType - 1380404809 )
ifx ( junk ) ; not an ingredient
; xLogMessage "Item %s is not ingredient" cID
else ; ingredient, so transfer it
; xLogMessage "Item == %s quant == %d" cID cQuant
; plrRef->xRemoveItem cId cQuant - do this later
guyRef->xAddItem cId cQuant
xFileWriteString "ASH_Temp" cID
xFileWriteLong "ASH_Temp" cQuant
endif
setx cId cQuant cType junk crap junk cNextRef to plrRef->xContentList cNextRef
endwhile ; continues until inventory has been searched completely
; a possible problem here - if an ingredient is the LAST item in inventory, it may not get recognized
; pretty unlikely though
xFileWriteString "ASH_Temp" "DONE"
; xLogMessage "Done sorting inventory"
xFileRewind "ASH_Temp" ; now remove the ingreds transferred from player's inventory
set cType to 1 ; done here because removing while scanning inventory corrupts the data
whilex ( cType )
setx cID to xFileReadString "ASH_Temp"
setx cType to xStringCompare cID "DONE"
ifx ( cType ) ; not done yet
setx junk cQuant to xFileReadLong "ASH_Temp" 1
plrRef->xRemoveItem cID cQuant
endif
endwhile
; xLogMessage "Removed ingreds from player inv"
set msg to 0
return
else ; satchel to inv
; xLogMessage "Satchel to Inv"
setx cId cQuant cType junk crap junk cNextRef to guyRef->xContentList 0
whilex ( cQuant ) ; no need to check type, sack only contains ingredients unless you manually add something else
; xLogMessage "Contents: ID=%s count=%d type=%d" cID cQuant cType
; xLogMessage "Item == %s quant == %d" cID cQuant
guyRef->xRemoveItem cId cQuant
plrRef->xAddItem cId cQuant
setx cId cQuant cType junk crap junk cNextRef to guyRef->xContentList 0
endwhile
; xLogMessage "Finished transfer"
set msg to 0
return
endif
end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Script 2:
begin ASH_Sack_S
; this is attached to the satchel object which appears in the gameworld
; functions like a container but is actually a corpse
; contains any ingredients which were transferred to sack previously
; when opened and then closed, transfers all ingredients to ASH_Helper
; returns all non-ingredient items to player
long zID
long zQuant
long zType
long zNextRef
long junk
short open
long thisRef
long yourRef
float crap
ifx ( open )
else ; was just placed in gameworld
setx thisRef to xGetRef "ASH_Helper"
setx yourRef to xGetRef "player"
; xLogMessage "Filling sack from NPC inventory"
setx zID zQuant zNextRef to thisRef->xInventory
whilex ( zQuant ) ; fill it from Helper's inventory
thisRef->xRemoveItem zID zQuant
xAddItem zID zQuant
setx zID zQUant zNextRef to thisRef->xInventory
; xLogMessage "Item found"
endwhile
set open to -1
endif
;xLogMessage "sack script running"
if ( onActivate == 1 )
if ( open == -1 ) ; container has not been opened yet
set open to 1
Activate
return
endif
endif
if ( menuMode == 1 )
return
elseif ( open != 1 )
return
endif
;xLogMessage "Sack was closed."
; below only runs outside of menuMode, after container has been opened and then closed
set open to 0
setx thisRef to xGetRef "ASH_Helper"
setx yourRef to xGetRef "player"
setx zID zQuant zType junk crap junk zNextRef to xContentList 0
whilex ( zQuant )
set junk to ( zType - 1380404809 )
ifx ( junk ) ; not an ingredient
xRemoveItem zID zQuant
yourRef->xAddItem zID zQuant ; so give it back to player
else ; ingred
xRemoveItem zID zQUant
thisRef->xAddItem zID zQuant ; transfer to helper
endif
setx zID zQuant zType junk crap junk zNextRef to xContentList 0
endwhile
player->addItem "ASH_Inv" 1 ; give him his satchel back
positionCell 0 0 0 0 "ASH_Test" ; and get lost
end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Script 3
begin ASH_Startup_S
; just initializes the mod by giving satchel to player, once
short init
if ( init == 0 )
set init to 1
player->addItem "ASH_Inv" 1
endif
stopScript ASH_Startup_S
end
---------------------------------------------------------------------------------------------------------------------------------------
What a bit of work with databases, dude :toughninja:
Yes, it's ambitious and a science indeed! A precise task with very useful results, any alchemist it's covered, no matter the mod he or she is using, and that makes your work good and complete : )
Ingredients with different ID seems to be a solution to your problem with ingreds with same effects. I'm not a scripter myself, but I've read many of them to understand what they do
An alchemy room attachable to your own house, this is genius. The ring idea is good too : D