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

nathanlink169

Game Dev by Career, no idea what I'm doing
Veteran
Joined
Aug 15, 2013
Messages
66
Reaction score
29
First Language
English
Primarily Uses
RMMV
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.
 

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
170
Reaction score
140
First Language
English
Primarily Uses
RMMV
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...
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
488
Reaction score
212
First Language
English
Primarily Uses
RMMV
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"?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
671
First Language
Portuguese - Br
Primarily Uses
RMMV
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
 

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
170
Reaction score
140
First Language
English
Primarily Uses
RMMV
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:
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.

Annotation 2020-07-04 120510.png
 
Last edited:

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
488
Reaction score
212
First Language
English
Primarily Uses
RMMV
{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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,548
First Language
English
Primarily Uses
RMMV
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.
 

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
170
Reaction score
140
First Language
English
Primarily Uses
RMMV
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?
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
488
Reaction score
212
First Language
English
Primarily Uses
RMMV
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,373
Reaction score
1,548
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,096
Members
132,261
Latest member
DarthNinjus
Top