I've updated one of my mods. It used to have the following script attached to treasSatchelRare
Scriptname JM_BAS_LoadAllIngredients extends ObjectReference {Gives the option of dumping all of your ingredients into a satchel at once}Function JM_LoadAllIngredients(ObjectReference satchelToBeFilled) int ingredientCount = 0 bool dontShowNotification = true ; parameter passed to the removeItem method to indicate whether to inform the player of each move formlist JM_AlchemyIngredients = Game.GetForm(0x020048AD) as formlist ; Ingredient list Message msgAskAboutIngredients = Game.GetForm(0x02000D62) as message ; Message box debug.notification("version 1.0 revision 6") ; Show current revision ingredientCount = game.getplayer().Getitemcount(JM_AlchemyIngredients) ; Count player's ingredients debug.notification("Ingredient count = " + ingredientCount) ; Show count of player's ingredients if (Utility.IsInMenuMode()) ; Check that the user hasn't exited the menu before asking if they want to put their ingredients away if ingredientCount > 0 ; If they have - ask them if they want to put them in the satchel if msgAskAboutIngredients.show() == 0 ; Ask if player wants to transfer all ingredients into satchel: 0 = Yes, 1 = No Game.GetPlayer().RemoveItem(JM_AlchemyIngredients,200,dontShowNotification,satchelToBeFilled) ; Transfer 200 of each ingredient into the satchel debug.notification("All ingredients transferred") endif endif endIfendFunctionEvent OnActivate(ObjectReference akActionRef) GotoState("Disable_OnActivateEvent") JM_LoadAllIngredients(Self) GotoState("")endEventstate Disable_OnActivateEvent event OnActivate(ObjectReference akTriggerRef) ; Do nothing endEventendStateThis was fine except for the fact that the editorIDs seem to change if other mods are loaded.
Looking though posts on here it seemed properties are the way forward. So I wrote a new script as follows:
Scriptname JM_BAS2_LoadAllIngredients extends ObjectReference {Gives the option of dumping all of your ingredients into a satchel at once} Function JM_LoadAllIngredients(ObjectReference satchelToBeFilled) int ingredientCount = 0 bool dontShowNotification = true ; parameter passed to the removeItem method to indicate whether to inform the player of each move debug.notification("version 2.0 revision 1") ; Show current revision ingredientCount = game.getplayer().Getitemcount(JM_AlchemyIngredients) ; Count player's ingredients debug.notification("Ingredient count = " + ingredientCount) ; Show count of player's ingredients; if (Utility.IsInMenuMode()) ; Check that the user hasn't exited the menu before asking if they want to put their ingredients away if ingredientCount > 0 ; If they have any ingredients - ask them if they want to put them in the satchel if msgAskAboutIngredients.show() == 0 ; Ask if player wants to transfer all ingredients into satchel: 0 = Yes, 1 = No Game.GetPlayer().RemoveItem(JM_AlchemyIngredients,200,dontShowNotification,satchelToBeFilled) ; Transfer 200 of each ingredient into the satchel debug.notification("All ingredients transferred") endif endif; endIf endFunction Event OnActivate(ObjectReference akActionRef) GotoState("Disable_OnActivateEvent") JM_LoadAllIngredients(Self) GotoState("")endEventstate Disable_OnActivateEvent event OnActivate(ObjectReference akTriggerRef) ; Do nothing endEventendStateFormList Property JM_AlchemyIngredients Auto Message Property msgAskAboutIngredients Auto The problem I'm having is that if I add the new mod and remove the old one, the old script is still running. Is this supposed to happen?
If I copy the new script over the old one - it will run but the properties don't seem to be working (ingredient count always returns 0) and the message won't show.
Any help would be much appreciated.


