Qhimm.com Forums

Miscellaneous Forums => Troubleshooting => Topic started by: Softtm17 on 2014-03-14 09:58:07

Title: FF VIII Chara.one World.fs
Post by: Softtm17 on 2014-03-14 09:58:07
Always me ^^"
There is any way to extract the model from the world.fs?
We are interested to take IF possible:
All models about the world map...
So city, car, ragnarock, mini squall etc

I have the plugin for the noesis that extract the normal chara.one in field.fs, but when i try to extract "That" chara.one in world.fs i got an error.
I've see the structure in hex edit and it's different from the normal one....so i'm asking you if anyone have a new script or something that can be usefull for extract all.
(i think there is also something inside the other forlder "dat" where there are some obj file....there is any way to extract something from there? Inside the file wmsetit.obj there are some textures about garden car etc....)
Thanks again, waiting for you answers.
Title: Re: FF VIII Chara.one World.fs
Post by: Vehek on 2014-03-15 06:09:09
The chara.one in world.fs is an older type of chara.one. They were used in the PS1's FF8 demo and sometimes appear in the old, unlinked field archives, but the one in world.fs appears to be the only actual use of the old format in the final version.
Some details about the format. I don't know if this is the right term, but there's a "footer". To read it, you have to work backwards from the end of the file. Unlike the headers in standard chara.one files, all offsets are absolute, not relative.

Code: [Select]
import struct
import os.path
from os import mkdir

class genericEntry:
    def __init__(self):
        self.location = 0
        self.size = 0
        self.isNPC = False
        self.MCHNumber = -1
        self.TIMlocations = []
        self.modelLoc = 0
        self.sizeBeforeAnims = 0
        self.anims = []

def unread(src):
    loc = src.tell()
    curResult = struct.unpack("<I", src.read(4))[0]
    src.seek(loc - 4)
    return curResult

name = raw_input('File name:')
src = open(name, 'rb')

charaEnd = struct.unpack("<I", src.read(4))[0]
src.seek(charaEnd - 4)

totalModels = unread(src)

models = []

for i in range(totalModels):
    mdl = genericEntry()
    firstNum = unread(src)
    if (firstNum & 0xD0000000) == 0xD0000000:
        mdl.MCHNumber = firstNum & 0xFFFF
        mdl.location = unread(src)
        mdl.isNPC = True
        loc = unread(src)
        while loc != 0xFFFFFFFF:
            loc = unread(src)
        mdl.modelLoc = unread(src)
        mdl.location = firstNum & 0xFFFFFF

fillerplace = genericEntry()
fillerplace.location = src.tell() + 4

if not os.path.exists("%s_extract" % (name)):
    mkdir("%s_extract" % (name))

for i in range(totalModels):
    curmdl = models[i]
    rawdata = src.read(models[i + 1].location - models[i].location)
    if curmdl.isNPC == True:
        outmdl = open('%s_extract\\mdl%02d.mch' % (name, i), 'wb')
        for offs in curmdl.TIMlocations:
            outmdl.write(struct.pack("I", offs + 0x100 - curmdl.location))
        outmdl.write(struct.pack("I", 0xFFFFFFFF))
        outmdl.write(struct.pack("I", curmdl.modelLoc + 0x100 - curmdl.location))
        while outmdl.tell() < 0x100:
        outmdl = open('%s_extract\\d%03d_anim.bin' % (name, curmdl.MCHNumber), 'wb')

Title: Re: FF VIII Chara.one World.fs
Post by: kaspar01 on 2014-03-15 08:27:46
Thank you Vehek! :)

Do you know maybe something too about how extracting the models in wmsetus.obj?or about terrain (not sure about them but they could be in that big wmx file even if textures are in wmsetus and textl files..
Title: Re: FF VIII Chara.one World.fs
Post by: Softtm17 on 2014-03-15 10:28:29
Yup now it's working but i see another "Old" thread...where you talking about the .obj file inside the world.fs......i'll try to open wmsetus.obj go in the address 0x3BB4 (if i don't remember bad) and see where are the models...but how can we exctract them? (And where is the lenght of the file? >_>) You said there is just the mesh and no bones (so no animations), for me is good in anycase.
We got alredy the texture with another tool but we cannot find a way to extract them and make all these readable on noesis or 3ds studio max >_>