Organizing Items, Common Events, Enemies, Troops, and more

Hi all,

Whenever I make a game in RPG Maker, I find that I always end up with my Items, Common Events, Enemies, Troops, etc. lists all out of wack. I plan out my games far in advance, but inevitably there's always one entry that I forget about, and have to slot in somewhere.

To mitigate this, I usually leave whitespace (entries that have no data) to space some out, and then I can slot things in generally in the same category as the rest of its similar items. But enough whitespace between all the different categories to be certain leaves me with ridiculously long lists that I have to scroll through to find the thing I need.

How do you do it? Bonus question: Is there a tool that can be used to re-arrange entries? If not, I may try to write one.
Currently, I just use a single empty space between sets of entries while I am working on them.

In the past, I would use 3 empty spaces, with the middle space looking something like this:

------Light Armor------

but I got tired of always seeing those items during my test plays as I have an event that adds all items with a name to the party's inventory.

So honestly, just finding something that works for you is usually going to be the best. I haven't found a tool but I do remember a plugin, which I don't believe I was able to find again, but, could use notetags to reorganize the database on the game end, meaning you could assign particular IDs and they would appear in the inventories in the order of the given IDs. I wish I could remember the name of the plugin...
Yeah, I do understand wanting to keep your database organized, but everything within RPGMaker works against you on that. It is theoretically possible to write a tool that reads your database (the JSON files) and sorts it while automatically updating all references to the moved items; however, making it account for plugin parameters and note tags that reference them would be nearly impossible.

If you're using few plugins, it might be worth putting in the effort to do that, but otherwise, I'd recommend giving up on editor organization and just focus on something that organizes them on the fly in the game, so that at least your shops and inventory and such can be organized even if the editor list isn't. I wrote a plugin that does this, and I think I saw at least one other similar one somewhere.

I wish I could remember the name of the plugin...
I think there's more than one, but my SortKeys fits your description.

but I got tired of always seeing those items during my test plays as I have an event that adds all items with a name to the party's inventory.
Is it difficult to change it from "add all items with a name" to "add all items with a name that doesn't begin with a hyphen"?
Hi!
Yeah, organizing the database can be a pain...
I tried to write a plugin that helps you organize it, but all he does is that you can reference the database entries by their names instead of Id. So you can switch them on the list with no problem. But that requires that you reference them inside the game by name and it only can do that with script calls, for now. I will plan to add plugin commands and escape codes to window messages too.
Eli_DataBaseOrganizer.js
I think there's more than one, but my SortKeys fits your description.

Awesome! I will check it out when I can.

Is it difficult to change it from "add all items with a name" to "add all items with a name that doesn't begin with a hyphen"?

Well, this is the script I use:
Spoiler: Script Code
JavaScript:
if ($gameTemp.isPlaytest()) {
$dataItems.forEach(function(item) {if (item && item.name) {$gameParty.gainItem(item,10,false);}});
$dataArmors.forEach(function(armor) {if (armor && armor.name) {$gameParty.gainItem(armor,2,false);}});
$dataWeapons.forEach(function(weapon) {if (weapon && weapon.name) {$gameParty.gainItem(weapon,4,false);}});
$gameParty.gainGold(99999);
};
And while I am sure it would be possible, I haven't the skills with javascript yet to make it happen.

EDIT: After briefly looking into it, I am thinking that I could add the charAt() method to the script to check for a hyphen at the beginning of the name. Maybe something like this:

{if (item && item.name.charCodeAt(0) === "-")

Also, I use a few common events to award a random item from a set of items and so far it's been easier to keep all these possible items grouped together so that I only have one range to use for each type of item to award.

Spoiler: Random Item
Annotation 2020-07-04 120510.png
{if (item && item.name.charCodeAt(0) === "-")
Basically something like that, yeah. You probably need both conditions, and also the condition you wrote there is backwards. So... item && item.name && item.name[0] !== "-"

Note: the [0] syntax on a string is short for the charAt function. Your code as written uses charCodeAt instead, which won't work because it returns the Unicode code point of the character rather than the character itself.
I was actually working on a database management app years ago, but I could never figure out a viable way around the main problem with it: you could only really swap over IDs in the database itself, so if you have plugins etc. that use particular IDs for particular things, you wouldn't be able to rearrange those. There's no way to programmatically tell all the places it would need to be done.
Basically something like that, yeah. You probably need both conditions, and also the condition you wrote there is backwards. So... item && item.name && item.name[0] !== "-"

Note: the [0] syntax on a string is short for the charAt function. Your code as written uses charCodeAt instead, which won't work because it returns the Unicode code point of the character rather than the character itself.
You're right, I was looking at both charAt() and charCodeAt() and mixed them up, and thanks for catching my other error putting === instead of !==, and thanks for the shortcut as well!


I was actually working on a database management app years ago, but I could never figure out a viable way around the main problem with it: you could only really swap over IDs in the database itself, so if you have plugins etc. that use particular IDs for particular things, you wouldn't be able to rearrange those. There's no way to programmatically tell all the places it would need to be done.
So do you think something like this would work with plugins that reference entries by name?
I was actually working on a database management app years ago, but I could never figure out a viable way around the main problem with it: you could only really swap over IDs in the database itself, so if you have plugins etc. that use particular IDs for particular things, you wouldn't be able to rearrange those. There's no way to programmatically tell all the places it would need to be done.
Since 1.5.x there is actually a way to tell it where database objects are referenced in plugins, but it only works for plugin parameters, not note tags. Also, it won't work for every type of database object - for example, elements or equip types aren't covered. And of course it only works if the plugin updated their parameters for the new plugin manager.
Since 1.5.x there is actually a way to tell it where database objects are referenced in plugins, but it only works for plugin parameters, not note tags. Also, it won't work for every type of database object - for example, elements or equip types aren't covered. And of course it only works if the plugin updated their parameters for the new plugin manager.
Yeah, it was notetags I meant. It also wouldn't account for instances where the plugin parameter just uses the ID as a number rather than the actual object reference.

Original thread: https://forums.rpgmakerweb.com/threads/organizing-items-common-events-enemies-troops-and-more.123601/