to automatically sort and move objects from inventory to containers, interger value is not displaying correctly."
Start of Thread ***
Hello all, Im writing a script that will sort through the players inventory and move certain object types
into thier appropriate Containers throughout my Custom Underground Dwelling.
I had it working just fine before but did some uninstalling/installing of the Game, deleting of saves and
such. After doing most of that i realized I had deleted my .psc files (still learning papyrus and scripting
at this point, and didn't realize the scripts source were in a separate file, I had only backed up my
custom .pex files.) and since my script was not completely finished I had to rewrite it back from scratch.
There is alot of functionality that is currently commented out but i feel it is best not to remove anything from the script so i will put the actual script in spoiler tags.
Spoiler
Scriptname rhodes_Script_SortPlayerInventory extends objectReference
{Script to Sort through the player inventory and move Items to the various chest's in Greylords Sanctum.}
; *** Variables ***
int Max = 100
objectReference BookChest
objectReference DwarvenChest
objectReference EnchantingChest
objectReference FoodChest
objectReference GemChest
objectReference HideChest
objectReference IngotChest
objectReference IngredientChest
objectReference JewelryChest
objectReference LeatherChest
objectReference PotionChest
objectReference RawMaterialChest
objectReference ScrollChest
objectReference ESGChest
objectReference FSGChest
objectReference FrSGChest
objectReference Vault
Formlist BookList
Formlist DwarvenList
Formlist FoodList
Formlist GemList
Formlist HideList
Formlist IngotList
Formlist IngredientList
Formlist JewelryList
Formlist LeatherList
Formlist RawMaterialList
Formlist ESGList
Formlist FSGList
Formlist FrSGList
; *** PROPERTIES ***
; * Containers *
objectReference property rhodes_GreylordSanctum_Chest_Books auto
objectReference property rhodes_GreylordSanctum_Chest_Dwarven auto
objectReference property rhodes_GreylordSanctum_Chest_Food auto
objectReference property rhodes_GreylordSanctum_Chest_Gem auto
objectReference property rhodes_GreylordSanctum_Chest_Hides auto
objectReference property rhodes_GreylordSanctum_Chest_Ingots auto
objectReference property rhodes_GreylordSanctum_Chest_Jewelry auto
objectReference property rhodes_GreylordSanctum_Chest_Leathers auto
objectReference property rhodes_GreylordSanctum_Chest_Potions auto
objectReference property rhodes_GreylordSanctum_Chest_Scrolls auto
objectReference property rhodes_GreylordSanctum_Chest_SmithyRawMaterials auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsEmpty auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsFilled auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsFragments auto
objectReference property rhodes_GreylordSanctum_Satchel_Ingredients auto
objectReference property rhodes_GreylordSanctum_Satchel_Enchanting auto
objectReference property rhodes_GreylordSanctum_Vault auto
; * Vanilla Ingots/forgable resources *
miscObject property IngotCorundum auto
miscObject property IngotDwarven auto
miscObject property IngotEbony auto
miscObject property IngotGold auto
miscObject property IngotIron auto
miscObject property IngotMalachite auto
miscObject property IngotMoonstone auto
miscObject property IngotOrichalcum auto
miscObject property IngotQuicksilver auto
miscObject property ingotSilver auto
miscObject property IngotSteel auto
miscObject property DragonBone auto
miscObject property DragonScales auto
miscObject property ChaurusChitin auto
; * My custom Ingots TODO:: Implement these at some time. *
;miscObject property rhodes_GreylordSanctum_IngotCordite auto
;miscObject property rhodes_GreylordSanctum_IngotTitanium auto
; * Vanilla Ores/smithable resources * TODO: Dwarven
miscObject property OreCorundum auto
miscObject property OreEbony auto
miscObject property OreGold auto
miscObject property OreIron auto
miscObject property OreMalachite auto
miscObject property OreMoonstone auto
miscObject property OreOrichalcum auto
miscObject property OreQuicksilver auto
miscObject property OreSilver auto
; * SoulGemsEmpty *
soulgem property SoulGemBlack auto
soulgem property SoulGemGrand auto
soulgem property SoulGemGreater auto
soulgem property SoulGemCommon auto
soulgem property SoulGemLesser auto
soulgem property SoulGemPetty auto
; * SoulGemsFilled *
soulgem property SoulGemBlackFilled auto
soulgem property SoulGemGrandFilled auto
soulgem property SoulGemGreaterFilled auto
soulgem property SoulGemCommonFilled auto
soulgem property SoulGemLesserFilled auto
soulgem property SoulGemPettyFilled auto
; * SoulGemFragments *
miscObject property SoulGemPiece001 auto
miscObject property SoulGemPiece002 auto
miscObject property SoulGemPiece003 auto
miscObject property SoulGemPiece004 auto
miscObject property SoulGemPiece005 auto
; * FormLists *
Formlist property rhodes_GreylordSanctum_FormList_Books auto
Formlist property rhodes_GreylordSanctum_FormList_Dwarven auto
Formlist property rhodes_GreylordSanctum_FormList_Food auto
Formlist property rhodes_GreylordSanctum_FormList_Gems auto
Formlist property rhodes_GreylordSanctum_FormList_Hides auto
Formlist property rhodes_GreylordSanctum_FormList_Ingots auto
Formlist property rhodes_GreylordSanctum_FormList_Ingredients auto
Formlist property rhodes_GreylordSanctum_FormList_Jewelry auto
Formlist property rhodes_GreylordSanctum_FormList_Leathers auto
Formlist property rhodes_GreylordSanctum_FormList_SmithyRawMaterials auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Empty auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Filled auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Fragments auto
; General Messages
Message property rhodes_GreylordSanctum_BooksSortedMessage auto
Message property rhodes_GreylordSanctum_CraftingSuppliesSortedMessage auto; Ingots ish
Message property rhodes_GreylordSanctum_DwarvenObjectsSortedMessage auto
Message property rhodes_GreylordSanctum_FoodsSortedMessage auto
Message property rhodes_GreylordSanctum_GemsSortedMessage auto
Message property rhodes_GreylordSanctum_HidesSortedMessage auto
Message property rhodes_GreylordSanctum_IngredientsSortedMessage auto
Message property rhodes_GreylordSanctum_JewelrySortedMessage auto
Message property rhodes_GreylordSanctum_LeathersSortedMessage auto
Message property rhodes_GreylordSanctum_SmithySuppliesSortedMessage auto; Raw Materials
Message property rhodes_GreylordSanctum_SoulGemsSortedMessage auto
; Type Item Specific Messages (containing an amount)
Message property rhodes_GreylordSanctum_IngotCorundumMessage auto
Message property rhodes_GreylordSanctum_IngotDwarvenMessage auto
Message property rhodes_GreylordSanctum_IngotEbonyMessage auto
Message property rhodes_GreylordSanctum_IngotGoldMessage auto
Message property rhodes_GreylordSanctum_IngotIronMessage auto
Message property rhodes_GreylordSanctum_IngotOrichalcumMessage auto
Message property rhodes_GreylordSanctum_IngotQuicksilverMessage auto
Message property rhodes_GreylordSanctum_IngotSilverMessage auto
Message property rhodes_GreylordSanctum_IngotSteelMessage auto
Message property rhodes_GreylordSanctum_IngotMalachiteMessage auto
Message property rhodes_GreylordSanctum_IngotMoonstoneMessage auto
Message property rhodes_GreylordSanctum_DragonBoneMessage auto
Message property rhodes_GreylordSanctum_DragonScalesMessage auto
Message property rhodes_GreylordSanctum_ChaurusChitinMessage auto
Message property rhodes_GreylordSanctum_LeatherMessage auto
Message property rhodes_GreylordSanctum_LeatherStripsMessage auto
Message property rhodes_GreylordSanctum_IngredientsMessage auto
; * Keywords *
Keyword property VendorItemBook auto
Keyword property VendorItemFood auto
Keyword property VendorItemFoodRaw auto
Keyword property VendorItemGem auto
Keyword property VendorItemSoulGem auto
Event OnActivate(objectReference player)
Debug.Trace("OnActivate Trace Started, # 01")
;Assign variables
BookChest = rhodes_GreylordSanctum_Chest_Books
;DwarvenChest = rhodes_GreylordSanctum_Chest_Dwarven
;EnchantingChest = rhodes_GreylordSanctum_Satchel_Enchanting
;ESGChest = rhodes_GreylordSanctum_Chest_SoulGemsEmpty
;FSGChest = rhodes_GreylordSanctum_Chest_SoulGemsFilled
;FrSGChest = rhodes_GreylordSanctum_Chest_SoulGemsFragments
;FoodChest = rhodes_GreylordSanctum_Chest_Food
;GemChest = rhodes_GreylordSanctum_Chest_Gem
;HideChest = rhodes_GreylordSanctum_Chest_Hides
;IngotChest = rhodes_GreylordSanctum_Chest_Ingots
;IngredientChest = rhodes_GreylordSanctum_Satchel_Ingredients
;JewelryChest = rhodes_GreylordSanctum_Chest_Jewelry
;LeatherChest = rhodes_GreylordSanctum_Chest_Leathers
;PotionChest = rhodes_GreylordSanctum_Chest_Potions
;RawMaterialChest = rhodes_GreylordSanctum_Chest_SmithyRawMaterials
;ScrollChest = rhodes_GreylordSanctum_Chest_Scrolls
;Vault = rhodes_GreylordSanctum_Vault
Debug.Trace("OnActivate Trace Started, # 02")
BookList = rhodes_GreylordSanctum_FormList_Books
;DwarvenList = rhodes_GreylordSanctum_FormList_Dwarven
;ESGList = rhodes_GreylordSanctum_FormList_SoulGems_Empty
;FSGList = rhodes_GreylordSanctum_FormList_SoulGems_Filled
;FrSGList = rhodes_GreylordSanctum_FormList_SoulGems_Fragments
;FoodList = rhodes_GreylordSanctum_FormList_Food
;GemList = rhodes_GreylordSanctum_FormList_Gems
;HideList = rhodes_GreylordSanctum_FormList_Hides
;IngotList = rhodes_GreylordSanctum_FormList_Ingots
;IngredientList = rhodes_GreylordSanctum_FormList_Ingredients
;JewelryList = rhodes_GreylordSanctum_FormList_Jewelry
;LeatherList = rhodes_GreylordSanctum_FormList_Leathers
;RawMaterialList = rhodes_GreylordSanctum_FormList_SmithyRawMaterials
Debug.Trace("OnActivate Trace Started, # 03")
player = Game.GetPlayer()
Debug.Trace("OnActivate Trace Started, # 04")
CheckBooks(player)
;CheckDwarvenObjects(player)
;CheckSoulGems(player)
;CheckFoodStuffs(player)
;CheckGems(player)
;CheckHides(player)
;CheckIngots(player)
;CheckIngredients(player)
;CheckJewelry(player)
;CheckLeather(player)
;CheckRawMaterials(player)
;player.RemoveItem(BookList, Max, true, BookChest)
;player.RemoveItem(DwarvenList, Max, true, DwarvenChest)
;player.RemoveItem(ESGList, Max, true, ESGChest)
;player.RemoveItem(FSGList, Max, true, FSGChest)
;player.RemoveItem(FrSGList, Max, true, FrSGChest)
;player.RemoveItem(FoodList, Max, true, FoodChest)
;player.RemoveItem(GemList, Max, true, GemChest)
;player.RemoveItem(HideList, Max, true, HideChest)
;player.RemoveItem(IngotList, Max, true, IngotChest)
;player.RemoveItem(IngredientList, Max, true, IngredientChest)
;player.RemoveItem(JewelryList, Max, true, JewelryChest)
;player.RemoveItem(LeatherList, Max, true, LeatherChest)
;player.RemoveItem(RawMaterialList, Max, true, RawMaterialChest)
Debug.Trace("OnActivate Trace Started, # 05")
endEvent
Function CheckBooks(objectReference player)
int totalBooks = 0
if(player.GetItemCount(VendorItemBook) > 0)
totalBooks = player.GetItemCount(VendorItemBook)
rhodes_GreylordSanctum_BooksSortedMessage.Show(totalBooks)
player.RemoveItem(BookList, Max, true, BookChest)
Debug.Trace("CK01: CheckBooks(player) has Completed. " + totalBooks + " Total Books Moved.")
endIf
endFunction
Function CheckDwarvenObjects(objectReference player)
int totalDwarvenArtifacts = 0
rhodes_GreylordSanctum_DwarvenObjectsSortedMessage.Show(totalDwarvenArtifacts)
player.RemoveItem(DwarvenList, Max, true, DwarvenChest)
debug.trace("CK02: CheckDwarvenObjects(player) has Completed.")
endFunction
Function CheckSoulGems(objectReference player)
int soulGems = 0
rhodes_GreylordSanctum_SoulGemsSortedMessage.Show(soulGems)
player.RemoveItem(ESGList, Max, true, ESGChest)
player.RemoveItem(FSGList, Max, true, FSGChest)
player.RemoveItem(FrSGList, Max, true, FrSGChest)
debug.trace("CK03: CheckSoulGems(player) has Completed.")
endFunction
Function CheckFoodStuffs(objectReference player)
int totalFoodStuffs = 0
rhodes_GreylordSanctum_FoodsSortedMessage.Show(totalFoodStuffs)
player.RemoveItem(FoodList, Max, true, FoodChest)
debug.trace("CK04: CheckFoodStuffs(player) has Completed.")
endFunction
Function CheckGems(objectReference player)
int totalGems = 0
rhodes_GreylordSanctum_GemsSortedMessage.Show(totalGems)
player.RemoveItem(GemList, Max, true, GemChest)
debug.trace("CK05: CheckGems(player) has Completed.")
endFunction
Function CheckHides(objectReference player)
int totalhides = 0
rhodes_GreylordSanctum_HidesSortedMessage.Show(totalHides)
player.RemoveItem(HideList, Max, true, HideChest)
debug.trace("CK06: CheckHides(player) has Completed.")
endFunction
Function CheckIngots(objectReference player)
int totalIngots = 0
if(player.getItemCount(IngotCorundum) > 0)
int corundum = player.GetItemCount(IngotCorundum)
totalIngots += corundum
rhodes_GreylordSanctum_IngotCorundumMessage.Show(corundum)
Debug.Trace("Player has Moved " + corundum + " Corundum Ingots!")
endIf
if(player.getItemCount(IngotDwarven) > 0)
int dwarven = player.GetItemCount(IngotDwarven)
totalIngots += dwarven
rhodes_GreylordSanctum_IngotDwarvenMessage.Show(dwarven)
Debug.Trace("Player has Moved " + dwarven + " Dwarven Ingots!")
endIf
if(player.getItemCount(IngotEbony) > 0)
int ebony = player.GetItemCount(IngotEbony)
totalIngots += ebony
rhodes_GreylordSanctum_IngotEbonyMessage.Show(ebony)
Debug.Trace("Player has Moved " + ebony + " Ebony Ingots")
endIf
if(player.getItemCount(IngotGold) > 0)
int gold = player.GetItemCount(IngotGold)
totalIngots += gold
rhodes_GreylordSanctum_IngotGoldMessage.Show()
Debug.Trace("Player has Moved " + gold + " Gold Ingots")
endIf
if(player.getItemCount(IngotMoonstone) > 0)
int moonstone = player.GetItemCount(IngotMoonstone)
totalIngots += moonstone
rhodes_GreylordSanctum_IngotMoonstoneMessage.Show()
Debug.Trace("Player has Moved " + moonstone + " Moonstone Ingots")
endIf
if(player.getItemCount(IngotIron) > 0)
int iron = player.GetItemCount(IngotIron)
totalIngots += iron
rhodes_GreylordSanctum_IngotIronMessage.Show()
Debug.Trace("Player has Moved " + iron + " Iron Ingots")
endIf
if(player.getItemCount(IngotMalachite) > 0)
int malachite = player.GetItemCount(IngotMalachite)
totalIngots += malachite
rhodes_GreylordSanctum_IngotMalachiteMessage.Show()
Debug.Trace("Player has Moved " + malachite + " Malachite Ingots")
endIf
if(player.getItemCount(IngotOrichalcum) > 0)
int orichalcum = player.GetItemCount(IngotOrichalcum)
totalIngots += orichalcum
rhodes_GreylordSanctum_IngotOrichalcumMessage.Show()
Debug.Trace("Player has Moved " + orichalcum + " Orichalcum Ingots")
endIf
if(player.getItemCount(IngotQuicksilver) > 0)
int silver = player.GetItemCount(IngotQuicksilver)
totalIngots += silver
rhodes_GreylordSanctum_IngotQuicksilverMessage.Show()
Debug.Trace("Player has Moved " + silver + " Quicksilver Ingots")
endIf
if(player.getItemCount(IngotSilver) > 0)
int silver = player.GetItemCount(IngotSilver)
totalIngots += silver
rhodes_GreylordSanctum_IngotSilverMessage.Show()
Debug.Trace("Player has Moved " + silver + " Silver Ingots")
endIf
if(player.getItemCount(IngotSteel) > 0)
int steel = player.GetItemCount(IngotSteel)
totalIngots += steel
rhodes_GreylordSanctum_IngotSteelMessage.Show()
Debug.Trace("Player has Moved " + steel + " Steel Ingots")
endIf
if(player.getItemCount(DragonBone) > 0)
int bone = player.GetItemCount(DragonBone)
totalIngots += bone
rhodes_GreylordSanctum_DragonBoneMessage.Show()
Debug.Trace("Player has Moved " + bone + " Dragon Bone")
endIf
if(player.getItemCount(DragonScales) > 0)
int scales = player.GetItemCount(DragonScales)
totalIngots += scales
rhodes_GreylordSanctum_DragonScalesMessage.Show()
Debug.Trace("Player has Moved " + scales + " DragonScales")
endIf
if(player.getItemCount(ChaurusChitin) > 0)
int chitin = player.GetItemCount(ChaurusChitin)
totalIngots += chitin
rhodes_GreylordSanctum_ChaurusChitinMessage.Show()
Debug.Trace("Player has Moved " + chitin + " Chaurus Chitin")
endIf
rhodes_GreylordSanctum_CraftingSuppliesSortedMessage.Show(totalIngots)
player.RemoveItem(IngotList, Max, true, IngotChest)
debug.trace("CK07: CheckIngots(player) has Completed.")
endFunction
Function CheckIngredients(objectReference player)
int totalIngredients = 0
rhodes_GreylordSanctum_IngredientsSortedMessage.Show(totalIngredients)
player.RemoveItem(IngredientList, Max, true, IngredientChest)
debug.trace("CK08: CheckIngredients(player) has Completed.")
endFunction
Function CheckJewelry(objectReference player)
int totalJewelry = 0
rhodes_GreylordSanctum_JewelrySortedMessage.Show(totalJewelry)
player.RemoveItem(JewelryList, Max, true, JewelryChest)
debug.trace("CK09: CheckJewelry(player) has Completed.")
endFunction
Function CheckLeather(objectReference player)
int totalLeather = 0
rhodes_GreylordSanctum_LeathersSortedMessage.Show(totalLeather)
player.RemoveItem(LeatherList, Max, true, LeatherChest)
debug.trace("CK10: CheckLeather(player) has Completed.")
endFunction
Function CheckRawMaterials(objectReference player)
int totalResources = 0
rhodes_GreylordSanctum_SmithySuppliesSortedMessage.Show(totalResources)
player.RemoveItem(RawMaterialList, Max, true, RawMaterialChest)
debug.trace("CK011: CheckRawMaterials(player) has Completed.")
endFunction
;LeveledItem Property pReward Auto
;GlobalVariable Property pCount Auto
;message property DA13VesselClue auto
;MiscObject Property IronIngot Auto
;MiscObject Property LeatherStraps Auto
;MiscObject Property DeerHide Auto
;MiscObject Property LeatherStrips Auto
;MiscObject Property Leather Auto
;Weapon Property IronDagger Auto
;Armor Property ArmorHideHelmet Auto
;MiscObject Property Gold001 Auto
;int Property pDone Auto
;Faction Property pTG02ANP Auto
;Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
;EVENT onItemAdded(form itemAdded, int itemCount, objectReference itemRef, objectReference sourceRef)
;EVENT onItemRemoved(form itemAdded, int itemCount, objectReference itemRef, objectReference sourceRef)
;debug.trace("DA13: Check player for items Kesh requested")
;debug.trace("Silver Ingot: "+gotSilverItem)
;debug.trace("Ruby: "+gotRuby)
Scriptname rhodes_Script_SortPlayerInventory extends objectReference
{Script to Sort through the player inventory and move Items to the various chest's in Greylords Sanctum.}
; *** Variables ***
int Max = 100
objectReference BookChest
objectReference DwarvenChest
objectReference EnchantingChest
objectReference FoodChest
objectReference GemChest
objectReference HideChest
objectReference IngotChest
objectReference IngredientChest
objectReference JewelryChest
objectReference LeatherChest
objectReference PotionChest
objectReference RawMaterialChest
objectReference ScrollChest
objectReference ESGChest
objectReference FSGChest
objectReference FrSGChest
objectReference Vault
Formlist BookList
Formlist DwarvenList
Formlist FoodList
Formlist GemList
Formlist HideList
Formlist IngotList
Formlist IngredientList
Formlist JewelryList
Formlist LeatherList
Formlist RawMaterialList
Formlist ESGList
Formlist FSGList
Formlist FrSGList
; *** PROPERTIES ***
; * Containers *
objectReference property rhodes_GreylordSanctum_Chest_Books auto
objectReference property rhodes_GreylordSanctum_Chest_Dwarven auto
objectReference property rhodes_GreylordSanctum_Chest_Food auto
objectReference property rhodes_GreylordSanctum_Chest_Gem auto
objectReference property rhodes_GreylordSanctum_Chest_Hides auto
objectReference property rhodes_GreylordSanctum_Chest_Ingots auto
objectReference property rhodes_GreylordSanctum_Chest_Jewelry auto
objectReference property rhodes_GreylordSanctum_Chest_Leathers auto
objectReference property rhodes_GreylordSanctum_Chest_Potions auto
objectReference property rhodes_GreylordSanctum_Chest_Scrolls auto
objectReference property rhodes_GreylordSanctum_Chest_SmithyRawMaterials auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsEmpty auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsFilled auto
objectReference property rhodes_GreylordSanctum_Chest_SoulGemsFragments auto
objectReference property rhodes_GreylordSanctum_Satchel_Ingredients auto
objectReference property rhodes_GreylordSanctum_Satchel_Enchanting auto
objectReference property rhodes_GreylordSanctum_Vault auto
; * Vanilla Ingots/forgable resources *
miscObject property IngotCorundum auto
miscObject property IngotDwarven auto
miscObject property IngotEbony auto
miscObject property IngotGold auto
miscObject property IngotIron auto
miscObject property IngotMalachite auto
miscObject property IngotMoonstone auto
miscObject property IngotOrichalcum auto
miscObject property IngotQuicksilver auto
miscObject property ingotSilver auto
miscObject property IngotSteel auto
miscObject property DragonBone auto
miscObject property DragonScales auto
miscObject property ChaurusChitin auto
; * My custom Ingots TODO:: Implement these at some time. *
;miscObject property rhodes_GreylordSanctum_IngotCordite auto
;miscObject property rhodes_GreylordSanctum_IngotTitanium auto
; * Vanilla Ores/smithable resources * TODO: Dwarven
miscObject property OreCorundum auto
miscObject property OreEbony auto
miscObject property OreGold auto
miscObject property OreIron auto
miscObject property OreMalachite auto
miscObject property OreMoonstone auto
miscObject property OreOrichalcum auto
miscObject property OreQuicksilver auto
miscObject property OreSilver auto
; * SoulGemsEmpty *
soulgem property SoulGemBlack auto
soulgem property SoulGemGrand auto
soulgem property SoulGemGreater auto
soulgem property SoulGemCommon auto
soulgem property SoulGemLesser auto
soulgem property SoulGemPetty auto
; * SoulGemsFilled *
soulgem property SoulGemBlackFilled auto
soulgem property SoulGemGrandFilled auto
soulgem property SoulGemGreaterFilled auto
soulgem property SoulGemCommonFilled auto
soulgem property SoulGemLesserFilled auto
soulgem property SoulGemPettyFilled auto
; * SoulGemFragments *
miscObject property SoulGemPiece001 auto
miscObject property SoulGemPiece002 auto
miscObject property SoulGemPiece003 auto
miscObject property SoulGemPiece004 auto
miscObject property SoulGemPiece005 auto
; * FormLists *
Formlist property rhodes_GreylordSanctum_FormList_Books auto
Formlist property rhodes_GreylordSanctum_FormList_Dwarven auto
Formlist property rhodes_GreylordSanctum_FormList_Food auto
Formlist property rhodes_GreylordSanctum_FormList_Gems auto
Formlist property rhodes_GreylordSanctum_FormList_Hides auto
Formlist property rhodes_GreylordSanctum_FormList_Ingots auto
Formlist property rhodes_GreylordSanctum_FormList_Ingredients auto
Formlist property rhodes_GreylordSanctum_FormList_Jewelry auto
Formlist property rhodes_GreylordSanctum_FormList_Leathers auto
Formlist property rhodes_GreylordSanctum_FormList_SmithyRawMaterials auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Empty auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Filled auto
Formlist property rhodes_GreylordSanctum_FormList_SoulGems_Fragments auto
; General Messages
Message property rhodes_GreylordSanctum_BooksSortedMessage auto
Message property rhodes_GreylordSanctum_CraftingSuppliesSortedMessage auto; Ingots ish
Message property rhodes_GreylordSanctum_DwarvenObjectsSortedMessage auto
Message property rhodes_GreylordSanctum_FoodsSortedMessage auto
Message property rhodes_GreylordSanctum_GemsSortedMessage auto
Message property rhodes_GreylordSanctum_HidesSortedMessage auto
Message property rhodes_GreylordSanctum_IngredientsSortedMessage auto
Message property rhodes_GreylordSanctum_JewelrySortedMessage auto
Message property rhodes_GreylordSanctum_LeathersSortedMessage auto
Message property rhodes_GreylordSanctum_SmithySuppliesSortedMessage auto; Raw Materials
Message property rhodes_GreylordSanctum_SoulGemsSortedMessage auto
; Type Item Specific Messages (containing an amount)
Message property rhodes_GreylordSanctum_IngotCorundumMessage auto
Message property rhodes_GreylordSanctum_IngotDwarvenMessage auto
Message property rhodes_GreylordSanctum_IngotEbonyMessage auto
Message property rhodes_GreylordSanctum_IngotGoldMessage auto
Message property rhodes_GreylordSanctum_IngotIronMessage auto
Message property rhodes_GreylordSanctum_IngotOrichalcumMessage auto
Message property rhodes_GreylordSanctum_IngotQuicksilverMessage auto
Message property rhodes_GreylordSanctum_IngotSilverMessage auto
Message property rhodes_GreylordSanctum_IngotSteelMessage auto
Message property rhodes_GreylordSanctum_IngotMalachiteMessage auto
Message property rhodes_GreylordSanctum_IngotMoonstoneMessage auto
Message property rhodes_GreylordSanctum_DragonBoneMessage auto
Message property rhodes_GreylordSanctum_DragonScalesMessage auto
Message property rhodes_GreylordSanctum_ChaurusChitinMessage auto
Message property rhodes_GreylordSanctum_LeatherMessage auto
Message property rhodes_GreylordSanctum_LeatherStripsMessage auto
Message property rhodes_GreylordSanctum_IngredientsMessage auto
; * Keywords *
Keyword property VendorItemBook auto
Keyword property VendorItemFood auto
Keyword property VendorItemFoodRaw auto
Keyword property VendorItemGem auto
Keyword property VendorItemSoulGem auto
Event OnActivate(objectReference player)
Debug.Trace("OnActivate Trace Started, # 01")
;Assign variables
BookChest = rhodes_GreylordSanctum_Chest_Books
;DwarvenChest = rhodes_GreylordSanctum_Chest_Dwarven
;EnchantingChest = rhodes_GreylordSanctum_Satchel_Enchanting
;ESGChest = rhodes_GreylordSanctum_Chest_SoulGemsEmpty
;FSGChest = rhodes_GreylordSanctum_Chest_SoulGemsFilled
;FrSGChest = rhodes_GreylordSanctum_Chest_SoulGemsFragments
;FoodChest = rhodes_GreylordSanctum_Chest_Food
;GemChest = rhodes_GreylordSanctum_Chest_Gem
;HideChest = rhodes_GreylordSanctum_Chest_Hides
;IngotChest = rhodes_GreylordSanctum_Chest_Ingots
;IngredientChest = rhodes_GreylordSanctum_Satchel_Ingredients
;JewelryChest = rhodes_GreylordSanctum_Chest_Jewelry
;LeatherChest = rhodes_GreylordSanctum_Chest_Leathers
;PotionChest = rhodes_GreylordSanctum_Chest_Potions
;RawMaterialChest = rhodes_GreylordSanctum_Chest_SmithyRawMaterials
;ScrollChest = rhodes_GreylordSanctum_Chest_Scrolls
;Vault = rhodes_GreylordSanctum_Vault
Debug.Trace("OnActivate Trace Started, # 02")
BookList = rhodes_GreylordSanctum_FormList_Books
;DwarvenList = rhodes_GreylordSanctum_FormList_Dwarven
;ESGList = rhodes_GreylordSanctum_FormList_SoulGems_Empty
;FSGList = rhodes_GreylordSanctum_FormList_SoulGems_Filled
;FrSGList = rhodes_GreylordSanctum_FormList_SoulGems_Fragments
;FoodList = rhodes_GreylordSanctum_FormList_Food
;GemList = rhodes_GreylordSanctum_FormList_Gems
;HideList = rhodes_GreylordSanctum_FormList_Hides
;IngotList = rhodes_GreylordSanctum_FormList_Ingots
;IngredientList = rhodes_GreylordSanctum_FormList_Ingredients
;JewelryList = rhodes_GreylordSanctum_FormList_Jewelry
;LeatherList = rhodes_GreylordSanctum_FormList_Leathers
;RawMaterialList = rhodes_GreylordSanctum_FormList_SmithyRawMaterials
Debug.Trace("OnActivate Trace Started, # 03")
player = Game.GetPlayer()
Debug.Trace("OnActivate Trace Started, # 04")
CheckBooks(player)
;CheckDwarvenObjects(player)
;CheckSoulGems(player)
;CheckFoodStuffs(player)
;CheckGems(player)
;CheckHides(player)
;CheckIngots(player)
;CheckIngredients(player)
;CheckJewelry(player)
;CheckLeather(player)
;CheckRawMaterials(player)
;player.RemoveItem(BookList, Max, true, BookChest)
;player.RemoveItem(DwarvenList, Max, true, DwarvenChest)
;player.RemoveItem(ESGList, Max, true, ESGChest)
;player.RemoveItem(FSGList, Max, true, FSGChest)
;player.RemoveItem(FrSGList, Max, true, FrSGChest)
;player.RemoveItem(FoodList, Max, true, FoodChest)
;player.RemoveItem(GemList, Max, true, GemChest)
;player.RemoveItem(HideList, Max, true, HideChest)
;player.RemoveItem(IngotList, Max, true, IngotChest)
;player.RemoveItem(IngredientList, Max, true, IngredientChest)
;player.RemoveItem(JewelryList, Max, true, JewelryChest)
;player.RemoveItem(LeatherList, Max, true, LeatherChest)
;player.RemoveItem(RawMaterialList, Max, true, RawMaterialChest)
Debug.Trace("OnActivate Trace Started, # 05")
endEvent
Function CheckBooks(objectReference player)
int totalBooks = 0
if(player.GetItemCount(VendorItemBook) > 0)
totalBooks = player.GetItemCount(VendorItemBook)
rhodes_GreylordSanctum_BooksSortedMessage.Show(totalBooks)
player.RemoveItem(BookList, Max, true, BookChest)
Debug.Trace("CK01: CheckBooks(player) has Completed. " + totalBooks + " Total Books Moved.")
endIf
endFunction
Function CheckDwarvenObjects(objectReference player)
int totalDwarvenArtifacts = 0
rhodes_GreylordSanctum_DwarvenObjectsSortedMessage.Show(totalDwarvenArtifacts)
player.RemoveItem(DwarvenList, Max, true, DwarvenChest)
debug.trace("CK02: CheckDwarvenObjects(player) has Completed.")
endFunction
Function CheckSoulGems(objectReference player)
int soulGems = 0
rhodes_GreylordSanctum_SoulGemsSortedMessage.Show(soulGems)
player.RemoveItem(ESGList, Max, true, ESGChest)
player.RemoveItem(FSGList, Max, true, FSGChest)
player.RemoveItem(FrSGList, Max, true, FrSGChest)
debug.trace("CK03: CheckSoulGems(player) has Completed.")
endFunction
Function CheckFoodStuffs(objectReference player)
int totalFoodStuffs = 0
rhodes_GreylordSanctum_FoodsSortedMessage.Show(totalFoodStuffs)
player.RemoveItem(FoodList, Max, true, FoodChest)
debug.trace("CK04: CheckFoodStuffs(player) has Completed.")
endFunction
Function CheckGems(objectReference player)
int totalGems = 0
rhodes_GreylordSanctum_GemsSortedMessage.Show(totalGems)
player.RemoveItem(GemList, Max, true, GemChest)
debug.trace("CK05: CheckGems(player) has Completed.")
endFunction
Function CheckHides(objectReference player)
int totalhides = 0
rhodes_GreylordSanctum_HidesSortedMessage.Show(totalHides)
player.RemoveItem(HideList, Max, true, HideChest)
debug.trace("CK06: CheckHides(player) has Completed.")
endFunction
Function CheckIngots(objectReference player)
int totalIngots = 0
if(player.getItemCount(IngotCorundum) > 0)
int corundum = player.GetItemCount(IngotCorundum)
totalIngots += corundum
rhodes_GreylordSanctum_IngotCorundumMessage.Show(corundum)
Debug.Trace("Player has Moved " + corundum + " Corundum Ingots!")
endIf
if(player.getItemCount(IngotDwarven) > 0)
int dwarven = player.GetItemCount(IngotDwarven)
totalIngots += dwarven
rhodes_GreylordSanctum_IngotDwarvenMessage.Show(dwarven)
Debug.Trace("Player has Moved " + dwarven + " Dwarven Ingots!")
endIf
if(player.getItemCount(IngotEbony) > 0)
int ebony = player.GetItemCount(IngotEbony)
totalIngots += ebony
rhodes_GreylordSanctum_IngotEbonyMessage.Show(ebony)
Debug.Trace("Player has Moved " + ebony + " Ebony Ingots")
endIf
if(player.getItemCount(IngotGold) > 0)
int gold = player.GetItemCount(IngotGold)
totalIngots += gold
rhodes_GreylordSanctum_IngotGoldMessage.Show()
Debug.Trace("Player has Moved " + gold + " Gold Ingots")
endIf
if(player.getItemCount(IngotMoonstone) > 0)
int moonstone = player.GetItemCount(IngotMoonstone)
totalIngots += moonstone
rhodes_GreylordSanctum_IngotMoonstoneMessage.Show()
Debug.Trace("Player has Moved " + moonstone + " Moonstone Ingots")
endIf
if(player.getItemCount(IngotIron) > 0)
int iron = player.GetItemCount(IngotIron)
totalIngots += iron
rhodes_GreylordSanctum_IngotIronMessage.Show()
Debug.Trace("Player has Moved " + iron + " Iron Ingots")
endIf
if(player.getItemCount(IngotMalachite) > 0)
int malachite = player.GetItemCount(IngotMalachite)
totalIngots += malachite
rhodes_GreylordSanctum_IngotMalachiteMessage.Show()
Debug.Trace("Player has Moved " + malachite + " Malachite Ingots")
endIf
if(player.getItemCount(IngotOrichalcum) > 0)
int orichalcum = player.GetItemCount(IngotOrichalcum)
totalIngots += orichalcum
rhodes_GreylordSanctum_IngotOrichalcumMessage.Show()
Debug.Trace("Player has Moved " + orichalcum + " Orichalcum Ingots")
endIf
if(player.getItemCount(IngotQuicksilver) > 0)
int silver = player.GetItemCount(IngotQuicksilver)
totalIngots += silver
rhodes_GreylordSanctum_IngotQuicksilverMessage.Show()
Debug.Trace("Player has Moved " + silver + " Quicksilver Ingots")
endIf
if(player.getItemCount(IngotSilver) > 0)
int silver = player.GetItemCount(IngotSilver)
totalIngots += silver
rhodes_GreylordSanctum_IngotSilverMessage.Show()
Debug.Trace("Player has Moved " + silver + " Silver Ingots")
endIf
if(player.getItemCount(IngotSteel) > 0)
int steel = player.GetItemCount(IngotSteel)
totalIngots += steel
rhodes_GreylordSanctum_IngotSteelMessage.Show()
Debug.Trace("Player has Moved " + steel + " Steel Ingots")
endIf
if(player.getItemCount(DragonBone) > 0)
int bone = player.GetItemCount(DragonBone)
totalIngots += bone
rhodes_GreylordSanctum_DragonBoneMessage.Show()
Debug.Trace("Player has Moved " + bone + " Dragon Bone")
endIf
if(player.getItemCount(DragonScales) > 0)
int scales = player.GetItemCount(DragonScales)
totalIngots += scales
rhodes_GreylordSanctum_DragonScalesMessage.Show()
Debug.Trace("Player has Moved " + scales + " DragonScales")
endIf
if(player.getItemCount(ChaurusChitin) > 0)
int chitin = player.GetItemCount(ChaurusChitin)
totalIngots += chitin
rhodes_GreylordSanctum_ChaurusChitinMessage.Show()
Debug.Trace("Player has Moved " + chitin + " Chaurus Chitin")
endIf
rhodes_GreylordSanctum_CraftingSuppliesSortedMessage.Show(totalIngots)
player.RemoveItem(IngotList, Max, true, IngotChest)
debug.trace("CK07: CheckIngots(player) has Completed.")
endFunction
Function CheckIngredients(objectReference player)
int totalIngredients = 0
rhodes_GreylordSanctum_IngredientsSortedMessage.Show(totalIngredients)
player.RemoveItem(IngredientList, Max, true, IngredientChest)
debug.trace("CK08: CheckIngredients(player) has Completed.")
endFunction
Function CheckJewelry(objectReference player)
int totalJewelry = 0
rhodes_GreylordSanctum_JewelrySortedMessage.Show(totalJewelry)
player.RemoveItem(JewelryList, Max, true, JewelryChest)
debug.trace("CK09: CheckJewelry(player) has Completed.")
endFunction
Function CheckLeather(objectReference player)
int totalLeather = 0
rhodes_GreylordSanctum_LeathersSortedMessage.Show(totalLeather)
player.RemoveItem(LeatherList, Max, true, LeatherChest)
debug.trace("CK10: CheckLeather(player) has Completed.")
endFunction
Function CheckRawMaterials(objectReference player)
int totalResources = 0
rhodes_GreylordSanctum_SmithySuppliesSortedMessage.Show(totalResources)
player.RemoveItem(RawMaterialList, Max, true, RawMaterialChest)
debug.trace("CK011: CheckRawMaterials(player) has Completed.")
endFunction
;LeveledItem Property pReward Auto
;GlobalVariable Property pCount Auto
;message property DA13VesselClue auto
;MiscObject Property IronIngot Auto
;MiscObject Property LeatherStraps Auto
;MiscObject Property DeerHide Auto
;MiscObject Property LeatherStrips Auto
;MiscObject Property Leather Auto
;Weapon Property IronDagger Auto
;Armor Property ArmorHideHelmet Auto
;MiscObject Property Gold001 Auto
;int Property pDone Auto
;Faction Property pTG02ANP Auto
;Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
;EVENT onItemAdded(form itemAdded, int itemCount, objectReference itemRef, objectReference sourceRef)
;EVENT onItemRemoved(form itemAdded, int itemCount, objectReference itemRef, objectReference sourceRef)
;debug.trace("DA13: Check player for items Kesh requested")
;debug.trace("Silver Ingot: "+gotSilverItem)
;debug.trace("Ruby: "+gotRuby)
Now on to my problem...
In the OnActivate Event I make a call to a custom function, i assign the Player Object to a reference
then pass that player reference into my custom function.
Debug.Trace("OnActivate Trace Started, # 03") player = Game.GetPlayer() Debug.Trace("OnActivate Trace Started, # 04") CheckBooks(player)
Inside my custom Function i assign a zero value to the Integer variable "totalBooks". I then do a check
to see if the player's inventory contains any Books based on using the Keyword "VendorItemBook". If
the player has any Books then I assign the value of the number of books to the "totalBooks" variable. I
then pass that variable into a custom Message, which promptly displays on the top left corner of the game
screen.
Message Text
%.0f Books Sorted and Vaulted!
I then use the player.RemoveItem code to look through my List of Books ie.. a FormList and move them
into the appropriate storage Container.
Function CheckBooks(objectReference player) int totalBooks = 0 if(player.GetItemCount(VendorItemBook) > 0) totalBooks = player.GetItemCount(VendorItemBook) rhodes_GreylordSanctum_BooksSortedMessage.Show(totalBooks) player.RemoveItem(BookList, Max, true, BookChest) Debug.Trace("CK01: CheckBooks(player) has Completed. " + totalBooks + " Total Books Moved.") endIfendFunction
All of this Said, The problem I am having is that no matter what books, or how many books I move, the Message always displays 1 less book than what I am moving, so for instance, I put 2 books in my inventory.
1. Brief History of the Empire v1
2. Brief History of the Empire v2
yet when i activate my button the message that comes back to me only shows 1 book being sorted and vaulted, but when i check both my inventory and the chest where they go both books were actually moved.
can anyone see a problem in my code logic? Is there something zero based that i dont know about? any help would be appreciated.
roadmaster