wilwhitt56 Posted June 25, 2023 Share Posted June 25, 2023 (edited) Found this treasure script here which is for Skyrim LE: https://www.nexusmods.com/skyrim/mods/85045?tab=description The concept seems simple enough,but for some odd reason it's not working for both my mod OR the OG. I'm not quite sure why, but maybe one of y'all can see it? Scriptname TR_treasuryScript extends ObjectReference ObjectReference property Vaultloot01 autoObjectReference property Vaultloot02 autoObjectReference property Vaultloot03 autoObjectReference property Vaultloot04 autoObjectReference property Vaultloot05 autoObjectReference property Vaultloot06 autoObjectReference property VaultLoot07 autoObjectReference property VaultLoot08 autoObjectReference property VaultLoot09 autoObjectReference property Vaultloot10 autoObjectReference property Vaultloot11 autoObjectReference property Vaultloot12 autoObjectReference property Vaultloot13 autoObjectReference property Vaultloot14 autoObjectReference property Vaultloot15 autoObjectReference property Vaultloot16 auto ObjectReference property GoldVault auto Form gold001 int value = 0 int Function ValueChange(Form akBaseItem, int aiItemCount){Returns the value change from moving [aiItemCount] of [akBaseItem]}If akBaseItem==gold001return aiItemCountEndIfEndFunction Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) value += ValueChange(akBaseItem, aiItemCount) if (value >= 1000) Vaultloot01.enable() elseif (value <= 999) Vaultloot01.disable() endif if (value >= 5000) Vaultloot02.enable() elseif (value <= 4999) Vaultloot02.disable() endif if (value >= 10000) Vaultloot03.enable() elseif (value <= 9999) Vaultloot03.disable() endif if (value >= 25000) Vaultloot04.enable() elseif (value <= 24999) Vaultloot04.disable() endif if (value >= 50000) Vaultloot05.enable() elseif (value <= 49999) Vaultloot05.disable() endif if (value >= 100000) Vaultloot06.enable() elseif (value <= 99999) Vaultloot06.disable() endif if (value >= 200000) VaultLoot07.enable() elseif (value <= 199999) VaultLoot07.disable() endif if (value >= 300000) VaultLoot08.enable() elseif (value <= 299999) VaultLoot08.disable() endif if (value >= 400000) VaultLoot09.enable() elseif (value <= 399999) VaultLoot09.disable() endif if (value >= 500000) Vaultloot10.enable() elseif (value <= 499999) Vaultloot10.disable() endif if (value >= 650000) Vaultloot11.enable() elseif (value <= 649999) Vaultloot11.disable() endif if (value >= 850000) Vaultloot12.enable() elseif (value <= 749999) Vaultloot12.disable() endif if (value >= 1000000) Vaultloot13.enable() elseif (value <= 999999) Vaultloot13.disable() endif if (value >= 1250000) Vaultloot14.enable() elseif (value <= 1249999) Vaultloot14.disable() endif if (value >= 1500000) Vaultloot15.enable() elseif (value <= 1499999) Vaultloot15.disable() endif if (value >= 2000000) Vaultloot16.enable() elseif (value <= 1999999) Vaultloot16.disable() endifEndevent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) value -= ValueChange(akBaseItem, aiItemCount) if (value >= 1000) Vaultloot01.enable() elseif (value <= 999) Vaultloot01.disable() endif if (value >= 5000) Vaultloot02.enable() elseif (value <= 4999) Vaultloot02.disable() endif if (value >= 10000) Vaultloot03.enable() elseif (value <= 9999) Vaultloot03.disable() endif if (value >= 25000) Vaultloot04.enable() elseif (value <= 24999) Vaultloot04.disable() endif if (value >= 50000) Vaultloot05.enable() elseif (value <= 49999) Vaultloot05.disable() endif if (value >= 100000) Vaultloot06.enable() elseif (value <= 99999) Vaultloot06.disable() endif if (value >= 200000) VaultLoot07.enable() elseif (value <= 199999) VaultLoot07.disable() endif if (value >= 300000) VaultLoot08.enable() elseif (value <= 299999) VaultLoot08.disable() endif if (value >= 400000) VaultLoot09.enable() elseif (value <= 399999) VaultLoot09.disable() endif if (value >= 500000) Vaultloot10.enable() elseif (value <= 499999) Vaultloot10.disable() endif if (value >= 650000) Vaultloot11.enable() elseif (value <= 649999) Vaultloot11.disable() endif if (value >= 850000) Vaultloot12.enable() elseif (value <= 749999) Vaultloot12.disable() endif if (value >= 1000000) Vaultloot13.enable() elseif (value <= 999999) Vaultloot13.disable() endif if (value >= 1250000) Vaultloot14.enable() elseif (value <= 1249999) Vaultloot14.disable() endif if (value >= 1500000) Vaultloot15.enable() elseif (value <= 1499999) Vaultloot15.disable() endif if (value >= 2000000) Vaultloot16.enable() elseif (value <= 1999999) Vaultloot16.disable() endif Endevent Edited June 25, 2023 by wilwhitt56 Link to comment Share on other sites More sharing options...
rkkn Posted June 25, 2023 Share Posted June 25, 2023 (edited) I don't see anything "wrong" with it, except that it only tracks gold (coins) and nothing else, and can be made much more efficient.is it giving you any errors in the papyrus log? Edited June 25, 2023 by rkkn Link to comment Share on other sites More sharing options...
wilwhitt56 Posted June 25, 2023 Author Share Posted June 25, 2023 I don't see anything "wrong" with it, except that it only tracks gold (coins) and nothing else, and can be made much more efficient.is it giving you any errors in the papyrus log?how do i look at that? Link to comment Share on other sites More sharing options...
rkkn Posted June 26, 2023 Share Posted June 26, 2023 if [Papyrus]bEnableLogging=1 then you can find it near your saves folder\My Games\Skyrim\Logs\Script\ Link to comment Share on other sites More sharing options...
wilwhitt56 Posted June 26, 2023 Author Share Posted June 26, 2023 if [Papyrus]bEnableLogging=1 then you can find it near your saves folder\My Games\Skyrim\Logs\Script\Doesn't seem to be working, do I put it in the script somewhere specific? Link to comment Share on other sites More sharing options...
rkkn Posted June 26, 2023 Share Posted June 26, 2023 the enable logging thing goes in your skyrim.ini Link to comment Share on other sites More sharing options...
jtull1127 Posted June 27, 2023 Share Posted June 27, 2023 I'll tested out the script with some debug notification and its not tracking the gold, gold value stays at 0 and thats why it not working. ill try to find out why and msg a fixed script in a bit Link to comment Share on other sites More sharing options...
jtull1127 Posted June 27, 2023 Share Posted June 27, 2023 The problem is If akBaseItem==gold001 lines doesn't proc for gold coins also i am not sure what the top int part of the script if for or how's it suppose to activate anyway here is a version I got working I tested it a little but if theres any bugs hit me with a reply and I'll try to fix, also if you wanted to do a rewrite I would move the enable/disabling to onclose and leave the on_add/remove items for just the value you also have to set Miscobject Property goldcoin auto as gold001 ObjectReference property Vaultloot01 autoObjectReference property Vaultloot02 autoObjectReference property Vaultloot03 autoObjectReference property Vaultloot04 autoObjectReference property Vaultloot05 autoObjectReference property Vaultloot06 autoObjectReference property VaultLoot07 autoObjectReference property VaultLoot08 autoObjectReference property VaultLoot09 autoObjectReference property Vaultloot10 autoObjectReference property Vaultloot11 autoObjectReference property Vaultloot12 autoObjectReference property Vaultloot13 autoObjectReference property Vaultloot14 autoObjectReference property Vaultloot15 autoObjectReference property Vaultloot16 autoMiscobject Property goldcoin autoObjectReference property GoldVault auto Form gold001 int value = 0 int Function ValueChange(Form akBaseItem, int aiItemCount){Returns the value change from moving [aiItemCount] of [akBaseItem]}If akBaseItem== gold001return aiItemCountEndIfEndFunction Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (akBaseItem as miscobject) == goldcoin value += aiItemCount if (value >= 1000) Vaultloot01.enable() elseif (value <= 999) Vaultloot01.disable() endif if (value >= 5000) Vaultloot02.enable() elseif (value <= 4999) Vaultloot02.disable() endif if (value >= 10000) Vaultloot03.enable() elseif (value <= 9999) Vaultloot03.disable() endif if (value >= 25000) Vaultloot04.enable() elseif (value <= 24999) Vaultloot04.disable() endif if (value >= 50000) Vaultloot05.enable() elseif (value <= 49999) Vaultloot05.disable() endif if (value >= 100000) Vaultloot06.enable() elseif (value <= 99999) Vaultloot06.disable() endif if (value >= 200000) VaultLoot07.enable() elseif (value <= 199999) VaultLoot07.disable() endif if (value >= 300000) VaultLoot08.enable() elseif (value <= 299999) VaultLoot08.disable() endif if (value >= 400000) VaultLoot09.enable() elseif (value <= 399999) VaultLoot09.disable() endif if (value >= 500000) Vaultloot10.enable() elseif (value <= 499999) Vaultloot10.disable() endif if (value >= 650000) Vaultloot11.enable() elseif (value <= 649999) Vaultloot11.disable() endif if (value >= 850000) Vaultloot12.enable() elseif (value <= 749999) Vaultloot12.disable() endif if (value >= 1000000) Vaultloot13.enable() elseif (value <= 999999) Vaultloot13.disable() endif if (value >= 1250000) Vaultloot14.enable() elseif (value <= 1249999) Vaultloot14.disable() endif if (value >= 1500000) Vaultloot15.enable() elseif (value <= 1499999) Vaultloot15.disable() endif if (value >= 2000000) Vaultloot16.enable() elseif (value <= 1999999) Vaultloot16.disable() endif endif Endevent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) if (akBaseItem as miscobject) == goldcoin value -= aiItemCount if (value >= 1000) Vaultloot01.enable() elseif (value <= 999) Vaultloot01.disable() endif if (value >= 5000) Vaultloot02.enable() elseif (value <= 4999) Vaultloot02.disable() endif if (value >= 10000) Vaultloot03.enable() elseif (value <= 9999) Vaultloot03.disable() endif if (value >= 25000) Vaultloot04.enable() elseif (value <= 24999) Vaultloot04.disable() endif if (value >= 50000) Vaultloot05.enable() elseif (value <= 49999) Vaultloot05.disable() endif if (value >= 100000) Vaultloot06.enable() elseif (value <= 99999) Vaultloot06.disable() endif if (value >= 200000) VaultLoot07.enable() elseif (value <= 199999) VaultLoot07.disable() endif if (value >= 300000) VaultLoot08.enable() elseif (value <= 299999) VaultLoot08.disable() endif if (value >= 400000) VaultLoot09.enable() elseif (value <= 399999) VaultLoot09.disable() endif if (value >= 500000) Vaultloot10.enable() elseif (value <= 499999) Vaultloot10.disable() endif if (value >= 650000) Vaultloot11.enable() elseif (value <= 649999) Vaultloot11.disable() endif if (value >= 850000) Vaultloot12.enable() elseif (value <= 749999) Vaultloot12.disable() endif if (value >= 1000000) Vaultloot13.enable() elseif (value <= 999999) Vaultloot13.disable() endif if (value >= 1250000) Vaultloot14.enable() elseif (value <= 1249999) Vaultloot14.disable() endif if (value >= 1500000) Vaultloot15.enable() elseif (value <= 1499999) Vaultloot15.disable() endif if (value >= 2000000) Vaultloot16.enable() elseif (value <= 1999999) Vaultloot16.disable() endif endifEndevent Link to comment Share on other sites More sharing options...
Recommended Posts