Jump to content

Brogdonc

Premium Member
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Brogdonc

  1. That adjustment worked beautifully! Can't thank you enough for that! I was thinking about adding more levels as I continue to come across resources that really stand out. I will definitely look into index matching arrays if the list needs to grow.
  2. Thank you for your reply! I gave that code a shot only tweaking the spelling for Quantity so it would compile. The enable part of the event now works flawlessly :D counting the total amount of gold in the container before displaying the objects in the next cell. Although For some reason the objects still don't want to disable when gold is removed. Now when All the gold is removed from the chest, no matter how much gold was in the chest or how many of the markers are enabled they all continue to display. Maybe there is something I should be adding to that half of the event or the properties? To add a side note: I was able to get a working script on a ledger as an activator to allow the player to deposit or withdraw gold in increments of 1k 5k and 10k using a small menu system. (I got annoyed that I couldn't take smaller amounts of gold straight from the chest itself). I thought maybe the objects weren't disabling because too much gold is being removed from the chest at once but that doesn't seem to make the markers disappear either. I added the code for the working menu in case anyone finds it useful. The Code:
  3. EDIT: I did some more testing this morning and found that the script is actually working just not as intended. Seems as though the script doesn't count the amount of gold in the chest when gold has been added or removed... Rather it counts the amount deposited or removed at the time the object was activated. I'm assuming this is why if I have > 5000 gold in the chest but added it increments < 5000 the objects don't display. But when I activate the chest and actually add 5k gold or more it displays those objects. Seems like the same is true for the Disable event. It only removes the Marker for the objects tied to 1000 gold If I remove a value less than 500... :( which is why even though I have over 500 gold in the chest... taking out 200 gets rid of the objects... I'm assuming I need to change my script to simply count how much gold is in the chest when the Event starts. Maybe an OnClose event? Not sure how that script would look though.
  4. Hello all, I've spent the past few weeks trying to learn the best way to go about scripting a chest inside one cell of a player home to control the enabling/disabling of 'Treasures' in another cell (player home vault), determine based on the amount of Gold added or removed from that chest. From what I've read and watched so far it seems like this should be a fairly simple task but no success :sad: .. Below is my best attempt thus far at getting a script to work as intended. Everything compiles just fine but unfortunately with what I have only items attached to the marker for Gold >= 1000 will enable. The debug message continues to fire no matter how much gold I put in the chest but the other markers are not displaying when their respective values are added. The other issue is that the OnItemRemoved event doesn't seem to want to disable anything. Once the 1000 gold marker items have displayed, removing all gold from the chest fires the Debug message for ("The treasury has been Depleted") but the maker still leaves the items enabled on the table. I'm certainly still learning so I'm hoping anyone out there with some experience with this can take a look at my script and help identify what I'm missing. Also I'm not sure if it makes a difference but I have the same chest with this script on it linked to another reference safe with the cloud chest script in Breeze Home. My thought was that it would be pretty cool to be able to access the player vault from anyone of the main hold purchasable homes and still have objects inside the treasury impacted. Not sure if that's possible but if so that would be ideal. Thank you for the help! Scriptname DBS_TreasuryDeposit extends ObjectReference ObjectReference Property GMarker1000 AutoObjectReference Property GMarker5000 AutoObjectReference Property GMarker10000 AutoObjectReference Property GMarker25000 AutoObjectReference Property GMarker50000 AutoObjectReference Property GMarker75000 AutoObjectReference Property GMarker100000 AutoObjectReference Property GMarker125000 AutoMiscObject Property Gold001 Auto Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akBaseItem == Gold001 ; If aiItemCount >= 1000 GMarker1000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 5000 GMarker5000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 10000 GMarker10000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 25000 GMarker25000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 50000 GMarker50000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 75000 GMarker75000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 100000 GMarker100000.Enable() debug.notification("The Treasury Has Increased") EndIf If aiItemCount >= 125000 GMarker125000.Enable() debug.notification("The Treasury Has Increased") EndIf EndIfEndEvent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akBaseItem == Gold001 ; If aiItemCount < 115000 GMarker125000.Disable() debug.notification("The treasury has been Depleted") EndIf If aiItemCount < 85000 GMarker100000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 60000 GMarker75000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 40000 GMarker50000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 15000 GMarker25000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 7000 GMarker10000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 2500 GMarker5000.Disable() debug.notification("The Clan's Wealth has Decreased") EndIf If aiItemCount < 500 GMarker1000.Disable() debug.notification("The Clan Treasury has been Depleted") EndIf EndIfEndEvent
×
×
  • Create New...