Jump to content


Photo

Windows batch file help?


  • Please log in to reply
2 replies to this topic

#1 Meira

Meira

    I'm the snow on your lips

  • Member
  • 411 posts

Posted 29 November 2006 - 09:26 AM

I have a problem with the batch file failing to work properly for some users. For most users (including myself) the following batch does exactly what it's supposed to do and all sound and graphic files are unpacked.

@echo off
md Music\mxm#am
copy Amber\Music\*.ogg Music\mxm#am
copy Amber\Music\snd2acm.exe Music\mxm#am
copy Amber\sounds\oggdec.exe Music\mxm#am
cd Music\mxm#am
oggdec mxm#*.ogg
del mxm#*.ogg
del oggdec.exe
snd2acm.exe -wav mxm#amA.wav mxm#amA.acm
snd2acm.exe -wav mxm#amB1.wav mxm#amB1.acm
snd2acm.exe -wav mxm#amB2.wav mxm#amB2.acm
snd2acm.exe -wav mxm#amC.wav mxm#amC.acm
snd2acm.exe -wav mxm#amD.wav mxm#amD.acm
snd2acm.exe -wav mxm#amE1.wav mxm#amE1.acm
snd2acm.exe -wav mxm#amZ.wav mxm#amZ.acm
snd2acm.exe -wav mxm#amZC.wav mxm#amZC.acm
snd2acm.exe -wav mxm#amZD.wav mxm#amZD.acm
snd2acm.exe -wav mxm#amZE.wav mxm#amZE.acm
del mxm#*.wav
del snd2acm.exe
cd..
cd..
cd override
oggdec m#*.ogg
del m#*.ogg
del oggdec.exe
tisunpack m#ar*.tiz
del m#ar*.tiz
del tisunpack.exe
pause

Yet for some users the unpacking fails over and over again (re-installing does not help). What makes this more annoying is that since the unpacking is not carried by WeiDU the installation will not stop to the errors and the player will not notice anything before entering the new areas and the game crashes. (Okay, missing soundfiles can be a good hint that everything isn't okay.)

Documenting the error is also a challenge because the unpacking batch does not print a log of itself. Luckily, I managed to get a user to document these errors from the command prompt window:

oggdec is not recognized as and external or internal command
could not find g:\bgII-soa\override\m#*.ogg
could not find g:\bgII-soa\override\oggdec.exe
tisunpack is not recognized as and external or internal command
could not find g:\bgII-soa\override\m#ar*.tiz
could not find g:\bgII-soa\override\tisunpack.exe

According to the debug file the tisunpack and ogg dec are copied to the override along with the tiz and ogg files:
[...]
Copied [amber/areas/m#ar06.tiz] to [override/m#ar06.tiz]
[amber/areas/m#ar06.wed] loaded, 14678 bytes
Copied [amber/areas/m#ar06.wed] to [override/m#ar06.wed]
[amber/areas/tisunpack.exe] loaded, 94208 bytes
Copied [amber/areas/tisunpack.exe] to [override/tisunpack.exe]
Copying 1 file ...
[...]
Copied [amber/sounds/m#ymm014.ogg] to [override/m#ymm014.ogg]
[amber/sounds/m#ymm015.ogg] loaded, 106606 bytes
Copied [amber/sounds/m#ymm015.ogg] to [override/m#ymm015.ogg]
[amber/sounds/m#ymm016.ogg] loaded, 89629 bytes
Copied [amber/sounds/m#ymm016.ogg] to [override/m#ymm016.ogg]
[amber/sounds/m#ymm017.ogg] loaded, 95529 bytes
Copied [amber/sounds/m#ymm017.ogg] to [override/m#ymm017.ogg]
[amber/sounds/oggdec.exe] loaded, 155648 bytes
Copied [amber/sounds/oggdec.exe] to [override/oggdec.exe]
[...]

Any ideas what's going on and/or what I'm doing wrong in my batch file?

(There was a similar issue in the Mac version caused by using sub-optimal command to prompt the decoding program. Due that the unpacking failed unless the Mac user had the unpacking programs in the system directories.)
Ihmeellinen meri

Kummalliset kalat liukuvat syvyydessä,
tuntemattomat kukat loistavat rannalla;
olen nähnyt punaista ja keltaista ja kaikki toiset värit -
mutta ihana meri on vaarallista nähdä,
se herättää tulevien seikkailujen janon:
mitä on tapahtunut sadussa, on tapahtuva minullekin.

- Edith Södergran


Amber - The BG2 NPC Mod Project Now released!
Amber's discussion forum at Gibberlings 3

#2 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 29 November 2006 - 02:57 PM

I'm no master at this, but you delete your OGGDEC.exe right after you change directories, shouldn't that be the last thing you delete?

I use all my files from override so I'm not familiar with creating a new file to decode your sounds to.

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.

#3 Meira

Meira

    I'm the snow on your lips

  • Member
  • 411 posts

Posted 30 November 2006 - 08:08 AM

Yes, I delete the oggdec from the music directory, but not from the override. I use .acm files for music, they don't go to the override. I know that it looks a bit weird when oggdec is copied to the override folder in the tp2 file (which shows up in weidu's debug file) and for the music folder in the batch file. That's because in need to create a new folder for my acm files to the music folder and I can't do that with weidu.
Ihmeellinen meri

Kummalliset kalat liukuvat syvyydessä,
tuntemattomat kukat loistavat rannalla;
olen nähnyt punaista ja keltaista ja kaikki toiset värit -
mutta ihana meri on vaarallista nähdä,
se herättää tulevien seikkailujen janon:
mitä on tapahtunut sadussa, on tapahtuva minullekin.

- Edith Södergran


Amber - The BG2 NPC Mod Project Now released!
Amber's discussion forum at Gibberlings 3