"Therefore, if anyone is in Christ, the new creation has come: The old has gone, the new is here!" - 2 Corinthians 5:17
DynDatabaseOverride is a plugin for the DynRPG project. If you've taken the time to download this plugin then odds are you're already familiar with DynRPG and how to use it, but just in case, you can find the main DynRPG website at http://rewking.com/dynrpg/.
The DynDatabaseOverride plugin allows developers to override the default database values of an RPG Maker 2003 game with data stored in .txt (which spreadsheet programs regard as "Tab-Separated Values") files. The plugin can override multiple parts of the database independently, at the start of a game run or in the middle of it, and will track any changes made and reapply them when a saved game is loaded.
Why would you want to be able to override the existing database? The first and most obvious use is to change the way the game works in mid-play. For example, suppose you wanted to give your game varying difficulty levels. By overriding the stat values of enemies, you could adjust the difficulty of combat at run-time, even allowing the player to switch back and forth between different stat setups. Enemy stats aren't the only things you can adjust -- you can also change values related to actors (AKA heroes), skills, items, and more.
Another possible use of this plugin is to simply be able to edit your game's data using a spreadsheet program (i.e. Microsoft Excel or Open Office Calc) rather than the RPG Maker 2003 database editor. Spreadsheets are powerful game design tools, allowing you to make sweeping changes to large groups of data and create formulas to drive values based on other values. The example spreadsheet DynDatabaseOverrideExamples.xls included in this project includes a sample formula which calculates an MP cost amount for a skill based on its stats. DynDatabaseOverride can also export the existing database values of a game at any time into .txt files, which can give you a good starting point to create your alternative data sets.
A quick plug for the integrity and harmony of the RPG Maker community: please buy the official English translation of RPG Maker 2003! Obviously I'm in no position to shame anyone who has used the fan port of RPG Maker 2003 up until now, especially since as of this writing there is no DynRPG patch for the official RPG Maker 2003. Still, now that the official version is available (and not that expensive to boot), there's really no excuse not to purchase a license for at least legitimization, even if you continue to make use of the fan port. The creator of DynRPG, David "Cherry" Trapp, was instrumental in negotiating the creation and release of the official English translation of RPG Maker 2003, and he continues to work on improving it. Let's give the owners of the RPG Maker franchise some motivation to continue working amicably with the modding community! You can purchase RPG Maker 2003 at RPG Maker Web or on Steam.
For those of you who prefer to dive right in and learn by doing with only occasional looks at the manual for reference, please at least read these vital notes.
To install DynDatabaseOverride in an RPG Maker 2003 project:
DynDatabaseOverride does not have any configuration options. You do not need to modify your project's DynRPG.ini file in order to use DynDatabaseOverride.
DynDatabaseOverride works by reading special .txt (Tab-Separated Values) files with data representing values in an RPG Maker 2003 game's database and changing the game's database in memory to match that data. This happens while the game is running and does not actually modify the database on the system storage. The .txt files are stored in the DynDatabaseOverrideFiles folder of the game project.
DynDatabaseOverride does not override the absolute entirety of a game's database. There are parts of the database, for example the scripting in Common Events and Battle Events pages, which are too complex to be worth manipulating through spreadsheet data. DynDatabaseOverride focuses on the parts of the database for which the ability to change the data mid-game and/or do design work in a spreadsheet are most likely to be useful. See the section on Data Types for reference about the data which DynDatabaseOverride can override. If there is a part of the database which you would like added to DynDatabaseOverride's capabilities, you can try contacting me, but I make no promises about doing it for you. ;)
Probably the first thing you'll want to do getting started with the DynDatabaseOverride plugin is to export your project's existing database. That will give you a starting point which you can modify to make data files for your custom data sets. There are several ways that DynDatabaseOverride exports data.
First, DynDatabaseOverride will automatically export the entire project database (well, the parts it's capable of overriding, anyway) into files that have "Default" at the start of their names when the game is first run. These files are used to reset the game's database in memory to a baseline when a new game is started or a save game is loaded -- see the section on Importing Values for details. For most developers, the Default files will do fine as a starting point for custom data files. Note that these files are written anew every time the game is run, so any changes you make in them will be lost. You must copy the data in them over to other files to work with.
DynDatabaseOverride also automatically exports files that have "SaveState<number>" at the start of their names representing changes made to the database during runtime whenever the game is saved. This allows the plugin to reapply these changes when the saved game is loaded later on. If no changes are imported during the course of a game (not including at the very start of a new game), then these files are not exported. You should generally avoid modifying these files unless you really want to manually tweak the data values in an ongoing save game.
Finally, just in case you have a reason to export the database values in the middle of a game, DynDatabaseOverride provides a @dyndatabaseoverride_export_database comment command. This command will export the database values into files with names starting with whatever characters you provide.
Once you have some exported data to work with, you will need to create data files for importing back into the game at run-time. A spreadsheet editing program like Microsoft Excel or Open Office Calc can be used to read and edit .txt data files. A data file for importing has the exact same format as an exported data file; you just need to change the values in it and give it an appropriate name. As noted in the section about exporting, the "Default" and "SaveState<number>" data files are automatically overwritten at certain times by the DynDatabaseOverride plugin, so you should make sure to give your custom data files other names.
Data files follow a general format in which the first row is for optional notes, the second row is for ID numbers, and the third row is sometimes for secondary ID numbers -- for example, for Actors Attributes data, the first ID number row is for the IDs of the Actors, while the second ID number row is for the IDs of the Attributes. The rest of the rows are for the database values associated with those ID numbers. Information about the individual data values can be found in the section on Data Types.
If you only want to change part of the data values for a particular data type, you can delete whole rows or whole columns from the data file. For example, suppose you wanted to change the Attack, Defense, and Intelligence values of Enemies, but nothing else about them. You could delete all of the data rows in an Enemies data file except for the ID, Attack, Defense, and Intelligence rows to accomplish this.
You can also delete columns to prevent specific entities from being affected by the data import. For example, suppose you wanted to change the Price values on medicine Items, but not all the other Items like weapons, armor, etc. You could delete the columns for everything except the medicine Items, and at the same time delete all the rows except for the ID and Price rows.
Note that by "delete" a row or column, I mean remove it entirely from the data file, not just clear the values from its cells. Empty rows or columns will cause problems for DynDatabaseOverride. Also, while deleting rows or columns (apart from the ID rows and the far-left header column) is fine, rearranging the rows is not allowed. They must remain in the same order they are in when exported by DynDatabaseOverride, or some of the data will be skipped when imported.
Also note that the "SaveState<number>" data files exported to show what data values have been changed in mid-play for a given save game will always contain values for all entities of a given data type, although they may omit rows that have not been changed. For example, if you import data changing the Price of just one Item and then save the game to slot 1, the "SaveState1_Items.txt" file will contain the Price data for all Items in the database. This is due to limitations in how the plugin works internally. It will not affect the game since all the Price values apart from the one you changed will have the same values they did originally, although it does mean these save state data files take up a little more storage space than is ideal.
Certain data types have varying amounts of data in them, and the way they're stored in a game's database is a bit unintuitive. For example, actors, classes, and monsters all have data about how susceptible they are to different attributes and conditions. Since you as the designer decide how many attributes and conditions are in your game, the number of data points about them for actors, classes, and monsters can vary. However, it's not as simple as always having the same number of data points as there are attributes and conditions. RPG Maker 2003 uses a sneaky shortcut which allows it to store less data and at the same time automatically 'fill in' the data points when new attributes and conditions are added. It treats "C" as a default value and does not store data points for any attributes or conditions past the last non-"C" value.
For example, suppose your game has five attributes -- Earth, Fire, Water, Wind, and Lightning. In the RPG Maker 2003 database editor, it might display a particular actor with these attribute susceptibilities:
Internally, however, the database only holds data points for the first three of those attributes. Since all the attributes after Water have the default value of "C", the database doesn't bother storing them. The "Default_Actors_Attributes.txt" file exported by DynDatabaseOverride would reflect this, holding data that looks like this:
Notes (optional) | Zack - Earth | Zack - Fire | Zack - Water |
Actor ID | 1 | 1 | 1 |
Attribute ID | 1 | 2 | 3 |
Susceptibility rank | C | B | D |
This can make things tricky if you want to be able to override the attribute values of your actors with DynDatabaseOverride, because there's actually no data points to be overridden on this actor for Wind and Lightning. If you try to import a data file that includes data for Wind or Lightning, there will be an error.
A trick you can use to get around this problem is to create an extra attribute (or condition or whatever) which you don't intend to use at all in your game, then set it to a non-default value in any data types you may want to override with DynDatabaseOverride. In our example, you could create an attribute called Unused and set it to E in your actor:
This would result in a "Default_Actors_Attributes.txt" file which looks like this:
Notes (optional) | Zack - Earth | Zack - Fire | Zack - Water | Zack - Wind | Zack - Lightning | Zack - Unused |
Actor ID | 1 | 1 | 1 | 1 | 1 | 1 |
Attribute ID | 1 | 2 | 3 | 4 | 5 | 6 |
Susceptibility rank | C | B | D | C | C | E |
From there you could create data files to override any of the attribute values you like.
A similar problem shows up with data types that can involve a different amount of data points associated with different entities. A good example of this is skill learning data for actors and classes. A game's database holds data about which skills each actor or class learns and at what level they learn it, but since most actors and classes will only learn a small number of the skills in the database, the database only stores data points for the skills they do learn. This means that you cannot use DynDatabaseOverride to add more skills to an actor or class than they have in the game's database, only change what skills they are and what level they are learned at.
However, there is a little hack you can use to essentially remove skills from the list. Suppose you have an actor with three skills, and you want to replace them with a set of two skills in a special game mode. The "Default_Actors_Skill_Learning.txt" file's contents might look something like this:
Notes (optional) | Zack - Venom | Zack - Blind | Zack - Sleep |
Actor ID | 1 | 1 | 1 |
Skill learning ID | 0 | 1 | 2 |
Level requirement | 1 | 3 | 7 |
Skill ID | 1 | 2 | 3 |
You cannot use DynDatabaseOverride to reduce the number of skill learning data points in the database, but you can override some of the data points to teach the same skill. If you wanted to remove the Sleep skill, you could create and import a "SpecialMode_Actors_Skill_Learning.txt" file with contents like this:
Notes (optional) | Zack - Venom | Zack - Blind | Zack - Venom (HACK TO REMOVE SLEEP) |
Actor ID | 1 | 1 | 1 |
Skill learning ID | 0 | 1 | 2 |
Level requirement | 1 | 3 | 1 |
Skill ID | 1 | 2 | 1 |
Since the last skill learning data point is now identical to the first one, it effectively does nothing. You can use this trick to change the number of skills an actor or class will learn to whatever you want (except for 0), as long as the game's default database has at least as many skill learning data points in it to begin with.
If you are an advanced developer with some knowledge of how to use a spreadsheet program's formula features, you may want use them to generate data for your data files. For example, you could use formulas to generate easy mode and hard mode versions of enemies' stats, calculate the prices of items based on their stats, or just make one-time modifications to large amounts of data, such as doubling the HP of all actors. Teaching you the ins and outs of spreadsheet formulas is a bit beyond the scope of this manual, but the included spreadsheet file DynDatabaseOverrideExamples.xls does provide some samples of formulas you might like to use or modify for your purposes.
Note that if you try to use formulas in the .txt files used for data files by DynDatabaseOverride, those formulas will not be saved. Your spreadsheet program may (in fact probably will) allow you to use formulas, but they will be discarded when you exit the program, leaving only the resulting values. This is because .txt is a very simple file format intended to hold only values. If you want to retain your formulas, you will need to use a spreadsheet file format such as .xls or .ods. DynDatabaseOverride will not be able to use that spreadsheet file directly, though. For the actual data files which DynDatabaseOverride uses, you will need to save the values in .txt format. This can be done either by copying the values from the spreadsheet file to the relevant .txt file in your spreadsheet program, or by exporting a particular sheet of the spreadsheet as a .txt file. See the Instructions sheet in DynDatabaseOverrideExamples.xls for more about exporting.
Once you have data files ready, you can import them with DynDatabaseOverride to change the values in the database. You can import files individually according to their data types, or you can import groups of files with the same start to their name. The comment commands section details how to use comment commands in mid-play to import files, and you can look in the map events in the example DynDatabaseOverride project to see examples of their use.
In addition to allowing you to manually import data, DynDatabaseOverride automatically imports data at certain points. First, when the game is first run, DynDatabaseOverride will import any data files with a name consisting of "Starting" and one of the standard file names endings for data types -- for example, "Starting_Actors.txt". This is useful for developers who want to use DynDatabaseOverride to edit parts of their game's data using a spreadsheet program rather than the RPG Maker 2003 database editor.
Second, when a new game is started or a saved game is loaded, DynDatabaseOverride will import the "Default" files. This resets the database to a ground state, so that if the player comes back to the main menu during play to start a new game or load a saved game, any changes that were made to the database while they were playing before are wiped away. The "Starting" files are imported before DynDatabaseOverride exports the "Default" files, so any changes caused by the "Starting" files are included in the "Default" files.
Finally, when a saved game is loaded, after the "Default" files are imported, DynDatabaseOverride will import any data files with a name consisting of "SaveState<number>" (where "<number>" is the save game slot number) and one of the standard file names endings for data types -- for example, "SaveState1_Actors.txt". As explained in the section on exporting, these files are automatically exported whenever the game is saved, and they contain whatever data has been manually imported during play. Importing them sets the database back to the state it was in when the game was saved.
This section is a reference for the data types which DynDatabaseOverride can override in a game's database. They are organized by the data files they are contained in.
NOTE: The following fields have been disincluded from DynDatabaseOverride because they cause issues when directly manipulated by DynRPG:
NOTE: Importing skill learning data during the game will not immediately change the actors' known skills. You will need to adjust skills yourself if you wish to change them.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: Importing skill learning data during the game will not immediately change the actors' known skills. You will need to adjust skills yourself if you wish to change them.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: Whether an item is usable by a particular actor depends on both the usable by actor flag and the usable by class flag for that actor. This includes the option of an item being usable if the flag for class "(None)" is true and the actor does not have a class, even if the usable by actor flag for that actor is false.
NOTE: This data type involves varying amounts of data.
NOTE: Whether an item is usable by a particular actor depends on both the usable by actor flag and the usable by class flag for that actor. This includes the option of an item being usable if the flag for class "(None)" is true and the actor does not have a class, even if the usable by actor flag for that actor is false.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: In the RPG Maker 2003 database editor there is an option to set the animation type to battle and a dropdown to select which battle animation to use. However, DynRPG does not have a corresponding field for the battle animation ID, so I was unable to include the ability to import the battle animation ID in DynDatabaseOverride.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
NOTE: This data type involves varying amounts of data.
Comment commands are the primary way for RPG Maker 2003 scripting in-game to communicate with DynRPG plugins. To make a comment command in RPG Maker 2003, use the Insert Comment event command option in the scripting of an event and put the appropriate text within the comment. Often, you will want to use variable values rather than preset values as arguments. You can do this by using DynRPG's standard syntax for a variable in a comment command, which is a V followed by the number of the variable you wish to reference. For example,
would use the value of the game's 10th variable as the argument of the command.
Exports all database values which DynDatabaseOverride is concerned with to .txt files -- see the Exporting section. The file name base argument is placed at the beginning of the file name for each exported file. For example,
would export "exported_Actors.txt", "exported_Classes.txt", "exported_Skills.txt", etc.
Imports all .txt files with the given file name base to the database -- see the Importing section. Note that unlike all of the other import comment commands, this command does not take a full file name including the .txt as an argument. It takes only the first part of the file name which is expected to be common to all files involved, with the rest being the standard naming convention for data files. For example,
would import "easy_Actors.txt", "easy_Classes.txt", "easy_Skills.txt", etc. Any files which are not found will be skipped.
Imports a file with the given file name to the database as the particular subset of data that's part of the command name -- see the Importing section. Yes, I'm being a little lazy here and giving you just one entry to describe tons of extremely similar comment commands. For example,
would import "easy_Actors.txt" into the database as actor information. Note that the file name can be anything at all; you do not have to follow the standard naming convention with this command, or even have the file name end with ".txt". The contents of the file, however, must follow the correct format for the data subset expected.
The full list of subsets which can be used for the <subset> part of the comment command are:
The source code for the DynDatabaseOverride plugin is provided in the DynPlugins/DynDatabaseOverride folder of the DynDatabaseOverride demo project. Feel free to modify the plugin to suit your purposes, release alternate versions, use snippets of code in other projects, etc. Some credit to Aubrey the Bard would be appreciated if you use a significant portion of the source code, but I won't make a big deal out of it. Instructions for creating DynRPG plugins can be found on the Getting Started page of the DynRPG website.
I would be glad to hear about bug reports for this plugin, projects in which it is being used, comments and criticisms, suggestions for future plugins, etc. Here are some ways to contact me:
v1.0 (03/09/2021):