The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: shintashi on September 22, 2011, 04:39:54 AM

Title: String/number Based Container?
Post by: shintashi on September 22, 2011, 04:39:54 AM
So while playing with the ideas and uses of encumbrance/item weight (w/ tons of help from coz), i began thinking about an old idea, for storing information on one string.

Through the use of eventing, a person should be able to use 3 number sets to stick items into a bag, box, or chest, in the following manner:

base number in series = container type
so for example, the numbers 1000, 2000, 3000, and 4000 could be read as containers:
1000 = small bottle
2000 = wineskin
3000 = jug
4000 = barrel

the second and third digit could represent the contents, and the last digit could represent the number.

Since many games have around 99 common items or less, they only need 2 digits as place holders for item type. You could consider liquid containers - like the example above as only holding one type of item, thus they would need minimal string length.

You could further compress liquid contents by having 9 or less liquid types (most games will not have more than a few liquids anyway), and you could correlate all single item containers to a select group of digits.

Basically, you create categories represented by numbers and those numbers translate to the type of container, the contents of the container, and the number of those contents.

So a wineskin 2000 with say, "water", which we might set as item 1, would look like this
2100.
We could then fill the contents of item 2100 with up to 99 units of water,
read as 2101-2199.

If we set "wine" to 2, and beer to 3, we might read the wineskin as
2201-2299 (wine 1-99), or 2301-2399 (beer 1-99).

A container can hold another object for 3 more digits, so if we designate a Wooden Chest as item 5,
then want it to contain up to 9 copies of 3 different items, we get
5000000000 as empty, and something like
5123129127 as having 1 door key, 1 map, and 1 letter.

Depending on how you arrange the order of your items in the database, you could end up storing a wide variety of items with even less numbers.

Items like a sword sheath or bottle would realistically only need 2 additional numbers, with 00 representing empty. For example, 100 might be empty sheath, and 101 might hold ONE wooden sword.

this is still conceptual, and it clearly wont hold dozens of different items, but I think its reasonable to hold 4 very different items, or a large number of very similar items (like a box of mixed ammo) in a single string.