RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 SVN] Universal Storage Keys

Fenn

Wanderer
[RunUO 2.0 SVN] Universal Storage Keys

The Universal Storage Keys!​

Overview
Based roughly on Daat99's storage keys, these are designed to give the developer as much flexibility as possible to allow quick design and maintenance of custom storage solutions for players. Some of the main storage types include:
  • Resource Storage: Items like resources, where the amount is pooled into the keys.
  • Tool Storage: Items like tools where the uses remaining or charges are pooled into the keys.
  • "Generic" Storage: Custom tools like arrow dip tubs from [RunUO 2.0 RC1] Lucid's <<_Advanced Archery_>> or pet leashes from [RunUO 2.0 RC1] FS: Animal Taming Systems Gen2.
  • "List" Storage: Distinguishable items like magic instruments, or treasure maps, where more than one property is needed to describe the item. These are displayed as a list of items, rather than a pooled quantity
  • "Stash" Storage: Complex distinguishable items like weapons, armor, jewelery, or clothing.
  • Key Storage: Store all your key types within a single Master Key!

For players
These items make item storage and management a lot easier and more organized. Multi-use tools can be developed. Thousands upon thousands of stones worth of resources can be easily carried. When you craft, the resources can be directly withdrawn from the keys. When you cast, the reagents can come from the keys. You can use potions and water directly from the keys too!

For developers
These items can significantly cut down the amount of world data on your shard. When items are "stored" within the keys, the physical item itself ceases to exist, while only relevant data (eg. uses remaining for tools, or amount for resources) is preserved. This could significantly reduce item count, and world load/save times, depending on how much stuff your players have stashed away in their houses/banks. Plus, it's easy to follow the example items to make your own type of keys that suit your shard's custom needs. Finally, this system is intended to be as easy to drop in and run as possible, so it should be little hassle to get it working for you.

Compatibility

NOTE: this system requires the CliLoc Handler project to function. After that, this has been tested and proven to work on a fresh download of the following:
  • RunUO RC1
  • RunUO RC2
  • RunUO SVN 313

FAQ and Quick Links

Details

Changelog is listed here.

Installation

  • Unpack this package somewhere within your server's "Scripts" directory
  • Download the Cliloc Handler project and follow its instructions.
  • (optional) Read through the files in the "Server Modification" subdirectory of this package, and follow the instructions. These allow the server to do things like withdraw from keys when crafting, casting, or using arrows
  • (optional) Read through the "Extras.cs" file in the "Extras" subdirectory of this package. If you have the XML attachment system, uncomment line #2 of "Extras.cs" to enable the "[keyguard" command, which lets a player choose which items cannot be pulled into keys.

Customizing

Look in the "Items" subdirectory of this package for example items. In each file, there is a block near the top that looks like this:
Code:
		public override List<StoreEntry> EntryStructure
		{
			get
			{
				List<StoreEntry> entry = base.EntryStructure;
				
				entry.Add( ... ) );
				...

				return entry;
			}
		}
You can modify this to suit your needs, or make new items based on these examples.

Updating

When a new version of this package is released, replace everything but the contents of the "Items" subdirectory. If you make changes to other parts of this package, please feel free to post them in this thread so they can be considered and included with this distribution.


More details are located in the file notes.txt in the main directory of the provided file.
 

Attachments

  • Universal Storage Keys - 2009-05-01.rar
    114.5 KB · Views: 922

Fenn

Wanderer
Upgrade Notes

If you are updating from version 2008-02-17 or later, you need only replace all files except those contained in the "Items" folder. All files in this folder are easily modifiable, and if you have made some changes or additions for your shard, there is no harm in leaving your copies intact. Occasionally some new example items are made available (see changelog for details), but other than that, this directory is yours for the meddling.

If you are upgrading from a version before 2008-02-07, read the changelog for detailed instructions.


Changelog

Version: Last modified Friday, May 1, 2009

Version 2009-05-01

  • Entries:
    • Added GenericDistinguishableEntry. This is similar to GenericEntry where the developer can specify the property of the specified item type that should be added/withdrawn from keys. In addition, the developer can specify some other property within this item class that can distinguish it from other item types. An example of such an item is the classic Fish, where the ItemID distinguishes the different types a player can get. Note that this only works on zero-parameter constructor items for now.
    • Added ChampionSkullEntry to hold champion skulls
    • Overhauled PotionEntry and BeverageEntry add/withdraw mechanism. These entries now leave behind an empty container when the potion/beverage is added to keys. Consequently, the keys require a suitable container when withdrawing potions/beverages. If you prefer the older method of potion/beverage add/withdraw, change the property "EmptyContents" in "Base Items\BaseStoreKey.cs" (line 18) from "true" to "false".
  • List Entries:
    • Created PowerScrollListEntry to hold power scrolls
    • Created StatCapScrollListEntry to hold stat cap scrolls
    • Modified SeedListEntry to use client localization data for seed names. In addition, all seeds will be identified while in the keys.
  • Items:
    • Changed around ItemID's and names of various example items. This was done to demonstrate the flexibility of the system. You're not locked in to having to use the key graphic if you don't want to!
    • Added ChampionSkullKey to demonstrate use of ChampionSkullEntry
    • Added FishKey to demonstrate use of GenericDistinguishableEntry
    • Added PSKey to demonstrate use of PowerScrollListEntry and StatCapScrollListEntry
    • Switched Powder of Temperament listing in ToolKey from ToolEntry to GenericEntry. This way, players can withdraw any desired quantity.
  • Extras:
    • Created PetPowerScrollListEntry list entry for anyone who uses the FSATS animals system. To enable this, uncomment line 3 of "Extras\Extras.cs".


Version 2008-12-19
  • Entries:
    • Created GenericEntry, a more universal, and easy to use, store entry system. The developer need only specify the item type, the (integer) property to be stored in the keys, and the label for the entry. NOTE: this only works on items with zero-parameter constructors. Examples of its use is in the new ExtrasKey
  • List Entries:
    • Created the LargeBODListEntry to hold large bulk order deeds. Works well with standard smith/tailor bods, but need feedback on whether it's drop-in compatible with customized BOD systems.
    • The SmallBODListEntry has been extended to work with tinker, fletcher, pet, and carpenter custom bod systems. See this link for details. (thanks datguy!)
    • Added customizability to the List Entry displayed within the main key gump. Now the developer can specify the artwork itemid and hue for any list entry (default is still the gold metal box, so your existing list entries will look the same unless you decide to customize it). Syntax is illustrated in the BODKey example item.
  • Items:
    • Added entries for large bulk orders to the BODKey example item
    • Created ExtrasKey to illustrate the use of keys for custom scripts. Current examples include FS-ATS pet shrink leashes, and Lucid's Advanced Archery dip tubs. As long as the item has some publicly accessible integer property, and has a zero-parameter constructor, it can be stored in this same fashion.
  • Gumps:
    • Employed cropped labels in list entry gump. Now long text won't spill over into other columns or off the pages.

Version 2008-12-14
  • List Entries:
    • Created the SmallBODListEntry to hold small bulk order deeds. Works well with standard smith/tailor bods, but need feedback on whether it's drop-in compatible with customized BOD systems. Note that there is currently no solution to store large bulk order deeds in a list entry
  • Items
    • Created BODKey example item to demonstrate the storage of tailor and blacksmith small bulk order deeds

Version 2008-10-18
  • Items:
    • added lockdown security level access functionality for keys locked down in a house (thanks valan!)
    • the context menu once again works if the key is locked down in your house, and won't allow inappropriate access

Version 2008-09-26
  • Extras:
    • Streamlined the [keyguard command a bit. The attachment will now delete when the player releases an item from [keyguard. Also cut down the message text a bit. (thanks datguy!)
  • Entries:
    • Added support for IHasQuantity items in the ResourceEntry. Now flour sacks will behave as expected (thanks datguy!)
  • Stash Entries:
    • Fixed a bug where numbers would not sort properly in the stash entry list gump. (thanks datguy!)
  • Gumps:
    • Fixed a bug where the last column would not filter.
  • Server Modifications:
    • addressed an issue where IHasQuantity resources (flour sacks, water pitchers, etc) would not withdraw from keys when crafting. (Thanks Celestine!)

Version 2008-09-14
  • Items:
    • The context menu no longer works if the key is locked down in your house. (thanks Aurboda!)

Version 2008-09-11
  • Entries:
    • Keys will no longer fill from locked or trapped containers (thanks datguy!)
  • Stash Entries:
    • Defined a new kind of entry called a "stash entry". This entry works similar to a list entry, where items are collected and individually listed. The main difference is that the stash entry physically moves the item into storage, whereas the list entry reads the relevant properties from the item, and then deletes the item. Although this is less efficient than a list entry, it opens up the possiblity to define stash entries to store pretty much any item.
    • NOTE: this system requires the CliLoc Handler project to function
  • Gumps:
    • Beefed up the gump button handling for standard entries. There is now no longer a hard cap of 100 items for Item Lists (thanks Ednyved!)
    • Developed the Stash Entry Gump which displays the contents of a Stash Entry. Within the gump are columns showing properties relevant to the item. These properties can be specified in the code similar to list entries and item store entries. In addition to sort/filter controls for each column, the user can add, remove, or move the columns to better suit their needs.
  • Items:
    • Developed the "Armory Key" example item to illustrate the use of a stash entry. Within the definition of a stash entry, the developer can specify which properties to display by default, as well as which properties to offer for the user's additional customization.
    • Developed the Armor Key, Weapon Key, Clothing Key, and Jewelry Key. They work just like the Armory Key, but with separated functions. I gave this as an example of how you could split up the contents to more items if you so choose.
    • Added overridable properties CanUseFromPack and CanUseFromHouse to BaseStoreKey. When you define your own custom keys, you can customize these to specify the scope of use. Note that items with CanUseFromPack set false will not be able to be added to the Master Keys
  • Extras:
    • developed a section for extra optional features, which can be enabled using compiler directives. Extra features require another custom script to function, and are disabled by default.
    • added extra command "[keyguard" which toggles whether an item will be able to be added to keys or not.
    • NOTE: this requires the XML attachment system to function.
    • NOTE: To enable this, uncomment line 2 of the file Extras.cs in the folder Extras
  • Server Modifications:
    • included Tylius's instructions for server modifications as an alternate source of instructions to modify the server. (thanks Tylius!)
    • addressed an issue where recall runes were not being withdrawn from the keys. Instructions to modify the server file CraftItem.cs are located in the Server Modifications folder, as well as Tylius' alternate instructions. (thanks madphatboy2!)
  • Entries:
    • Added a hard minimum withdrawal amount on tool entries. This will prevent the production of many 1-use tools from one multi-use tool, a possible gold farm.


Version 2008-05-14
  • List Entries:
    • List Entries will once again accept insured/blessed items. In fact, they'll keep track of this info for you. If you put an insured instrument in the instrument keys, they will come out insured. This should allow repair deeds and addon deeds to properly add to the keys once again (thanks ineedhelp!)
  • Gumps:
    • added an withdrawl amount lock toggle button, so you can lock the withdrawl amount if you're annoyed with the text cursor being captured by the gump every time it reopens (thanks Celestine!)

Version 2008-04-07
  • Entries:
    • Fill from Backpack will no longer draw from locked containers

Version 2008-04-04
  • Gumps:
    • Fixed a small bug in list entry gumps that incorrectly truncated the display and thus hid one entry per page (thanks ineedhelp!)

Version 2008-03-31
  • Gumps:
    • Fixed a bug with the list entry gump where text would not be displayed for zero-hue entries (thanks Aurboda!)
  • List Entries:
    • Added the BaseAddonDeedListEntry list entry to hold addon deeds (thanks Aurboda!)
  • Items:
    • Added the Addon Deed Keys example item to sport the BaseAddonDeedListEntry (thanks Aurboda!)

Version 2008-03-29
  • List Entries:
    • Fixed a bug with list entry filters. You should now withdraw the desired item when you have applied a filter to a list entry
  • Gumps:
    • Fixed the list entry gump so it remains on the same page every time you withdraw/add.
    • Added page numbers (if applicable) to the list entry gump

Version 2008-03-13
  • Entries:
    • Fixed a bug with ResourceEntry which was causing it to block the addition of potion kegs into the Potion Key example item. Now both potions and potion kegs can be added and removed properly, as was originally intended.
    • Insured/Blessed instruments will no longer go into instrument entries
    • Improved BaseStoreKey.FindItembyType() static method so you can specify a (stackable) quantity to find. This makes it easier to integrate the automatic item withdrawl into your custom scripts.
  • List Entries;
    • Insured/Blessed items will no longer go into list entries, and thus lose their status
  • Items:
    • Insured keys added to the master key will now remain insured when they are removed. I thought I had this nailed down, but just realized that insurance was not in the LootType enumerator.

Version 2008-03-02
  • List Entries:
    • Created the Repair Deed list entry to hold all kinds of repair deeds
  • Gumps:
    • Fixed crash issue in MasterKeyGump due to invalid button option selection (was rare, but possible if your players use razor and the macro is going hogwild pressing invalid button ID's ) (thanks Ednyved!)
  • Items:
    • Added the Repair Deed list entry to the Smithy's Keys example item
  • Server Modifications:
    • added a new optional server modification instruction that allows the Mark spell to withdraw a rune from keys if no runes are found in the backpack. This can help save time for people making runebooks!
  • Commands:
    • created a directory for commands. These can be found in the folder Commands, and can be removed if you prefer
    • created the player command [pick that will search the backpack and keys for a lockpick, and will bring up the target cursor to begin lockpicking

Version 2008-02-29
  • Server Modifications:
    • clarified the instructions for modifying the MainPlantGump.cs file to allow water and potions to withdraw during plant care
  • Entries:
    • added static method BaseStoreKey.FindItemByType( Container pack, Type type ) that will search the container for the requested type, and if not found, will search the container for any keys that contain that type. If found, the item will be withdrawn and added to the pack, and a reference passed back. This opens the door to allow direct withdraw from systems such as the custom [band, [bandself commands. Simply replace all pack.FindItemByType( typeof( Bandage ) ) with BaseStoreKey.FindItemByType( pack, typeof( Bandage ) ).

Version 2008-02-28
  • Entries:
    • the Amount property of an entry can no longer be initialized with a negative number
    • the potion entry will now accept stacked potions properly (thanks HammerHand!)
  • Gumps:
    • updated Master Key gump to display both current amount and max amount of keys stored (thanks datguy!)
  • Compatibility
    • confirmed this code works with RunUO SVN 286. This means this is compatable with RC1, RC2, and the SVN up to version 286!
  • Documentation
    • updated the documentation in notes.txt to include list entry info

Version 2008-02-22
  • List Entries:
    • Fabled fishing nets can now be properly stored and retrieved in the SpecialFishingNetListEntry class.(thanks datguy!)
    • Changed the SpecialFishingNetListEntry name display to simply show the class name. This way, Fabled Fishing Nets are properly labelled

Version 2008-02-21
  • Gumps:
    • Shifted columns in Master Key gump to give key artwork a bit more room, and twiddled with button alignment a bit
    • Added the ability to manually define column separation points, giving developers more formatting control when configuring their storage solutions. To insert a column separation point, add a ColumnSeparationEntry to the item's defined entries.
    • Added page number indication to item store gump (only shows if more than one page exists)
  • Entries:
    • Fixed ToolEntry so that blessed/insured tools will not add to the entry. This will allow people to block certain tools from being sucked into their toolbox when they hit the "Fill from pack" button. (Thanks Muso!)
    • Developed the special column separation point entry ColumnSeparationEntry, used to allow more formatting and position control of gump contents. To use this, add a ColumnSeparationEntry to the item's list of entries, positioned where you want it to separate.
  • List Entries:
    • Developed SeedListEntry to contain all seeds.
  • Items:
    • Added column separatioon points to the Scribe's Tome example item to demonstrate their usefulness
    • Added a seed list entry to the Gardener's keys to hold seeds
    • Added context menu controls to all keys (including master keys). "Open" and "Add" are self-evident, while "Refill from stock" activates the Fill from Backpack control. Unfortunately I could not find a more suitable text in the unmodified cliloc localization files

Version 2008-02-18
  • List Entries:
    • Maps removed from the treasure map list entry will no longer display incorrect pin locations. Any maps busted from this bug can be repaired by adding to the list entry, then removing again. (Thanks Henry_R!)
  • Gumps:
    • Item Entry gump "Fill From Backpack" button now fills list entries.
    • Master key gump now has a "Fill entries from backpack" button, which goes through all keys stored in the master key, and performs a fill from backpack on each one
  • Keys:
    • Developed the Jeweler's Keys example item based on user feedback (Thanks Henry_R!)
    • Developed the Scribe's Tome example item, containing all spell scrolls and some useful components (this actually was introduced in the 2008-02-17 version, but I forgot to announce it)

  • Upgrade Notes: If you are updating from the 2008-02-17 version, you need only replace all files but those contained in the Items folder. There are new example items that you may be interested in, but otherwise you are free to leave your customized items alone. If you are updating from a version previous to 2008-02-17, see the note listed in that version update.

Version 2008-02-17
  • Files:
    • Rearranged files into more sensible directories. This was done to allow people upgrading from this version on to better understand which files need to be replaced and which files (eg. custom written keys) don't have to be.
    • Found and fixed a deserialization typo that would have caused any keys with saved expel inventory to fail world load (thanks datguy!)
  • Entries:
    • Fixed issue where store entries were becoming disconnected from keys when added, then withdrawn from master keys
    • Developed new entry type called a "List Entry". the List Entry holds a list of complex storage entries, intended to be used for complex, non-identical items. For example, treasure maps contain information about where the chest is buried (location, map), what level the chest is, who decoded the map, etc. The StoreEntry structure is not suitable to store such a complex object, whereas the List Entry is.
    • Developed InstrumentEntry to allow the stacking of uses of a particular instrument of a particular quality. Will not accept instruments with any slayer properties. To store instruments with slayer properties, use the InstrumentListEntry list entry that is discussed below.
    • Runic tool entry now properly checks the tool type with the desired type, so runic tinker kits will no longer be mistaken for runic hammers. (thanks datguy!)
  • List Entries:
    • Developed Treasure Map list entry to hold treasure map's
    • Developed SOS list entry to hold sos's
    • Developed Special Fishing Net entry to hold special fishing nets
    • Developed Instrument list entry to hold any kind of musical instrument. Stores info about quality, uses remaining, slayer properties, and crafter. Will not stack uses. To stack uses remaining, use the InstrumentEntry entry discussed above.
  • Gumps:
    • Performed slight aesthetic tweaking, changing size, layout, and textfield background style
    • Increased default maximum listing height from 300 to 400. This will make listings taller before it resorts to multiple pages
    • Fixed problem with master keys where the column number would reset to 2 for any keys added to the master keys
    • Developed List Entry gump to display/access list entry contents. User can sort/filter by any of the displayed properties
    • Adding/Removing from master keys now closes entry and list entry gumps to avoid issues with gumps referencing stores that have been added/removed from the master key
  • Keys:
    • Developed Treasure Hunter's Key to contain example list entries for treasure maps, sos's, special fishing nets, and some other handy tools
    • Developed Bard's Key to contain example entries and list entries for instruments and instrument list entry storage
    • Added a few sensible entries (bola balls, bola's, zoogi fungus, powder of translocation) to the Adventurer's Keys example item
    • Added empty potion bottles and empty keg entries to the Potion Key example item
    • removed all but Hatchet from list of acceptable items in the lumberjacking tool entry of the Tool Key example item. This was causing people to lose good weapons when they hit Fill From Backpack
    • Added Powder of Fortifying to Smith's Keys example item
  • Upgrade Notes:
    • if you are upgrading from a previous version, you should compare the file location of the various files to understand where they have migrated to. As usual, you don't have to replace the customizable example item files. From here on in, when you are upgrading to a new version, all files located in the Items directory do not need to be replaced. All other files in all other directories will typically need to be replaced.

Version 2008-02-14
  • Gumps:
    • Fixed issue with withdrawal from multi-page gump (thanks Henry_R)

Version 2008-02-13
  • Entries:
    • clarified how the PotionEntry withdraws in the documentation
    • ResourceEntry entries will no longer accept marked recall runes (thanks datguy!)
  • Items:
    • changed Name of GardenersKey item from "Gerdener's Keys" to "Gardener's Keys" (thanks datguy!)
    • Blessed/insured keys will remain blessed/insured when added/withdrawn from Master Keys (thanks datguy!)
    • added SmithyKey item example to illustrate the flexibility of combining different entry types in one storage item
  • Gumps:
    • added the ability to specify the number of columns to display on the gump. This is done in the defined items, where the line "public override int DisplayColumns{ get{ return 2; } }" can be changed higher or lower. WARNING: do not try to set this number to silly values. Recommended lowest value is 1, highest value is around 4 for display purposes
    • added multi-page capability. Pagination is automatic, and can be adjusted by monkeying with the MaxEntryDisplayHeight property within ItemStoreGump.cs.
  • Upgrade Notes:
    • if you are upgrading from a previous version, and have your own set of custom defined items, you do not need to modify any *EXCEPT* the MasterKey.cs and the BaseStoreKey.cs files. These were modified to implement the various changes listed above, feel free to keep your existing custom keys if you have worked on them.
Version 2008-02-11
  • Gumps
    • touched up overall look of gumps slightly (thanks Ednyved!)
    • added ability for gumps to refresh when resources are withdrawn from craft/cast/archer/plant systems (thanks Joeku!)
  • Entries:
    • BeverageEntry entries will no longer take empty BaseBeverages (eg. empty glass pitchers) into the storage
  • Misc:
    • changed class name of Master Keys from MasterKey to MasterItemStoreKey to minimize conflicts with other custom work
  • WARNING!!! if you are upgrading from a previous version, you NEED to collect, empty, and delete all instances of the MasterKey from players. Applying this change without doing so will cause the server to nuke all instances of the keys in your world save, and will destroy anything players kept in the keys!!
 

Kenny164

Sorceror
Well, let me be the first to welcome you to the RunUO forums!

You certainly entered with a bang! heh. This looks awesome, although I haven't tried it out yet.

I hope to be seeing more of you around the forums.
 

Ednyved

Sorceror
Just dropping in to add my kudos, Fenn. I'm busily working on Scribe's keys using your examples, and am constantly shaking my head as I go at how well-done this system is. It's incredibly kind of you to be releasing this to the RunUO community, and I can't wait to get these things active and out there for the players.

Quick little fix for ya, too. In the gump, "withdrawl" should be "withdrawal". Just noticed it as I'm looking at them on my screen right now. ;)

-Mr. Picky Pants
 

mikial

Sorceror
MasterKey.cs

I seem to be having this error showing up..


RunUO - [www.runuo.com] Version 2.0, Build 2955.24006
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Custom/Universal Storage Keys/Items/MasterKey.cs:
CS0101: Line 14: The namespace 'Server.Items' already contains a definition
for 'MasterKey'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Thank You for help.
 

Joeku

Lord
It'd be relatively easy to make a simple refresh mechanism; any time an amount is withdrawn from the key, check to see if its RootParent has the gump open; if it does, then re-send the gump.

Looks like an excellent script, and it's very well-commented. Great job :)
 

Aurboda

Sorceror
Thank-you!

Thank you so much for sharing this.

Really like being able to put keys within the master key, and to be able to use items from within the keys, and not having to remove them to craft, etc.

Also was very easy to figure out how to script items to the keys, such as ore, leather and wood for Karmageddon's resources.

Question? how many uique items can be scripted into each key?
 

Fenn

Wanderer
Thanks everyone, for your welcome and comments.

Mikial: Yes, it sounds like your server already has some object called MasterKey defined. In order to use my script you will need to either go through your server and redefine your object, or redefine my object. A good way to do this would be to get a copy of Windows Grep, and apply a rename to all my code. Rename MasterKey to something like MasterItemStoreKey or some other unique name. If more people are having a similar problem, then I can edit my copy here to be less conflicting.

Joeku: Thanks for the tip. I'l definitely look into it and see if I can fix that for my next release.

Aurboda: The default storage limit for the master key has a limit of 25 keys, while there is no limit in the entries for each key type other than what the developer puts in. The key storage gump resizes to account for the number and size of each entry, and presumably if you made it big enough, the gump would be hard to manage. There are plans to pretty up the gump a bit, and allow the option of multiple pages, should the entry list get too large. But for now, whatever you want to script into the keys will fit in just fine.
 
MasterKey Conflict

Fenn;738559 said:
Thanks everyone, for your welcome and comments.

Mikial: Yes, it sounds like your server already has some object called MasterKey defined. In order to use my script you will need to either go through your server and redefine your object, or redefine my object. A good way to do this would be to get a copy of Windows Grep, and apply a rename to all my code. Rename MasterKey to something like MasterItemStoreKey or some other unique name. If more people are having a similar problem, then I can edit my copy here to be less conflicting.

Joeku: Thanks for the tip. I'l definitely look into it and see if I can fix that for my next release.

Aurboda: The default storage limit for the master key has a limit of 25 keys, while there is no limit in the entries for each key type other than what the developer puts in. The key storage gump resizes to account for the number and size of each entry, and presumably if you made it big enough, the gump would be hard to manage. There are plans to pretty up the gump a bit, and allow the option of multiple pages, should the entry list get too large. But for now, whatever you want to script into the keys will fit in just fine.


I would imagine that the error of duplicate MasterKey is because of MalGanis ML system. The Peerless systems Peerless Keys refer the Base of MasterKey. So those with MalGanis ML will have problems with this script. I just renamed my MasterKey to MainKey in the scripts and left name as Master Key. Simple solution.
 

Fenn

Wanderer
Ok, thanks to all your suggestions! I've posted an updated version of this script. Please check my details post (second one in) for info.
 

Fenn

Wanderer
Ok, some more changes. Here's a snippet of the changelog, as listed in the second post of this thread.

Version 2008-02-13
  • Entries:
    • clarified how the PotionEntry withdraws in the documentation
    • ResourceEntry entries will no longer accept marked recall runes (thanks datguy!)
  • Items:
    • changed Name of GardenersKey item from "Gerdener's Keys" to "Gardener's Keys" (thanks datguy!)
    • Blessed/insured keys will remain blessed/insured when added/withdrawn from Master Keys (thanks datguy!)
    • added SmithyKey item example to illustrate the flexibility of combining different entry types in one storage item
  • Gumps:
    • added the ability to specify the number of columns to display on the gump. This is done in the defined items, where the line "public override int DisplayColumns{ get{ return 2; } }" can be changed higher or lower. WARNING: do not try to set this number to silly values. Recommended lowest value is 1, highest value is around 4 for display purposes
    • added multi-page capability. Pagination is automatic, and can be adjusted by monkeying with the MaxEntryDisplayHeight property within ItemStoreGump.cs.
  • Upgrade Notes:
    • if you are upgrading from a previous version, and have your own set of custom defined items, you do not need to modify any *EXCEPT* the MasterKey.cs and the BaseStoreKey.cs files. These were modified to implement the various changes listed above, feel free to keep your existing custom keys if you have worked on them.
 

Joeku

Lord
Why do you have a link to this thread in your siggy when all five of your posts are in this thread? Lol.

Nice upgrade :D
 

Henry_R

Sorceror
small bug

hi...

First, thanks for releasing this.

I installed the first version 2008-02-10

I installed version 2008-02-13 tonight (I kept my original key & tool chest files as they have many entry additions; all other files were replaced).

I noticed one bug... when withdrawing a item/resource from page 2 of a gump, the item withdrawn is the item in the same spot on page 1.

Example:

Adventurer Key

page 1 -
first entry, "Amber"
second entry, "Amethyst"
and so on.....

page 2 -
first entry, "MessageInABottle"
second entry, "SpecialFishingNet"

When I withdraw MessageInABottle, Amber is withdrawn in place of the MIB (in whatever quantity is set).

When I withdraw SpecialFishingNet, Amethyst is withdrawn in place of the Fishing Net.

This happens on all keys that have multiple pages (i had 3 keys with multiple pages).

For a quick workaround, I set displayed columns to 3 and that cleared the problem up (nixed all page 2's).

Could you look into this?

Thanks again,

henry_r
 

Fenn

Wanderer
Gah! Quick fix, thanks Henry_R. I knew there was something I forgot to change.


Version 2008-02-14
  • Gumps:
    • Fixed issue with withdrawal from multi-page gump (thanks Henry_R)

And, Joeku, until I get around to releasing more stuff, or posting elsewhere, my siggy is gonna be a little redundant!
 

Fenn

Wanderer
Ok, new update! Some bugfixes and tweaks, but most notably is a new "list entry" system that allows for a listed storage of complex items that can't be reduced to a single integer property and stored in a store entry. Examples include treasure maps and instruments, which each have a collection of properties that need to be retained so that the item can keep its functionality when withdrawn again. A list entry is viewable through a new gump, which offers sort/filter controls for easy search and access.

Here's a copy of the changelog for this version.

Version 2008-02-17
  • Files:
    • Rearranged files into more sensible directories. This was done to allow people upgrading from this version on to better understand which files need to be replaced and which files (eg. custom written keys) don't have to be.
    • Found and fixed a deserialization typo that would have caused any keys with saved expel inventory to fail world load (thanks datguy!)
  • Entries:
    • Fixed issue where store entries were becoming disconnected from keys when added, then withdrawn from master keys
    • Developed new entry type called a "List Entry". the List Entry holds a list of complex storage entries, intended to be used for complex, non-identical items. For example, treasure maps contain information about where the chest is buried (location, map), what level the chest is, who decoded the map, etc. The StoreEntry structure is not suitable to store such a complex object, whereas the List Entry is.
    • Developed InstrumentEntry to allow the stacking of uses of a particular instrument of a particular quality. Will not accept instruments with any slayer properties. To store instruments with slayer properties, use the InstrumentListEntry list entry that is discussed below.
    • Runic tool entry now properly checks the tool type with the desired type, so runic tinker kits will no longer be mistaken for runic hammers. (thanks datguy!)
  • List Entries:
    • Developed Treasure Map list entry to hold treasure map's
    • Developed SOS list entry to hold sos's
    • Developed Special Fishing Net entry to hold special fishing nets
    • Developed Instrument list entry to hold any kind of musical instrument. Stores info about quality, uses remaining, slayer properties, and crafter. Will not stack uses. To stack uses remaining, use the InstrumentEntry entry discussed above.
  • Gumps:
    • Performed slight aesthetic tweaking, changing size, layout, and textfield background style
    • Increased default maximum listing height from 300 to 400. This will make listings taller before it resorts to multiple pages
    • Fixed problem with master keys where the column number would reset to 2 for any keys added to the master keys
    • Developed List Entry gump to display/access list entry contents. User can sort/filter by any of the displayed properties
    • Adding/Removing from master keys now closes entry and list entry gumps to avoid issues with gumps referencing stores that have been added/removed from the master key
  • Keys:
    • Developed Treasure Hunter's Key to contain example list entries for treasure maps, sos's, special fishing nets, and some other handy tools
    • Developed Bard's Key to contain example entries and list entries for instruments and instrument list entry storage
    • Added a few sensible entries (bola balls, bola's, zoogi fungus, powder of translocation) to the Adventurer's Keys example item
    • Added empty potion bottles and empty keg entries to the Potion Key example item
    • removed all but Hatchet from list of acceptable items in the lumberjacking tool entry of the Tool Key example item. This was causing people to lose good weapons when they hit Fill From Backpack
    • Added Powder of Fortifying to Smith's Keys example item
  • Upgrade Notes:
    • if you are upgrading from a previous version, you should compare the file location of the various files to understand where they have migrated to. As usual, you don't have to replace the customizable example item files. From here on in, when you are upgrading to a new version, all files located in the Items directory do not need to be replaced. All other files in all other directories will typically need to be replaced.
 

Henry_R

Sorceror
update

hi...


updating was a breeze...

thanks

here are listings for gems with graphics centered with the button (or real close) :

Code:
entry.Add( new ResourceEntry( typeof( Amber ), "Amber", 0, 25, -11, 9 ) );
entry.Add( new ResourceEntry( typeof( Amethyst ), "Amethyst", 0, 25, -11, 9 ) );
entry.Add( new ResourceEntry( typeof( Citrine ), "Citrine", 0, 25, -13, 9 ) );
entry.Add( new ResourceEntry( typeof( Diamond ), "Diamond", 0, 25, -5, 9 ) );
entry.Add( new ResourceEntry( typeof( Emerald ), "Emerald", 0, 25, 7, 9 ) );
entry.Add( new ResourceEntry( typeof( Ruby ), "Ruby", 0, 25, 7, 9 ) );
entry.Add( new ResourceEntry( typeof( Sapphire ), "Sapphire", 0, 25, 6, 9 ) );
entry.Add( new ResourceEntry( typeof( StarSapphire ), "Star Sapphire", 0, 25, -7, 9 ) );
entry.Add( new ResourceEntry( typeof( Tourmaline ), "Tourmaline", 0, 25, 11, 8 ) );

hope this helps!


henry_r
 

Henry_R

Sorceror
another small bug

hi...

i found a small bug with treasure map entries....

take a undecoded map and decode it. make a note of where the *pin* is located on the map. add that decoded map to the treasure hunters key.
remove the map from the key. view the map again, taking note of where the *pin* is.

the *pin* is being placed in the wrong spot on the map upon removal from the key.

same thing is happening with ***undecoded*** maps as well....

do a [add treasuremap 6 trammel (adds a level 6 trammel t map).
[props the map to get the coordinates of the ChestLocation.
check the map at uo.stratics.com's treasure map archive to get the map's location without decoding it.
make a note of this map and the location where the *pin* is.
add the undecoded map to the key.
remove the undecoded map and decode it.
the *pin* will not be in the spot [props /ChestLocation indicates.


ughhhhhh

henry_r

ps.... edited to add.... this might help - found in TreasureMap.cs:

AddWorldPin( m_Location.X, m_Location.Y );
 

Fenn

Wanderer
Thanks, Henry_R, for the contribution, the bug report, and the suggestion for a fix. I've incorporated these into the latest version which is now available. Changelog is updated, but here's a copy as well.

Version 2008-02-18
  • List Entries:
    • Maps removed from the treasure map list entry will no longer display incorrect pin locations. Any maps busted from this bug can be repaired by adding to the list entry, then removing again. (Thanks Henry_R!)
  • Gumps:
    • Item Entry gump "Fill From Backpack" button now fills list entries.
    • Master key gump now has a "Fill entries from backpack" button, which goes through all keys stored in the master key, and performs a fill from backpack on each one
  • Keys:
    • Developed the Jeweler's Keys example item based on user feedback (Thanks Henry_R!)
    • Developed the Scribe's Tome example item, containing all spell scrolls and some useful components (this actually was introduced in the 2008-02-17 version, but I forgot to announce it)

  • Upgrade Notes: If you are updating from the 2008-02-17 version, you need only replace all files but those contained in the Items folder. There are new example items that you may be interested in, but otherwise you are free to leave your customized items alone. If you are updating from a version previous to 2008-02-17, see the note listed in that version update.
 

Fenn

Wanderer
Thanks to some suggestions, these keys have been tweaked a bit more. To save bandwidth, I'm not going to bother reposting the changelog here. Instead, you can read it in the second post of this thread. Also, for those of you who have been following this development, you're probably getting rather accustomed to patching this to a new version. For that, I won't continually repeat myself about how to patch up to latest version.

Here's a quick summary of the changes. First off, blessed or insured tools will no longer go into the ToolEntry. For anyone who has had concerns with the Fill from Backpack snarfing down tools (and maybe even weapons!) that you want left alone, this should provide some relief. Simply insure your tool, and it'll stay put from now on.

I've set up context menu access, for expedited access (exevent popup comes to mind, for all you EasyUO fanatics!). Also, added a seed storage system to the gardener's keys. Gardeners can now have a truly all-in-one plant care utility!

Finally, I've added a quick and dirty way to directly control the column size. By inserting a special type of entry, you can tell the gump exactly where you want it to start writing entries in a new column. This should give developers more control over layout and such.

Keep the suggestions and feedback coming in!
 
Top