Welcome to the Shining Force Central Forums!
SFC Forums Index Shining Forums Shining Force II
Register for your free forum account now or Login to remove this advert.

Excel --> SF2 Edit data import

Import .csv stat files directly into SF2 Edit

Discussion about this classic Genesis/Mega Drive game.

Excel --> SF2 Edit data import

Postby SirHedge » Thu Nov 03 2011 7:22am

Update (11/12/2011): I protected the sheets in the Excel so that it should be more difficult for individuals to accidentally screw it up. You can download the new version using the same link below. There is no added functionality.

Original Post:
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.

Download:
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.

Data Import
You can only import data for the following five data sections:
Character Stats
Class
Monsters
Items (minus the equip flags)
Spells

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.

Image

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.

Image

The pages for Spells, Items, etc, all operate pretty much the same way.


Entering Data into the Excel Document

General Guidelines
- 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.

Characters Sheet
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.


Classes Sheet
Do not change the order column. This page is mostly drop downs and should be self explanatory.


Learning Sheet
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.


Spells Sheet
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.


Items Sheet
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.


Monster Sheet
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
WARNING: SPOILER!


Let me know if you have any questions. And remember to backup your file!
Last edited by SirHedge on Wed Nov 30 2011 2:46am, edited 3 times in total.
SirHedge

User avatar
Shining Hero
Shining Hero
 
Posts: 825
Joined: Sat Mar 15 2008 4:10am

Re: Excel --> SF2 Edit data import

Postby Noma » Thu Nov 03 2011 9:17am

Let me be the first to say: Thank you...very much. This is awesome.
All-Stars Mod: WIP, Revived! Check it out!
All-Stars Mod: WIP, Revived! Check it out!
Noma

User avatar
Shining Legend
Shining Legend
 
Posts: 1828
Joined: Thu Sep 16 2004 3:02pm
Location: Kearny, NJ

Re: Excel --> SF2 Edit data import

Postby nightshade00123 » Thu Nov 03 2011 1:44pm

This is awesome.

Very handy tool for one of the most tedious parts of getting things right, especially if your like me and broke things a million times LOL.
nightshade00123

Shining Hero
Shining Hero
 
Posts: 539
Joined: Tue Mar 15 2011 2:40am

Re: Excel --> SF2 Edit data import

Postby Stordarth » Thu Nov 03 2011 3:48pm

This is wonderful!

This will speed up CP stat alterations when they need to be made. Excellent work SirHedge.
Stordarth

User avatar
The L-Block Anomaly
Administrator
 
Posts: 15516
Joined: Thu Sep 16 2004 3:30pm
Location: The Midlands, Staffordshire, England

Re: Excel --> SF2 Edit data import

Postby SirHedge » Fri Nov 04 2011 2:06am

I'm glad some of you will find it useful. Let me know if you guys encounter any problems with it.
SirHedge

User avatar
Shining Hero
Shining Hero
 
Posts: 825
Joined: Sat Mar 15 2008 4:10am

Re: Excel --> SF2 Edit data import

Postby Drakonis » Fri Nov 04 2011 11:02am

This is simply amazing. Great work SirHedge!
Drakonis

User avatar
Shining Legend
Shining Legend
 
Posts: 2325
Joined: Fri Dec 05 2008 1:16pm
Location: Good ol' Germany

Re: Excel --> SF2 Edit data import

Postby nightshade00123 » Sat Nov 12 2011 5:55pm

Hey Hedge I was wondering is it possible to use the csv files if you have stat blocks that are different from vanilla?

You know how some classes in vanilla have 3 stat blocks, ie. sarah/priest/vicar/master monk, and some only have 2 like the hero/swordsman.

A lot of characters in mine have very different stat blocks and I was wondering if all I had to do was just delete out a line in the csv, like if sarah had 2 stat blocks like in mine would I just erase her 3rd one in the csv?

I would check myself but I'm not able to at the moment. Thanks in advance.
nightshade00123

Shining Hero
Shining Hero
 
Posts: 539
Joined: Tue Mar 15 2011 2:40am

Re: Excel --> SF2 Edit data import

Postby SirHedge » Sat Nov 12 2011 7:17pm

For characters the program simply runs down the list of characters as they appear in SF2Edit with how they appear in the CSV. Currently that matches perfectly with the promotions and what-not. So if you change your game/SF2Edit to read...

Bowie 1
Bowie 2
Sarah 1
Sarah 2
Sarah 3 (unused)
Chester 1
Chester 2
New Character 1 (formerly Chester 3 slot)
New Character 2 (formerly Jaha 1 slot)
New Jaha 1 (formerly Jaha 2 slot)
New Jaha 2 (formerly Jaha 3 slot)

...then you want the CSV to read the same thing in the same order. For the unused lines I would leave in dummy data in the Excel/CSV. I'm pretty certain the importer will just place zeroes in for stats if the line is blank, but I don't know how the game will handle that. Let me know if that makes sense. And remember to backup your file before you do this just in case. I'm expecting it to work as described, but I never tested it on a hack that changes the characters around.

As an added note, you can have more lines listed in the CSV than I list currently. So if you have a hack with more character slots than normal the importer should be able to handle that. The same is true for the other pages, although with spells, items, and classes you'll have to adjust the hex codes or order codes for it to import properly.
SirHedge

User avatar
Shining Hero
Shining Hero
 
Posts: 825
Joined: Sat Mar 15 2008 4:10am

Re: Excel --> SF2 Edit data import

Postby nightshade00123 » Sun Nov 13 2011 3:11am

Ahhhh, thank you. I expected it to do something like that, very nice indeed!

Thanks again.
nightshade00123

Shining Hero
Shining Hero
 
Posts: 539
Joined: Tue Mar 15 2011 2:40am

Re: Excel --> SF2 Edit data import

Postby RastaOddeye » Sun Feb 03 2013 12:36pm

Only just seen this for some reason. It's brilliant!
I'm arrogant, and proud of it.
I'm arrogant, and proud of it.
RastaOddeye

User avatar
Zeons Third General
Shining Legend
 
Posts: 1668
Joined: Tue May 10 2011 9:30am
Location: Sheffield

Re: Excel --> SF2 Edit data import

Postby SirHedge » Sat Feb 09 2013 12:58am

Glad you like it! And remember to back up your rom. While I've had no issues and have used it extensively on an extensively edited rom, Nightshade's rom died when he used it. If that happens to you, try out Ronnen's SF2EditDotNet which has the same import functionality (as in, you can use the Excel/CSV I created and import with his program).
SirHedge

User avatar
Shining Hero
Shining Hero
 
Posts: 825
Joined: Sat Mar 15 2008 4:10am

Re: Excel --> SF2 Edit data import

Postby ronnen » Sat Feb 09 2013 1:58am

Its just in beta right now though so be careful there too ^_~
ronnen

Shining Member
Shining Member
 
Posts: 162
Joined: Fri Jan 20 2012 9:01pm

Re: Excel --> SF2 Edit data import

Postby FinFish77 » Tue Sep 10 2013 2:57am

Hey Hedge, having a slight problem with this. I don't have Excel so I downloaded your .CSV files to the same folder as the Editor, but I'm getting a "Run time error: 53: File not found" error message when I try to run the program. Seems like it's pointing to a file that doesn't exist. Is there some special path that I need to save these .CSV at? Or is there another file I'm missing? Thanks.
FinFish77

User avatar
Member
Member
 
Posts: 99
Joined: Fri Apr 15 2005 12:10pm

Re: Excel --> SF2 Edit data import

Postby SirHedge » Tue Sep 10 2013 4:54pm

I'm not 100% sure, but I'm guessing that you need to place the "Data" folder from SpaceKing's SF2Edit into the same folder that holds the "SF2 Edit Import.exe" application. The .exe is nothing more than SpaceKing's editor with some of my own stuff tacked on, so it still needs all the same resources that SpaceKing's would need. I probably should have included that in my download.
SirHedge

User avatar
Shining Hero
Shining Hero
 
Posts: 825
Joined: Sat Mar 15 2008 4:10am


Return to Shining Force II

Who is online

Users viewing this topic: No registered users and 1 guest