Creating your own gems is a fairly straightforward process. The effects you can bestow with gems can range in complexity from simple stat bonuses to elaborate damage armors. This tutorial will teach you what you need to know to create custom gems and modify features of existing gems.
Most of the necessary changes can be made using a plain text editor. Creating a name and description for a gem requires the use of TalkEd to modify the dialog.tlk file.
Adding an Entry in gems.2daEdit
The first step in creating a new gem is to add a new row to the gems.2da file. The purpose of the values in each column can be found on the Gems.2da page. The new row will have the same style as the previous rows. Copying and pasting another row and then changing the row number will provide a template for future changes and will ensuring that the gem will function if you forget to change any fields.
The main columns of note in this 2da are the Effect and Parameter columns. The value in the Effect column corresponds to a row in effects.2da. This determines what kind of benefit the gem will grant, such as an increase in chi or intuition. The Parameter column determines the bonus size for the given effect. You'll notice there are three columns for each, meaning you can give each gem up to three effects.
A list of the labels in effects.2da and their effect can be found on the Effects.2da page. As an example, if you wanted your gem to increase the player's body, chi, and mind stats, you would enter 62, 64, and 65 in Effect0, Effect1, and Effect3. These numbers correspond to the rows for EFFECT_MODIFYBODYBASE, EFFECT_MODIFYSPIRITBASE, and EFFECT_MODIFYMINDBASE respectively in effects.2da.
Additional information regarding the effects can be found in their respective 2da file. Following the established pattern, the value in the 2da column corresponds to the row number of that effects 2da file in 2das.2da. Similar effects will often be located in the same 2da file. In this case the value in the row column represents the relevant row within that effects 2da file. This can be illustrated with the three previously listed effects: EFFECT_MODIFYBODYBASE, EFFECT_MODIFYSPIRITBASE, and EFFECT_MODIFYMINDBASE. All three effects are defined in statmodifybase.2da. The value in the row column of effects.2da determines which row in statmodifybase.2da has the desired effect.
Adding the Gem in items.2daEdit
The blueprint for the new gem has now been created but additional information is required by the game to create the item. This is found in items.2da which specifies the type of the item, its inventory image, its name, and its description among other things. A new entry must be created in this file for the new gem.
The purpose of each column in the file can be found on the Items.2da page. Again the label appears to be purely descriptive and has no effect in game. The essential features here are the row number of the new entry, and the type and id column.
The row number will come into play in the next step, but does not have any bearing at this point. The type column must have "gems" as its value. This directs the game to the gems.2da which will provide the rest of the information about the gem. Finally the id column will reference the specific gem you created earlier; it must match the row number your gem has within gems.2da.
Getting the Gem into the GameEdit
The game now has all the information necessary to create the gem in game. All that is left it to create a means for the player to attain it. This can be done in several ways but the simplest is to provide it as a reward in a specific area of the game. This is done by inserting the row number found in items.2da into the Item column of an ar_* file.
This allows the gem to be be given to the player after opening a specific chest or performing a similar non-combat action. Multiple items can be given by the same container or event by enclosing the item ids in quotation marks and separating the numbers with commas.