Author Topic: [RELEASE] FF7tk  (Read 1511 times)

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
[RELEASE] FF7tk
« on: 2012-03-23 14:37:35 »
      Today i am happy to announce that FF7tk is now ready to have its first release.


      FF7tk WTF is that ???

      allow me to explain as some of you may know myself and a few others (vegeta_ss4,eslava) have been working on a toolkit for working with data from ff7. this toolkit will (eventually) cover ALL of the stuff needed to work with ff7 files. (everything from save data  to model info). this toolkit is written in C++ and Requires Qt (but this will make any programs you make cross platform,you can use any lang for your program that is qt supported).its under the GPLv3(so if you use it we want to see your code!) Programmers are encoraged to provide requests for objects, or info about things they already know.

      What is currently included.
      Currently there are only a few objects that deal mostly with stuff needed for black chocobo (as it is now build using FF7tk). but all the text data returned will be translated for you already (working on how to getting the translations used per class instead of per application , but the strings are done already)

      static_data classes included
      • FF7Save -class for working with save files
      • FF7Item-data class that know all about items (and icons)
      • FF7Materia - data class that know all about materias(and icons)
      • FF7Location - data class that know all about field location data
      • FF7Text - data class for converting text to/from ff7 format to your lang.
      • FF7Char - data class that contains info about characters in ff7(and icons)
      • SaveIcon - class for decoding psx save icons- Written by Myst6re
      Utilities Include:
      • LGP - Object for working with LGP archives
      • LZS -  Object for working with LZS archives
      Widgets (gui objects) Included:
      • ItemPreview - Show item data (only need its id)
      • ItemSelector - Widget for selected Items for your inventory
      • ItemList - inventory management widget
      • DialogPreivew -show prevew of the ff7 text dialog (or change its colors)
      • SlotPreview - Show Slot Preview using Description data (or show psx save info)
      • SlotSelect - Dialog for Selecting a Save Slot to view
      • MateriaEditor - View/Edit A Selected Materia
      • CharEditor - View/Edit a Character(wip)
      • OptionsWidget - View/Set All Game Options
      • DoubleCheckBox - 1 Label 2 Checkboxes.
      • PHSListWidget - Manage Visible/Locked PHS Entries
      • MenuListWidget - Manage Visible/Locked Menu Entries
      • ChocoEditor - Edit a Chocobos Data
      • ChocoboLabel - Stable Preview Widget. 
      • ChocoboManager  - Manage your Chocobs Easily
      • MetaDataCreator - Convert old saves to FF7 2012 Cloud Saves


      Where is this going???
      as i said currently most of the items are focused on save game stuff. but eventually we are planing to include EVERYTHING needed to provide a High Level toolkit for easy creation of cross platform tool for working with and modifing ff7

      Where can i get it?

      You can
Get it Here

The toolkit includes a small demo program so you can view the widgets. you only need qt to build the included demo program.

Good Idea How can i help?
help us code , provide info on formats, give us your exsisting code so we can port to Qt, etc. these are all ways you (the person already making an ff7 specific app) can help.i would love to see all of qhimm embrace this and have us not duplicate work on these tools ever again.[/list][/list]
« Last Edit: 2013-05-24 15:14:25 by sithlord48 »

Vegeta_Ss4

  • Fast newbie
  • *
  • Posts: 30
  • Young Padawan of the Savegame
    • View Profile
    • Black Chocobo
Re: [RELEASE] FF7tk
« Reply #1 on: 2012-03-23 15:06:48 »
I think this will write a very important page in the ff7 devel. I'm glad to be part of this so promising project, and you will have me coding side by side as always.

I encourage all the community to help and form part of this project. One of the more promising goal is to been able to dev universal global toolkit that embrace all the scenarios.

Welcome FF7tk Toolkit!

Obesebear

  • Global moderator
  • No life
  • *
  • Posts: 2909
  • King of Model Importing
    • View Profile
    • Modders Haven
Re: [RELEASE] FF7tk
« Reply #2 on: 2012-03-23 16:07:54 »
I like it and thoroughly encourage this.

Dark_Ansem

  • Crazy poster
  • *
  • Posts: 223
    • View Profile
Re: [RELEASE] FF7tk
« Reply #3 on: 2012-03-26 16:54:00 »
I like this and I hope that, for the model editing, you join up with Borde, the author of kimera, in order to improve on the features of that mod :D
maybe this can join as well with the new versions of WallMarket and Proud cloud the author is working on?

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #4 on: 2012-03-26 17:22:42 »
i would love it if those people who know about certain parts can work with us to create a toolkit we can all use.

Dark_Ansem

  • Crazy poster
  • *
  • Posts: 223
    • View Profile
Re: [RELEASE] FF7tk
« Reply #5 on: 2012-03-26 17:24:05 »
AFAIK they're both very busy, but one can try....

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #6 on: 2012-07-03 18:32:27 »
While Work on this project has been slowed down a bit there is still progress being made. For some objects we are waiting for Qt 5.0 to come out so that we can use some of the newer features. For older objects there will only need to have small update to build with Qt 5.0. ( this is basicly Done already and it all works under Qt5 currently)

Some FF7Tk Related News:
  Updated: CharEditor, mostly completed.needs the layout optimized before i am ready to use it in black chocobo.(its to large)
  Updated: All Static Data Classes Have Been updated.
  New: ChocoboEditor Widget to Edit your Chocobo Stable.

Some Data on the Objects of Use: (start of Documentation)
Please Note: Requirements for items only count the files from the Tk that need inclusion in your project. All objects require Assorted Items from the Qt Toolkit.

FF7Text - Convert Text To/ From FF7 Format
Requirements for use: None

Functions:

void FF7Text::init(bool ja)
Sets What Char Table will be retruned.
 true: for Japanese Char Table
 false: for all others.

QString FF7Text::toPC(QByteArray text)
Converts text into a standard QString decoded from ff7text format

QByteArray FF7Test::toFF7(QString text)
Converts text into ff7 text format

FF7Save - The Core Object for Working with FF7 Save Games.

Requirements for use:
FF7Save_Const.h  - All consts placed here
FF7Save_Types.h  - All Custom Types for this class here.
FF7Text.h  - Text Conversion Object

Loading and Saving Functions

bool  loadFile(const QString &fileName)
bool saveFile(const QString &fileName)
Load or Save fileName (type is auto detected)

bool exportPC(const QString &fileName)
bool exportVMC(const QString &fileName)
bool exportDEX(const QString &fileName)
bool exportVGS(const QString &fileName)
Export data as that type to fileName , all 15 slots

bool exportPSX(int s,const QString &fileName)
Exports Slot s to raw PSX format file name fileName.  (even if more then one data block)

bool exportCharacter(int s,int char_num,QString fileName)
Exports Character from slot s in character slot char_num to fileName

bool importCharacter(int s,int char_num,QByteArray new_char)
Imports new_char (raw 132 byte array) to slot s in character slot char_num.

All Above Functions Return 0 if Fails to load/save fileName

void importPSX(int s,const QString &fileName)
void importPSV(int s,const QString &fileName)

Imports data from fileName to slot s

void clearSlot(int s)
clears data in slot s (fills with 0's)
void copySlot(int s)
saves slot s into a buffer

void pasteSlot(int s)
pastes save stored in buffer to slot s

void newGame(int s,QString fileName="")
Puts default Save in slot s  if no fileName is provided.
if a fileName is provided it MUST BE PSX Format data.

void newGamePlus(int s,QString CharFileName,QString fileName="")
Creates a new Game + in slot s. exports cait/ vincent to CharFileName.
if no fileName is provided will use default save to make the new game +
if a fileName is provided it will be used to create the new game + it MUST BE PSX Format.

File Info Functions (the headers code says it all)

int lenFile(void);//Return File length.
int lenFileHeader(void);//Return File Header length
int lenFileFooter(void);//Return File Footer length
int lenCoreSave(void);//Return Slot length (data portion)
int lenSlotHeader(void);//Return slot header length
int lenSlotFooter(void);//Return slot footer length
int lenSlot(void);//Return Slot length
int numberOfSlots(void);//Return number of slots in the file_footer_dex
QString type(void);// Returns the file type loaded.
bool isFF7(int s);//valid ff7 slot?
bool isPAL(int s);//PAL SLOT?
bool isNTSC(int s);//NTSC SLOT??
bool isJPN(int s);//is a Japanese File
QString region(int s);// region string of slot s
//Set Needed Info Stuffs
void setType(QString);//allows for slot change.
void setRegion(int s ,QString region);
QByteArray slot_header(int s); //return slot header.
quint8 psxBlockType(int s);//mask of psx slot (used by index)
quint8 psxBlockNext(int s);// if using more then one block return location of next block
quint8 psxBlockSize(int s);//how many blocks save uses.
void fix_pc_bytemask(int s);// update so last slot is shown selected on load (must be public to set to currently viewed slot).

FF7Char - Info About Characters.

Requirements : xpm files in icons/Char_Icons

Functions

quint8 id(int who);
return who's  id

int numberOfWeapons(int who);
return the number of weapons who can use

int weaponOffset(int who);
return the starting item # of who's weapons

QString defaultName(int who);
return whos DefaultName (translated)

QImage image(int who);
return QImage Version of who avatar picture.

QIcon icon(int who);
return QIcon Version of who avatar picture.

QPixmap pixmap(int who);
return QPixmap Version of who avatar picture.

QStringList limits(int who);
Return a list of whos limits (translated)

quint32 totalExpForLevel(int who,int level);
return how much xp who needs to reach what level

quint32 tnlForLevel(int who,int level);
returns starting tnl for who at what level

int statGain(int who,int stat,int stat_amout,int next_lvl);
return amount gained in stat by who in what stat , needs to know the current stat_amount , and next_level of who
stat table 0 str, 1 vit, 2 mag,  3 spi, 4 dex, 5 luck,6 hp,7mp
usefull for when leveling up or down (not so much down )

FF7Item - Info About FF7 Items

Requirements: xpm files in icons/Item_Icons/

Functions:

General Info about Item
QString name(int id);
return translated Name if item id

QString desc(int id);
return translated description of item id

qint8 type(int id);
return item id's type
type : 1-item, 2-wep_cloud, 3-wep_barret, 4-wep_tifa, 5-wep_red, 6-wep_aerith, 7-wep_cid, 8-wep_yuffie, 9-wep_cait, 10-wep_vincent, 11-armor, 12-accessory

qint8 materisSlots(int id);
return number of materia slots item id has

qint8 linkedSlots(int id);
return number of linked pairs of materia slots item id has

qint8 materiaGrowthRate(int id);
Return materia growth rate for item id.

Status Info For Items

qint8 statHP(int id);
Return Bonus item id provides for Hp

qint8 statMP(int id);
Return Bonus item id provides for Mp

qint8 statSTR(int id);
Return Bonus item id provides for strength

qint8 statVIT(int id);
Return Bonus item id provides for vitality

qint8 statDEX(int id);
Return Bonus item id provides for dexterity

qint8 statLCK(int id);
Return Bonus item id provides for luck

qint8 statMAG(int id);
Return Bonus item id provides for magic

qint8 statSPI(int id);
Return Bonus item id provides for spirit

Elemental Functions

qint8 elementRestoration(int id);
qint8 elementFire(int id);
qint8 elementCold(int id);
qint8 elementLightning(int id);
qint8 elementEarth(int id);
qint8 elementWind(int id);
qint8 elementWater(int id);
qint8 elementGravity(int id);
qint8 elementHoly(int id);
qint8 elementPoison(int id);
qint8 elementCut(int id);
qint8 elementShoot(int id);
qint8 elementPunch(int id);
qint8 elementHit(int id);
Above Functions return the kind of effect item id has for each element
for all elemental functions

           -3: Absorb
           -2: Nullify
           -1: Halve
            0: No Effect
           +1: damage

//Status Functions
qint8 statusDeath(int id);
qint8 statusSlowNumb(int id);
qint8 statusDeathSentence(int id);
qint8 statusParalysis(int id);
qint8 statusPetrify(int id);
qint8 statusSilence(int id);
qint8 statusSleep(int id);
qint8 statusConfusion(int id);
qint8 statusBerserk(int id);
qint8 statusFrog(int id);
qint8 statusMini(int id);
qint8 statusPoison(int id);
qint8 statusFury(int id);
qint8 statusSadness(int id);
qint8 statusDarkness(int id);
qint8 statusHaste(int id);
qint8 statusSlow(int id);
qint8 statusStop(int id);
qint8 statusBarrier(int id);
qint8 statusMagicBarrier(int id);
qint8 statusReflect(int id);
qint8 statusShield(int id);
qint8 statusRegen(int id);
qint8 statusResist(int id);

Above Functions return the kind of effect item id has for each element
all Status Effects
           -2: Protect
           -1: Remove
            0: No Effect
           +1: Infilict
           +2: Auto SelfCast
//Pictures
QImage image(int id);
return QImage of Items in game icon

QImage imageMateriaSlotNoGrowth(void);
return QImage of in game Materia slot (no growth type)

QImage imageMateriaSlot(void);
return QImage of in game Materia slot (no growth)

QImage imageMateriaLink(void);
return QImage of in game Materia link

//StyleSheet Equilvents (ONLY QButtons)
QString styleMateriaSlotNoGrowth(void);
Return Style Sheet version of Custom No Growth Slot(only use on a QPushButton)

QString styleMateriaSlot(void);
Return Style Sheet version of Custom Growth Slot(only use on a QPushButton)

QString styleMateriaLink(void);
Style Sheet version of Custom Materia Link (only use on a QLabel)
« Last Edit: 2013-05-24 15:11:40 by sithlord48 »

Jenova's Witness

  • Insane poster
  • *
  • Posts: 342
  • Omnia mutantur, nihil interit
    • View Profile
    • Bio Research Lab
Re: [RELEASE] FF7tk
« Reply #7 on: 2012-07-03 18:48:06 »
Thank you for doing this, and doing it right.

Request:
*Instructions on adding your PPA to my sources
*Instructions for linux newbs on what to git clone, and a list of sudo apt-get commands to get all the required dependencies.

Also, I noticed you're using qt.  Are you sure that's a good idea for something as simple as a game editing program (though editing FF7 isn't exactly simple).  Do you think it may be a better idea to use something smaller, like, say, Phoenix, or GTK?

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #8 on: 2012-07-03 19:27:29 »
Thank you for doing this, and doing it right.

Request:
*Instructions on adding your PPA to my sources

*Instructions for linux newbs on what to git clone, and a list of sudo apt-get commands to get all the required dependencies.

add my ppa in (*)buntu thread about there here:
http://forums.qhimm.com/index.php?topic=11928.msg165409#msg165409

instructions.. well i don't use git. and  to build the FF7tk you neeed the source (link in first post above) and extract it
then for programs you can install them easily with the following command
Code: (run in terminal) [Select]
sudo apt-get install build-essential qtcreator

after you install you just have to open the .pro file in Qt Creator and build the Program.

Also, I noticed you're using qt.  Are you sure that's a good idea for something as simple as a game editing program (though editing FF7 isn't exactly simple).
  Do you think it may be a better idea to use something smaller, like, say, Phoenix, or GTK?
No i think Qt is perfect for this project. it has more os support then either of those toolkits mentioned.None of those toolkits run on phones,linux, windows, mac os Qt does. above i said something about not having to dupilcate work if you have to recode to make it work on an os or a device your redoing work. also unlike GTK, QT looks good on more then just Gnome.

Jenova's Witness

  • Insane poster
  • *
  • Posts: 342
  • Omnia mutantur, nihil interit
    • View Profile
    • Bio Research Lab
Re: [RELEASE] FF7tk
« Reply #9 on: 2012-07-03 20:17:07 »
I just don't want your effort to be screwed over by some of the bugs in QT.  So you can be aware of them:
http://byuu.org/articles/qt

You might wanna ask byuu yourself if something goes wrong with QT.  He has a lot of experience with it, and, if anyone can help you get it working, he can.

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #10 on: 2012-07-03 20:26:11 »
i've been coding w/ Qt for quite some time, in my code i rarely run into a problem with Qt itself , also that is over 2 years old. and most of it only either applies to windows or items i don't use or wouldn't need to use.

luksy

  • Crazy poster
  • *
  • Posts: 161
    • View Profile
Re: [RELEASE] FF7tk
« Reply #11 on: 2012-07-04 02:54:32 »
I've started rewriting the file twiddling code I used for touphScript, here's what I have so far

https://dl.dropbox.com/u/3227870/libs.7z

I haven't finished most of it yet, dunno if any of it is useful to you but just in case.

One suggestion: as I'm sure you know, the ingame text has subtle differences depending on where it's used - the meaning of the opcodes can change (e.g. 0xEA in scene.bin), unavailable ops (e.g. tab in world map) - so FF7Text will probably need to provide other functions (or be subclassed).

Although I support it all in touphScript if you want to have a look, the code is pretty awful (hence the rewrite).

I'm happy to help out either way.

Borde

  • Freak
  • *
  • Posts: 864
    • View Profile
Re: [RELEASE] FF7tk
« Reply #12 on: 2012-07-04 20:36:18 »
Nice idea sithlord48. Had this been done earlier, I'm sure we would have avoided some headaches. I don't feel like rewritting my code anymore, though. I've got some ported to C though. I can post it if you're interested.

sithlord48

  • Freak
  • *
  • Posts: 974
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: [RELEASE] FF7tk
« Reply #13 on: 2012-07-05 20:05:09 »
@luksy , i currently only know about text in the save format , but FF7Text can easily be subclassed or modified to have different versions. , thank you for the 7z stuff i will work in porting as soon as i get a chance.

@ Borde, i should have done this much eariler. but it started out as a rewrite of BC and then i realized that we could use a proper kit so i figured its best to start with what i knew about.  i will take what ever code you wish to provide(in c or not), credit will be given of course, and when im done what ever i end up with will be gpled