After watching my hack blow up two times I decided it took far too long to manually input every stat, one at a time, into SF2 Edit. And so, with SpaceKing's permission, I grabbed the source code and added on a bit of import functionality to SF2Edit with Excel.
I used the .xls format so that those without Excel 2007 or later can still run the program. Also, since everything exports to .csv files even if you don't have Excel you can still do the import. I'll talk more about manually editing the .csv files near the end of this post. Remember to enable macros or the Excel file won't function properly.
SF2 Edit File Importer Download (335 KB)
Word of warning: I didn't add much error checking in this, so make sure you back up your rom before usage.
You can only import data for the following five data sections:
Items (minus the equip flags)
Everything else still must be manually altered. I may one day add functionality for shop data and character starting data. I do not expect I'll add import options for any of the other sections.
Quick and Dirty Program Overview
After unzipping the file your first step should be to open up the Excel document. You should see the following page. Click on "Export All Data" to generate the .csv files. Each time you export Excel will overwrite those files. If you do not wish for them to be overwritten rename them and Excel will simply create new ones.
Once you have the .csv files created you can open the SF2 Edit Import program. Open the Character Stats section and you should see something similar to the image below. If you've exported everything into the same folder you should see "CharacterExport.csv" as an available file. The program looks for keywords to list the files. In the case of the Character Stats it looks for the word "Character" in the file name.
Select "CharacterExport.csv" and press "Import All" to import all of the character data contained in the .csv into SF2 Edit. The Copy button will copy data only for a single character. Note that the Character import won't try to match up the correct stats to the correct character. It only knows what goes where based upon the order.
The pages for Spells, Items, etc, all operate pretty much the same way.
Entering Data into the Excel Document
- Only enter values into cells without formulas. For the most part I try to color cells you shouldn't change a darker color (usually gray or darker blue) and leave the ones you can edit as white or light blue.
- If a cell has a drop down menu, only blanks and entries from the drop down can be used.
- The tabs at the bottom are color coded. Dark Blue tabs (stats, chart, battles, shops) contain data that does not get exported or imported and exists only for your own use.
- All data is from the original Shining Force 2, except for the Shops tab, which contains data from my hack.
The Fly and Promo Codes and the Best Weapon are not exported.
The order on the page is the same order as SF2Edit. If you delete the rows for Jaha then when you import the data into SF2Edit Jaha's stats will populate with Kazin's, Kazin's with Slade's, etc.
The dark blue cells all auto-populate with the value necessary to produce the promoted stating value. The blue cells are influenced by the curve type (linear, late, etc) and the Promo Lv. You can edit the Promo Lv. in the yellow cell at the top of the page.
Use the "Level" cell to set the current level for the stats tab.
Do not change the order column. This page is mostly drop downs and should be self explanatory.
Data from this sheet is exported when you press "Export This Page" on the Characters tab.
Select spell name followed by the character level required to learn that spell level.
Only edit the white cells.
The "Use Base" column means "Use Base Class Spell List." To select that option enter an "x". Otherwise leave blank.
There is a lot of extra information on this sheet. The columns that are exported, however, are only A through M. Only change data in those columns and only change the white cells.
The extra information on this sheet is for balancing purposes and focused around the efficiency of Freeze 4. I left it in there in case someone wanted to use it, but it serves no purpose for the export of data.
If you know how to hack in different hex codes in a ROM you can add lines or change codes in this sheet to reflect those changes. It doesn't hurt to have too many spells listed here: the importer will simply skip those not present in the ROM.
It is not recommended that you alter the format of this sheet. Remember that while you can edit more than two attributes for an item, only two will ever import into SF2Edit and the ROM. By this I mean if you make the Wooden Sword increase your critical chance, give +3 attack, +5 defense, +2 agility, and +1 move, it'll only be +3 attack and +5 defense once imported because only two attributes are allowed. A spell does not count as an attribute.
Enter an "x" in the columns labeled "E" in order to equip a weapon. Monsters will only ever use the first item (Item 1) and only receive stat bonuses for Item 1 (if it's equipped).
Each monster can have up to four spells but will only ever use the first spell listed unless it is a healer, in which case it will use the first two spells listed (provided the first is a healing spell).
The grayed "Att2" column automatically calculates based upon the weapon bonuses and the "Att1" column. "Att2" is what you'll see displayed in the game and is the monster's true attack. "Att1" is what you'll see in SF2 Edit.
The other stats (Def, Agi, and Mv) should be entered exactly as you wish them to appear in game. That is, if you have a monster that you want to have 25 defense and they have a protect ring equipped (giving them +5 defense) you should enter in "25" in the defense column. Do not enter "20." The program, upon export, will then alter the value appropriately. This means that unlike the Attack stat you can change the item bonuses without having to readjust monster stats.
Spell power should be "0" if you want the monster to do pre-promoted spell damage, and it should be "99" if you want the monster to do post-promoted spell damage. No other entries (except leaving it blank) are valid for this column.
Currently the Model and Palette columns are not exported.
Editing the .csv files directly
Download .csv Files (8 KB)
For those who don't know, a .csv is simply text separated by commas. The first two lines of SpellExport.csv, for example, is this:
If you change the extension on a .csv to .txt you can edit them using note pad. Just remember to change it back to .csv so that you can import the changes.
It will take me far too long to describe all the various formats for each file column, but here's a list of what data each column contains. If you have any questions about something feel free to ask and I can elaborate.
Some things to note:
All of the hex codes can be found in the Data folder that downloads with SF2 Edit.
Leaving things blank is how to not add things. Leaving spell spaces blank gives no spells. Leaving resistance codes blank gives no resistance.
You can still make use of the ability to change stats and numbers without requiring the full understanding of how all parts of the .csv work.
1. Character Name (not imported)
2. Class (not imported)
4. HP max
5. HP curve (see Stat curve strings below)
7. MP max
8. MP curve
10. Att max
11. Att curve
13. Def max
14. Def curve
16. Agi max
17. Agi curve
18. Use base class spell list flag (enter "x" to use base class spell list, or leave blank)
All of the remaining data are spells. Spells are done in the format of Spell Hex Code, character level when learned. So...
19. First spell learned Hex code (Egress is "A", for example)
20. First spell character level when learned (for Bowie this is "1", since Egress is learned at level 1)
Add up to 16 spells to learn for each character.
1. Class Name (not imported)
2. Abbreviation (not imported)
3. Movement type (see Movement Type strings below)
5. Critical attack (see Critical Attack strings below)
6. Double attack (see Double/Counter Attack strings below)
7. Counter attack
8. Fire resistance (see Resistance Codes below)
9. Ice resistance
10. Lightning resistance
11. Wind resistance
12. Status resistance (see Status Resistance Codes below)
1. Name (not imported)
2. Hex reference (you shouldn't change this unless you know what you're doing)
4. Min Range
5. Max Range
6. Area of Effect
8. Animation code
9. Spell Type (see spell type strings below)
1. Name (not imported)
5. Att (remember this is before the weapon bonus and the +25% attack power)
9. Move Type (see movement type strings below)
The next 6 entries are for three items, coded as Item Code, Item Equip Flag. Enter "x" if as the Item Equip Flag to have the monster equip the item. Note that only the item in the first equipment slot adds bonuses to the monster. The importer will never assign a fourth item to a monster.
11. Item1 hex code
12. Item1 equip flag
The next four entries are the monster's spells. Monsters will only ever cast Spell1, unless they are a healer, in which case they will cast either Spell1 or Spell2. Spell3 and Spell4 are just for show.
17. Spell1 hex code
18. Spell2 hex code
21. Critical attack (see Critical Attack strings below)
22. Double attack (see Double/Counter Attack strings below)
23. Counter attack
24. Fire resistance (see Resistance Codes below)
25. Ice resistance
26. Lightning resistance
27. Wind resistance
28. Status resistance (see Status Resistance Codes below)
29. Spell power (use "0" for pre-promo, use "99" for post-promo)
1. Item Name (not imported)
2. Hex (it is recommended that you don't change this)
3. Min range
4. Max range
5. Gold cost
6. Item Type (see Item Types below -- uses the number, not the string)
7. Spell hex code
The next four entries are used for the item attributes in the format of Attribute, Value. Each item can have at most two attributes. Attributes are anything from Attack Up to Critical Chance.
8. Attribute1 (see Item Attribute codes below -- uses the number, not the string)
9. Attribute1 value
11. Attribute2 value
Stat Curve strings
Movement Type strings
Critical Attack strings
Double Attack/Counter Attack chance strings
Status Resistance Codes
Spell Type strings
2 Normal Weapon
8 Special Item
A Special Weapon
C Normal Ring
18 Story Item
1A Force Sword
20 Normal Item
28 Battle Item
4A Cursed - Glove Axe Shot Lance
82 Indra Staff?
8A Magic Weapon
8C Magic Ring
CA Cursed - Sword Rod
CC Cursed Ring
Let me know if you have any questions. And remember to backup your file!