Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - red_evilspirit

Pages: [1] 2
I thought i can get T-pose with that code.
By the way, can you show me the structure of file?
Does it like

Following your post, i knew the animations are stored in files. I just thought i can get T-pose with that code.
I found this in an old topic.
My guess on how the files work. Might be incorrect because I didn't do any disassembly or testing in-game.

Code: ( Header Hypothesis) [Select]
0x00: Number of PC and NPC models (32-bit). Might not count for calculating offsets.
0x04: First model's header (detailed below)

PC Model header:
0x00: Pointer to animation data? (32-bit)
0x04: Size of the animation data or whatever it is. (32-bit)
0x08: Size again.
0x0C: MCH number? (32-bit? Upper 16-bits might determine whether header refers to PC or NPC)
0x10: 4 bytes
0x14: MCH name? Not sure if used. (4 bytes)
0x18: 4 unknown bytes

NPC header:
0x00: Pointer to first TIM (32-bit)
0x04: Size of TIM & Model data (32-bit)
0x08: Size again.
0x10: MCH-type header possibly starts here. Offsets are relative to the TIM image.
After the model data pointer: 8 unknown bytes.

Both types usually end with the hex bytes "EE EE EE EE" after the unknown bytes, though there may be exceptions.

Edit: The next to last section (the section pointed to by the DWORD at 0x38 of the model data header) of the MCH model data looks similar to what I guessed to be the animation data in the files. So that might be the pose information.

Code: (Animation Section hypothesis) [Select]
Section Header:
WORD Number of animations

Animation Header:
WORD Number of frames
WORD Number of joints (Koral labeled them bones.)

In that old thread, Qhimm said the animations were stored using 4 bytes per node. By counting I think there might also be an additional 6 bytes per frame, but I'm not absolutely sure.
Is it the structure of ?
It look like, but i can't check when it is npc or main field model

32-bit? Upper 16-bits
Does it like this?
Code: [Select]
type = readUInt()
type >> 16

I got offset of animation data in d024.mch (low Rinoa model)

I do something like this
Code: [Select]
unsigned char rots[4];
s16 rotations[3];
for (int i = 0; i < 3; i++)
rotations[i] = rots[i] << 2 | (rots[3] >> 2 * i & 3) << 10;
Code: [Select]
rots1 = readUByte()
rots2 = readUByte()
rots3 = readUByte()
rots4 = readUByte()
rotation1 = (rots1 << 0x02) | ((rots4 << 0x0A) & 0xC00)
rotation2 = (rots2 << 0x02) | ((rots4 << 0x08) & 0xC00)
rotation3 = (rots3 << 0x02) | ((rots4 << 0x06) & 0xC00)
when i print 'rotations', it didn't look like degrees of rotation.
What should i do to get correct degrees of rotation?

I write script like this, is it right ?
Code: [Select], NOESEEK_ABS)
animCount = bs.readShort()
framCount = bs.readShort()
boneCount = bs.readShort()
coordinatesOffset = bs.readBytes(6)
gido = []
for i in range(0,boneCount):
byte1 = bs.readByte()
byte2 = bs.readByte()
byte3 = bs.readByte()
byte4 = bs.readByte()
rotation1 = (byte1 << 0x02) | ((byte4 & 0x03) << 0x0A)
rotation2 = (byte2 << 0x02) | ((byte4 & 0x0C) << 0x08)
rotation3 = (byte3 << 0x02) | ((byte4 & 0x30) << 0x06)
xyz = {
"x": rotation1,
"y": rotation2,
"z": rotation3
when i dump 'xyz', all number is really big :(

Can you explain more about bone and animation data?

If you don't mind, can you share tool/source read data in mch fie?
I stuck at putting bone to right position and exporting animation.

there is any tool to read MCH file after export from main_chr.fs?
i need main character's animation :(

I can get battle animation but not main character animation.
Noesis can't read, where can i find main characters?

wow, thank you so much  :D.

Is there any way to export animation of character?
The wiki is down, i don't find any information about this issue.

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2018-02-10 06:48:37 »
sorry about irrelevant question,
where can i find document or tutorial about 'how to writing script to unpack file' like touphScript?
I don't know what keyword to find on google.


i can't see any 3d model :(
and do you know how to get animation of model?

if you don't mind, Rinoa's Toolset use for what version (steam, pc, psx) of FF8?
Before use Rinoa's Toolset, should i unpack something?

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-30 02:43:05 »
I lost font color when putting font image back to menu.lgp. What program should i use to keep all color?

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-26 16:25:04 »
what is happened  :'(
A few day before, ff7 still can read

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-26 15:50:38 »
it's my fault. if compiling ts on vs, it can't read utf8.
now i can replace character with ts, but i don't know why ff7 don't use font in window.bin anymore.
I redraw font in window.bin, Makou_Reactor can read it but ff7 still show original character.

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-24 12:47:25 »
You haven't yet grasped that ffvii has its own text encoding, touphscript handles converting between utf8 and the ffvii format.
I know the thing you say.
But ts only call process a part of utf8, if you debug with vietnamese character you'll see that.
before ts convert character to vector, it must read character from text file. In source code, ts use string type to store character. It can not handle some character like ọ, ư, ơ.
I can modify readText function, using wstring to store vietnamese character, but can't convert back to byteVec in stdString2Tex function

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-24 11:34:36 »
I'm guessing your issue is your trying to get it to read characters that aren't in the character table.
but in c++ language, string type only can store ascii.
I think even i can put vietnamese into flevel file, there is no way to force ff7 system recognize new symbol.
I should accept that from beginning :( i have spent two week for nothing.

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-24 08:19:47 »
I understand the way which replacing characters in the table.
As you say "utf8 is a variable width encoding, from 1-4 bytes",
i see stdString2Text() in source code,  it read all characters one by one so when reaching utf8 character it throw error. ts doesn't accept utf8 character when reading from text.

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-24 02:24:00 »
I see that table, but the problem is:
- ASCII is 2 byte so string type can store character one by one. And all ASCII character in ffstring.cpp, so i can't add more
- utf8 is 4 byte, string type split one character to two so i lost original character.
If i modify source from string to wstring, editing all function may be a bad choice:(
I think even when i can input uft8 character, it doesn't mean ff7 system can read that. Unless ff7 have font file like .OTF, .TTF or .FNT

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-23 17:43:51 »
I give up on inputting utf8 character. It's too complicated to modify source.
String can not store uft8, only ascii table.

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-23 09:02:04 »
No, I use mingw64 which you gave me, maybe you compiled with 32bit ;D.
I remove old touphScript.exe.res and compile again,  now i get touphScript.exe.
Could you tell me how to do with character like ọ ế ớ ...

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-23 08:37:51 »
actually, vs and g++ are the same, the different is vs have UI.
Finally i can link libz.a with this syntax:
Code: [Select]
LDLIBS :=  -L/ -lz -lshlwapi -lShell32But i got another error:
Code: [Select]
x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `touphScript.exe.res' is incompatible with i386:x86-64 output

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-23 01:15:13 »
It still got that error: Errors list
My makefile: Makefile
Anyway i ported ts to visual studio for easily debugging.
This is original text
This happen when i put uft8 character into text file image
What should i do to keep original uf8 character

FF7 Tools / Re: [FF7] Text editor - touphScript (v1.3.0)
« on: 2017-09-22 16:20:10 »
where can i get libz?
I used mingw in the link and it got the same error.

Pages: [1] 2