Users browsing this thread: 2 Guest(s)
Sonic Model Ripping Thread
Code:
--filein (scriptsPath + "Fatduck\\Big_Endian.ms")
fn readBinString f nChar = (
  txt = ""
  for j = 1 to nChar do txt += bit.intAschar (readbyte f #unsigned)
  return txt
)--end fn readBinString

fn test f = (
  clearlistener()
  UVary = #()
  for i = 1 to 557 do (
   readlong f
   tu = readBEFloat f ; tv = readBEFloat f
   append UVary [tu,tv,0]
   tu = readBEFloat f ; tv = readBEFloat f
   --format "%   %   %   %\n" (readBEFloat f) (readBEFloat f) (readBEFloat f) (readBEFloat f)
  )
  format "Here @ [%]\n" (d2h8 (ftell f))
  mm = undefined
  do (
   f1 = readBEword f
   if f1 != 0xFFFF then mm = boundary mm f1  
  ) while (ftell f) < 0x34CC
  format "MM: %\n Here @ [%]\n" mm (d2h8 (ftell f))
  
  msh = mesh vertices:UVary faces:#([1,2,3])
)
fn test2 f debugmode = (
  ChunkID = readBEDword f  --0x200
  ChunkSize = readBEDword f
  ukn01 = readBEDword f
  ukn02 = readBEDword f
  ukn03 = readBEDword f
  ukn04 = readBEDword f
  ukn05 = readBEDword f
  ukn06 = readBEDword f
  nVerts = readBEDword f
  ukn08 = readBEDword f  --padding??
  ukn09 = readBEDword f  --padding??
  ukn10 = readBEDword f  --padding??
  ukn11 = readBEDword f  --padding??
  ukn12 = readBEDword f
  ukn13 = readBEDword f
  ofsUV = readBEDword f
  ofsFcIdx = readBEDword f
  ukn16 = readBEDword f  --padding??
  ukn17 = readBEDword f  --padding??
  ukn18 = readBEDword f  --padding??
  ukn19 = readBEDword f  --padding??
  ukn20 = readBEDword f  --padding??
  bx1 = readBEFloat f ; by1 = readBEFloat f ; bz1 = readBEFloat f
  bx2 = readBEFloat f ; by2 = readBEFloat f ; bz2 = readBEFloat f
  ukn27 = readBEDword f
  ukn28 = readBEDword f
  ofsName = readBEDword f
  ukn30 = readBEDword f
  ofsEndTerm = readBEDword f
  if debugmode==true then (
   format "ID:%   Size:%\n" (d2h8 ChunkID) (d2h8 ChunkSize)
   format "%   %   %   %\n" ukn01 ukn02 ukn03 ukn04
   format "%   %   VT:%   %\n" ukn05 ukn06 nVerts ukn08
   format "%   %   %   %\n" ukn09 ukn10 ukn11 ukn12
   format "%   ofsUV:%   ofsFC:%   %\n" ukn13 (d2h8 ofsUV) (d2h8 ofsFcIdx) ukn16
   format "%   %   %   %\n" ukn17 ukn18 ukn19 ukn20
   format "% - %\n" [bx1,by1,bz1] [bx2,by2,bz2]
   format "%   %   ofsName:%   %   ofsEnd:%\n" ukn27 ukn28 (d2h8 ofsName) ukn20 (d2h8 ofsEndTerm)
   format "Here @ [%]\n" (d2h8 (ftell f))
  )
)--end debugmode
struct Res (
  ofs, blacksize, len, ofsname, name, type
)

fn readVesperiaMan f fscale debugmode = (
  FPS4Start = ftell f
  xxx = (readBinString f 4)
  format "%\n" xxx
  if xxx != "FPS4" then (
   messagebox "Not a valid Tales of Vesperia file!"
   return undefined
  )--end if
  nRes = readBEDword f
  ofsTbl = readBEDword f
  ofsBaseData = readBEDword f
  if debugmode==true then (
   clearlistener()
   format "FPS4   Res:%   \tofs:%[%]\n" nRes ofsBaseData (FPS4Start+ofsBaseData)
  )--end debugmode
  fseek f (FPS4Start+ofsTbl) #seek_set
  
  RESary = #()
  for i = 1 to nRes do (
   ofsData = readBEDword f
   DataBlock = readBEDword f
   RealSize = readBEDword f
   ofsName = readBEDword f
   append RESary (Res ofs:ofsData blacksize:DataBlock len:RealSize ofsname:ofsName)
  )
  if debugmode==true then format "after Indices Table @ [%]\n" (d2h8 (ftell f))
  for r in RESary do (
   if r.ofsname > 0 then (
    fseek f (FPS4Start+r.ofsname) #seek_set
    r.name = readstring f
   ) else r.name = ""
   if r.len > 0 then (
    fseek f (FPS4Start+r.ofs) #seek_set
    r.type = readBEDword f
   ) else r.type = 0x0BAD0BAD
  )
  if debugmode==true then (
   for j = 1 to nRes do
      format "%   \tofs:%[%]   len:%   type:%   Name:%\n" j (d2h8 RESary[j].ofs) (d2h8 (FPS4Start+RESary[j].ofs)) (d2h8 RESary[j].len) (d2h8 RESary[j].type) RESary[j].name
  )--end debugmode
  
  
  
)--end fn readVesperiaMan

fn nouse = (
  fname = "C:\\GameFiles\\TaleOfVesperiaX360\\chara\\npc\\MM_C000\\HEAD\\MM_C000_HEAD_7"
  f = fopen fname "rb"
  clearlistener()
  fseek f 0x50 #seek_set
  test2 f true
  fseek f 0x8CC #seek_set
  test2 f true
  fseek f 0x1BB0 #seek_set
  test2 f true
  fseek f 0x2C6C #seek_set
  test2 f true
  fclose f
)
/*
  fname = "C:\\GameFiles\\TaleOfVesperiaX360\\Test\\AHO_C_01.DAT"
  f = fopen fname "rb"
  readVesperiaMan f 1 true
  fclose f
  */
[Image: BadassSigcopy.png]
Thanked by:


Messages In This Thread
Sonic Model Ripping Thread - by Lugana Rysniq - 02-02-2011, 10:28 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-09-2011, 07:48 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 02-10-2011, 10:56 PM
RE: Sonic Model Ripping Thread - by Modemo - 02-21-2011, 02:55 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-21-2011, 03:32 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-21-2011, 04:58 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-22-2011, 01:57 AM
RE: Sonic Model Ripping Thread - by Azu - 02-22-2011, 04:41 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-22-2011, 12:25 PM
RE: Sonic Model Ripping Thread - by Azu - 02-22-2011, 02:02 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-23-2011, 02:42 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-24-2011, 12:19 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-24-2011, 01:25 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-24-2011, 02:49 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-24-2011, 02:16 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-24-2011, 08:10 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-25-2011, 02:45 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-25-2011, 04:17 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-25-2011, 06:01 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 02-26-2011, 02:31 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 02-26-2011, 03:06 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 02-27-2011, 04:00 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 05-29-2011, 06:06 AM
RE: Sonic Model Ripping Thread - by MikeyLevi - 05-29-2011, 09:36 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 05-30-2011, 02:41 AM
RE: Sonic Model Ripping Thread - by MikeyLevi - 06-01-2011, 08:45 PM
RE: Sonic Model Ripping Thread - by Maxpphire - 05-01-2011, 01:50 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 05-01-2011, 03:47 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 05-08-2011, 02:36 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 05-08-2011, 03:58 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 05-08-2011, 08:37 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 05-29-2011, 11:06 AM
RE: Sonic Model Ripping Thread - by KyroAtelerix - 06-02-2011, 08:05 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-06-2011, 12:48 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 06-02-2011, 11:20 PM
RE: Sonic Model Ripping Thread - by Crett - 06-06-2011, 05:46 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 06-12-2011, 05:07 PM
RE: Sonic Model Ripping Thread - by superfan91 - 06-15-2011, 12:19 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-24-2011, 01:48 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 06-24-2011, 04:58 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-24-2011, 01:03 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-24-2011, 07:37 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-25-2011, 10:06 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-26-2011, 02:50 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-27-2011, 02:46 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 06-26-2011, 01:41 PM
RE: Sonic Model Ripping Thread - by superfan91 - 06-27-2011, 07:36 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-27-2011, 07:57 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 06-28-2011, 12:30 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 06-28-2011, 01:48 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-01-2011, 12:09 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-01-2011, 06:14 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-01-2011, 06:45 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-01-2011, 09:39 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 06-30-2011, 09:46 PM
RE: Sonic Model Ripping Thread - by Azu - 06-30-2011, 10:24 PM
RE: Sonic Model Ripping Thread - by Tiberious - 07-01-2011, 03:15 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-01-2011, 10:34 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-02-2011, 12:30 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-03-2011, 05:35 PM
RE: Sonic Model Ripping Thread - by superfan91 - 07-08-2011, 03:52 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-09-2011, 05:51 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 07-04-2011, 05:05 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-09-2011, 07:29 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 07-11-2011, 12:49 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 07-11-2011, 10:29 AM
RE: Sonic Model Ripping Thread - by superfan91 - 07-29-2011, 12:54 AM
RE: Sonic Model Ripping Thread - by Friedslick6 - 07-29-2011, 01:37 PM
RE: Sonic Model Ripping Thread - by superfan91 - 07-30-2011, 07:26 PM
RE: Sonic Model Ripping Thread - by GrimmJeel - 07-30-2011, 09:53 PM
RE: Sonic Model Ripping Thread - by GrimmJeel - 07-29-2011, 02:08 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 07-30-2011, 09:52 PM
RE: Sonic Model Ripping Thread - by ManikDX - 07-31-2011, 08:07 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-01-2011, 02:25 PM
RE: Sonic Model Ripping Thread - by MaverickDVNT - 08-05-2011, 03:22 AM
RE: Sonic Model Ripping Thread - by Azu - 08-05-2011, 03:33 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-05-2011, 10:56 AM
RE: Sonic Model Ripping Thread - by Azu - 08-05-2011, 11:00 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-05-2011, 11:17 AM
RE: Sonic Model Ripping Thread - by ManikDX - 08-05-2011, 04:13 PM
RE: Sonic Model Ripping Thread - by tuxmask75 - 08-07-2011, 08:32 AM
RE: Sonic Model Ripping Thread - by ManikDX - 08-07-2011, 08:43 AM
RE: Sonic Model Ripping Thread - by ManikDX - 08-07-2011, 05:35 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-08-2011, 03:00 AM
RE: Sonic Model Ripping Thread - by ManikDX - 08-08-2011, 03:50 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-09-2011, 07:44 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-10-2011, 05:20 AM
RE: Sonic Model Ripping Thread - by Azu - 08-10-2011, 02:42 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-10-2011, 02:50 PM
RE: Sonic Model Ripping Thread - by ManikDX - 08-10-2011, 06:37 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-10-2011, 02:35 PM
RE: Sonic Model Ripping Thread - by Azu - 08-10-2011, 03:07 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-10-2011, 03:43 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-15-2011, 05:05 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-20-2011, 08:44 PM
RE: Sonic Model Ripping Thread - by Azu - 08-20-2011, 09:43 PM
RE: Sonic Model Ripping Thread - by ManikDX - 08-21-2011, 06:15 AM
RE: Sonic Model Ripping Thread - by ManikDX - 08-14-2011, 06:16 AM
RE: Sonic Model Ripping Thread - by Azu - 08-15-2011, 05:09 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-16-2011, 04:14 PM
RE: Sonic Model Ripping Thread - by ManikDX - 08-18-2011, 03:58 AM
RE: Sonic Model Ripping Thread - by superfan91 - 08-20-2011, 08:26 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-21-2011, 01:13 PM
RE: Sonic Model Ripping Thread - by Friedslick6 - 08-22-2011, 05:39 AM
RE: Sonic Model Ripping Thread - by Azu - 08-21-2011, 12:42 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-21-2011, 03:11 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-22-2011, 08:35 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-23-2011, 11:09 AM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-23-2011, 01:14 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-23-2011, 03:30 PM
RE: Sonic Model Ripping Thread - by Friedslick6 - 08-25-2011, 05:11 AM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-25-2011, 05:13 AM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-25-2011, 03:05 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-25-2011, 11:54 AM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-25-2011, 07:09 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-25-2011, 07:47 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-25-2011, 09:59 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-26-2011, 01:50 AM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-29-2011, 07:21 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-29-2011, 08:01 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-29-2011, 08:07 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 08-29-2011, 08:19 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-29-2011, 11:10 PM
RE: Sonic Model Ripping Thread - by MikeyLevi - 08-30-2011, 01:03 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 08-30-2011, 02:02 PM
RE: Sonic Model Ripping Thread - by Shadowth117 - 10-03-2011, 06:01 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 10-07-2011, 06:06 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 10-08-2011, 01:59 PM
RE: Sonic Model Ripping Thread - by Lugana Rysniq - 10-08-2011, 07:37 PM
RE: Sonic Model Ripping Thread - by Doronetty - 12-11-2011, 06:33 AM
RE: Sonic Model Ripping Thread - by Vipershark - 12-11-2011, 01:50 PM

Forum Jump: