XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Mar 30, 2016 11:17 am

All times are UTC + 1 hour





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Idolm@ster (Xbox 360) HELP
PostPosted: Thu Aug 06, 2015 5:52 am 
Offline
ultra-n00b

Joined: Sun Jun 14, 2015 6:21 pm
Posts: 9
Has thanked: 0 time
Have thanks: 1 time
I'd like to work on translating the Xbox version of Idolm@ster using the preexisting translations from the PSP port of the game. I was already able to do so with a hex editor for one of the files, but considering the total amount of files I would have to edit manually, accomplishing a full translation would require an unrealistically monumental amount of work since I don't have the knowledge to write an actual script editor. So could someone help me by making one?

Example files.
The files provided are actually packs that contain both the script and the voice files associated with it (the .scb is the script, the .ahx are the voices files). The file which I translated is included for reference. A quick bms script to unpack them was already written 5 years ago, although there isn't any repacker. This may not be necessary though as it's just a matter of rewriting the sizes/offsets at the top of the .bna file after editing the .scb script (the .scb is always the first file in the pack for these regular game scripts). Editing the .scb file itself is pretty straightforward (it's basically just editing the UTF-16BE encoded null-separated strings, fixing the pointer/sizes located just above for the edited strings, and then fixing the pointers/sizes in the .scb header). I could go into more detail if it's needed.

Thank you!


Top
 Profile  
 
 Post subject: Re: Idolm@ster (Xbox 360) HELP
PostPosted: Fri Aug 07, 2015 10:51 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 506
Has thanked: 50 times
Have thanks: 93 times
really happy to see xenia used for testing your changes 8)

i'll take a look

_________________
Useful tool links:


Top
 Profile  
 
 Post subject: Re: Idolm@ster (Xbox 360) HELP
PostPosted: Sat Aug 08, 2015 4:38 am 
Offline
ultra-n00b

Joined: Sun Jun 14, 2015 6:21 pm
Posts: 9
Has thanked: 0 time
Have thanks: 1 time
Thanks, I really appreciate it.


Top
 Profile  
 
 Post subject: Re: Idolm@ster (Xbox 360) HELP
PostPosted: Sun Aug 09, 2015 11:41 pm 
Offline
ultra-n00b

Joined: Sun Aug 09, 2015 11:37 pm
Posts: 1
Has thanked: 1 time
Have thanks: 0 time
Do you have an email I could contact you at? I'd like to help you with the translation.


Top
 Profile  
 
 Post subject: Re: Idolm@ster (Xbox 360) HELP
PostPosted: Tue Aug 25, 2015 8:37 pm 
Offline
ultra-n00b

Joined: Sun Jun 14, 2015 6:21 pm
Posts: 9
Has thanked: 0 time
Have thanks: 1 time
For the sake of transparency, here's a reconverter I wrote for the dds script found here. I still need help with a script editor though.
Code:
set MEMORY_FILE binary "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x65\x58\x74\x00\x00\x00\x00\x20\x00\x00\x00\x10\x00\x00\x00\x00\x47\x49\x44\x58\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00"
endian big
get size asize
math size - 0x30
putVarChr MEMORY_FILE 0x0 size long
math size - 0x50
putVarChr MEMORY_FILE 0x8 size long
goto 0x11
get width1 byte
putVarChr MEMORY_FILE 0x14 width1 byte
goto 0x10
get width2 byte
putVarChr MEMORY_FILE 0x15 width2 byte
goto 0xD
get height1 byte
putVarChr MEMORY_FILE 0x16 height1 byte
goto 0xC
get height2 byte
putVarChr MEMORY_FILE 0x17 height2 byte
goto 0x57
get type byte
if type == 0x31
putVarChr MEMORY_FILE 0x13 0x0
endif
get name filename
append
log MEMORY_FILE 0x80 SIZE
append
set count size
math count / 2
goto 0x50 MEMORY_FILE
for i = 0 < count
savepos start MEMORY_FILE
endian little
get num int MEMORY_FILE
endian big
putVarChr MEMORY_FILE start num int
next i
endian little
math size + 0x50
log name 0 size MEMORY_FILE


Top
 Profile  
 
 Post subject: Re: Idolm@ster (Xbox 360) HELP
PostPosted: Sun Aug 30, 2015 4:14 pm 
Offline
ultra-n00b

Joined: Sun Jun 14, 2015 6:21 pm
Posts: 9
Has thanked: 0 time
Have thanks: 1 time
Python scripts. I guess a tl tool is just a luxury now.
Build MSG from a null-delimited, UTF-8 text file:
Code:
import sys
import string
import struct
import os
import codecs
import re

fileT = open(sys.argv[1], "r+b")
fileTString = str(fileT.read())
name = str(os.path.splitext(os.path.basename(fileT.name))[0])
extension = '.msg'
msgName = "".join((name, extension))
print(msgName)
msgFile = open(msgName, "w+b")
msgFile.write("\x4d\x53\x47\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3A\x00\x00\x00\x00\x0A\xEC\x00\x10\x01\xE0\x00\x00\x00\x00")
utf16Text = fileTString.decode('utf-8-sig').encode('utf-16be')
sizeText = str(struct.pack('>L', len(utf16Text)))
msgFile.seek(36, 0)
msgFile.write(sizeText)
msgFile.seek(0, 2)
print(msgFile.tell())
textPointer = int(0)
lineAmount = int(0)
print(textPointer)
textSize = int(len(utf16Text))
print(textSize)
for line in re.split('\0', utf16Text.decode('utf-16be')):
   line = line.encode('utf-16be')
   withNulls = int(len(line)) + 2
   msgFile.write(str(struct.pack('>L', withNulls)))
   msgFile.write(str(struct.pack('>L', textPointer)))
   textPointer += withNulls
   lineAmount += 1
   textSize -= withNulls
   if textSize <= int(0):
      break
msgFile.seek(32, 0)
msgFile.write(str(struct.pack('>H', lineAmount)))
lineAmount *= int(8)
checkFiller = int(lineAmount)
checkFiller %= int(16)
msgFile.seek(0, 2)
if checkFiller != int(0):
   msgFile.write("\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD")
   lineAmount += int(8)
lineAmount += int(16)
totalSize = int(lineAmount)
totalSize += int(len(utf16Text))
msgFile.seek(42, 0)
msgFile.write(str(struct.pack('>H', lineAmount)))
msgFile.seek(16, 0)
msgFile.write(str(struct.pack('>L', totalSize)))
totalSize += int(32)
msgFile.seek(0, 2)
msgFile.write(utf16Text)


Insert MSG into .SCB:
Code:
import sys
import string
import struct
import os

fileD = open(sys.argv[1], "r+b")
fileP = open(sys.argv[2], "r+b")
filePString = str(fileP.read())
fileDString = str(fileD.read())
fileP.seek(0, 2)
endP = str(struct.pack('>L', int(fileP.tell())))
fileP.write(fileDString)
fileP.seek(148,0)
totalSize = int(len(fileDString))
fileP.write(str(struct.pack('>L', totalSize)))
fileP.write(endP)


Add file to .BNA:
Code:
import sys
import string
import struct
import os

fileT = open(sys.argv[1], "r+b")
fileP = open(sys.argv[2], "r+b")
filePString = str(fileP.read())
fileTString = str(fileT.read())
name = str(os.path.basename(fileT.name))
size = str(struct.pack('>L', len(fileTString)))
packedOffset = str(struct.pack('>L', int(filePString.find(name))))
offsetOffset = filePString.find(packedOffset)
fileP.seek(0, 2)
endP = str(struct.pack('>L', int(fileP.tell())))
fileP.write(fileTString)
fileP.seek(offsetOffset)
fileP.seek(4, 1)
fileP.write(endP)
fileP.write(size)
fileT.close()
fileP.close()


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


You can make the ads go away by registering


All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group