Page 1 of 1

NIER - .D2P/.2DV

Posted: Tue Dec 14, 2010 8:27 pm
by Gromber
i want to edit this type of files, example:
GAME_EVENT.2DP
GAME_EVENT.2DV

Download

I want to translate them.

Thanks.

Re: NIER - .D2P/.2DV

Posted: Tue Dec 28, 2010 7:03 pm
by mariokart64n
why would you want to translate them? I extracted that file, and it already contains different languages besides english

it be a bit difficult, you would need to convert these to TGA with the xbox SDK. Edit them, then reconvert them back using the SDK. then hex them back into the file...

had to modify my old max script to read the different extension, get info on using it in chrrox nier topic [requires sdk]

Code: Select all

--===========================================================================
/*
                 /     `y ´                      |
                  /        , '                       |
              /  _____/ _  -―――――==== 、__  :!
     _____ ,_.′_'" ̄      / _           ヾ>' ̄ ̄ ̄`ヾ、 |
    !r、――.、〉∠´  _    ̄`,'"          /      /7ヘに)、
     \\ イ/1「二 ̄ _   ___             /       | ./ .//./「`\
     _」>`7 {「 フ ̄,. -   ;´:i ̄:: : .: . . .   /           |∧// .| |_〉_〉
.    / 1「フ/  ∨ /    :::::i::::::::::::::::::: : :./            >ァ'  ヽヽ ̄
  / ′/イ′  ∨=__     ::::i!::::::::::::::: :: ,."           //     |\\
. / /  / /.′    ヽ⌒ .: :. .. ::::i!:::::::::::::::〃          / /       !  〉 〉
〈._」   ! :! !      \:: .: .:: :: :::ヽ::::::::::〃          / ./       |//
     |_」 !           ヽ:. :: ::.,:::::::\::イ′          `ー′       i/
.      i            \'"::::::ヽ:\{                    |
      !            `.<':;:::::::ヘ       ,...               !
.        ',                ヽ::ヾ:::ヽ , '´                l
.        '             , '´` ー→                 !
        ' ,               y′                    l
            ' ,                  /                  l
            \           ,′                   l
             ヽ          ,                   ! 
*/
--===========================================================================
-- fsource="C:\\Mascript\\GAME_EVENT.2DV"

mkXPR=true --dump swizzled textures as XPR
useXDK=true --Use xbox360 SDK to unswizzle textures from generated XPRs

clearlistener()
fsource = getOpenFileName \
caption:"NIER Model File" \
types: "Model Dump Volume(*.MDV)|*.mdv|2D Dump Volume(*.2DV)|*.2dv|All files (*.*)|*.*|"
if (fsource!=undefined) AND ((doesFileExist fsource)==true) do(
f = fopen fsource "rb"
fext=           getFilenameType fsource
fpath=          getFilenamePath fsource
fbatch=         getFiles (fpath+"*"+fext)
fname=  getFilenameFile fsource
fsize=          getFileSize fsource
fname2 = (fpath + fname + ".MDP.dec")
unbundler=(fpath+"UnBundler.exe")
if fext==".2DV" OR fext==".2dv" do fname2 = (fpath+fname+".2DP")
if (doesFileExist fname2)==false do fname2 = (fpath+fname+".MDP")
if (fname2!=undefined) AND ((doesFileExist fname2)==true) do(
g = fopen fname2 "rb"
test=readlong g #unsigned
fseek g 0x0 #seek_set
if test!=0x006F7A6C then(
st = timestamp() --get start time in milliseconds
openLog (fpath+fname+"_log.txt") mode:"w" outputOnly:true
print (fname+fext+"\n"+localTime+"\n")
--===========================================================================
undo off(
fn ReadFixedString bstream fixedLen = (
    local str = ""
    for i = 1 to fixedLen do
    (
        str += bit.intAsChar (ReadByte bstream #unsigned)
    )
    str
)
fn readBElong fstream = (
long = readlong fstream #unsigned
long = bit.swapBytes long 1 4
long = bit.swapBytes long 2 3
return long
)

with redraw off (

fseek f 0x110#seek_set
NODToff = ReadBElong f + 0x100
heapoff = ReadBElong f + 0x100
fseek f heapoff#seek_set

check=readBElong f -- 0x48454150 = HEAP
if check!=0x48454150 do (
fseek f 0 #seek_set
skip=true
do (
byte1 = readbyte f#unsigned
if (byte1==0x48) then(
byte2 = readbyte f#unsigned
if (byte2==0x45) then(
byte3 = readbyte f#unsigned
if (byte3==0x41) then(
byte4 = readbyte f#unsigned
if (byte4==0x50) then(
skip=false
fseek f -4 #seek_cur
))))) while skip==true AND (ftell f)!=fsize
Print ("HEAP FOUND @ 0x"+((bit.intAsHex(ftell f))as string))
)

check=readBElong f -- 0x48454150 = HEAP
fseek f 4 #seek_cur --pad
if check==0x48454150 do(
heapPos=(ftell f)-8 --gets current position of heap, required for local jumps
heapHeaderSize=readBElong f -- 0x20 constant?
nameTable=readBElong f -- jump from heapPos
propertyTable=readBElong f -- jump from heapPos
ukn=readBElong f --another offset?
ukn=readBElong f  -- 0?
for x = 1 to (readBElong f) do(
heapID=readfixedstring f 4
nameOffset=readBElong f
ukn=readBElong f  -- 0?
dataInfo=readBElong f  -- holds swizzle info for textures
dataType=readBElong f  -- 0x40=textures
dataOffset=readBElong f  -- global offset for MDP file, if no data = -1
dataSize=readBElong f  
ukn=readBElong f  -- 0?

if heapID=="TX2D" do(
getPos=ftell f
if mkXPR==true do(
fseek f (heapPos+nameTable+nameOffset) #seek_set
dataName=readstring f
createFile (fpath+dataName+".xpr")
s = fopen (fpath+dataName+".xpr") "ab"
write=writebyte s 0x58
write=writebyte s 0x50
write=writebyte s 0x52
write=writebyte s 0x32
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x08
write=writebyte s 0x00
write=writelong s (bit.swapBytes (bit.swapBytes dataSize 1 4) 2 3)
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x01
write=writebyte s 0x54
write=writebyte s 0x58
write=writebyte s 0x32
write=writebyte s 0x44
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x40
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x34
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x18
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writebyte s 0x00
write=writestring s dataName
for x = 1 to (40-(dataName.count+1)) do(
write=writebyte s 0x00
)
fseek f (heapPos+propertyTable+dataInfo) #seek_set
for x = 1 to (16*4) do(
read=readbyte f #unsigned
write=writebyte s read
)
for x = 1 to 1920 do(
write=writebyte s 0x00
)
fseek g dataOffset #seek_set
for x = 1 to dataSize do(
read=readbyte g #unsigned
write=writebyte s read
)


)
gc()
fclose s
if useXDK==true do(
if (unbundler!=undefined) AND ((doesFileExist unbundler)==true) do(
print ("\"\""+unbundler+"\""+" "+"\""+(fpath+dataName+".xpr")+"\"\"")
DOSCommand ("\"\""+unbundler+"\" \""+(fpath+dataName+".xpr")+"\"\"")
deleteFile (fpath+dataName+".xpr")
deleteFile (fpath+dataName+".xpr.rdf")
deleteFile (fpath+dataName+"_1.tga")
deleteFile (fpath+dataName+"_2.tga")
deleteFile (fpath+dataName+"_3.tga")
deleteFile (fpath+dataName+"_4.tga")
deleteFile (fpath+dataName+"_5.tga")
deleteFile (fpath+dataName+"_6.tga")
deleteFile (fpath+dataName+"_7.tga")
deleteFile (fpath+dataName+"_8.tga")
deleteFile (fpath+dataName+"_9.tga")
deleteFile (fpath+dataName+"_10.tga")
deleteFile (fpath+dataName+"_11.tga")
deleteFile (fpath+dataName+"_12.tga")
deleteFile (fpath+dataName+"_miptail.tga")
))
fseek f getPos #seek_set    
)

-- Print ("last loop @ 0x"+((bit.intAsHex(ftell f))as string))

)


)


























--===========================================================================
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f
fclose g
fclose s
flushLog()
closeLog()
enableSceneRedraw()
Print ("Done! ("+((((timestamp())-st)/60)as string)+" Seconds)") --print time to finish
))) else (Print "Aborted: MDP Maybe Incorrect!")))

Re: NIER - .D2P/.2DV

Posted: Thu Dec 30, 2010 6:11 pm
by Gromber
Hi, i wanted to translate to spanish, but i havent sdk... :|

Re: NIER - .D2P/.2DV

Posted: Fri Dec 31, 2010 8:15 pm
by mariokart64n
thats what I mean, I see multi language textures.. the game must already be in spanish

Re: NIER - .D2P/.2DV

Posted: Fri Dec 31, 2010 10:18 pm
by Gromber
mariokart64n wrote:thats what I mean, I see multi language textures.. the game must already be in spanish
Fr, Ita, Jap and Eng

Re: NIER - .D2P/.2DV

Posted: Mon Jan 10, 2011 8:39 am
by Tosyk
Thanks Mario, script works perfect.

Re: NIER - .D2P/.2DV

Posted: Tue Jan 11, 2011 12:43 pm
by GamerSuper
Gromber wrote:Hi, i wanted to translate to spanish, but i havent sdk... :|

I though every game is always translated in Spanish...

Is this title unreleased in Spain? Or do they sell English version?

Re: NIER - .D2P/.2DV

Posted: Tue Jan 11, 2011 3:02 pm
by Gromber
In spain was released the pal versión:Fr, Ita, Jap and Eng... but no in spanish.

We translated the game, but we wanted to translate also the menu, loading icon, level .etc

Re: NIER - .D2P/.2DV

Posted: Tue Jan 11, 2011 4:53 pm
by GamerSuper
Gromber wrote:In spain was released the pal versión:Fr, Ita, Jap and Eng... but no in spanish.

We translated the game, but we wanted to translate also the menu, loading icon, level .etc
strange... why?

is it very rare when a game in spain releases without spanish translation?

Re: NIER - .D2P/.2DV

Posted: Wed Jan 12, 2011 6:33 am
by Tosyk
Hi, Mario, i have problem with extracting *.mdp files from BG folder, almost every time unbundler.exe gives error (just crashing).