Adding key-items
You cannot add items to the game's database, because the only way to add items that actually do anything would be to edit the source code of the game.
But at any time during the game, you can easily add items to the player's inventory that don't do anything. I often do this for things like keys and story items.
To add an arbitrary item to the inventory,
run the level editor, go into an event script, and add a
command.
But... leave the top box blank and type something like this into the bottom area:
[RAM_F.items.addItem(myItem)]
Just make sure there aren't any spaces anywhere. Also, this command is case-sensitive. After the game runs this, an item called "myItem" will get added to the player's inventory. If you run this command multiple times, the quantity of this item will increase in the inventory. You can replace the word "myItem" with anything you want.
Or you can use the name of an actual in-game item to add working items to your inventory, such as
potion,
super_potion, or
tm_strength (in-game items are always lowercase)
You can also remove items with this special command:
[RAM_F.items.removeItem(myItem)]
Or if you want to completely remove an item from the inventory, you can create a
command, and type this into the three boxes:
items.myItem
=
/delete
If you want to check whether or not the player has a certain item, use an
command in the script editor and set its three boxes like this:
items.myItem
>
0
The game stores the item's quantity in that variable, so if you had 3 potions, then items.potion would be equal to 3.
You can also make sprites appear or not appear based on the existence or quantity of an item by typing this into the sprite's flag list
(located on the lower-left corner of the editor when you have a sprite selected)
items.myItem>0
A sprite with this flag will only appear if this condition is true. And sprites with multiple conditions will only appear if every single condition is true. Again, make sure there are no spaces and make sure you have all the capital letters correct if you used any capital letters in the item's name.