Closed arp242 closed 3 years ago
To fix it for all files you can do something like for f in *.bif; do ln -s $f $(echo "$f" | tr '[:upper:]' '[:lower:]'); done
btw.
I've always thought that this kind of limitations are there "by design", or just too difficult to fix, hence the reason why the weidu package for Linux contains tolower
and the like. I've always had to bend the file system to be case insensitive (via ciopfs
or something like that).
I don't know. I actually found out that WeiDu can't do what I wanted it to do and wrote some of my own tooling, and just using the filenames as they appear in the chitin.key seems to work fine. But this is just with BG1 & 2 EE on Linux, so I don't know about other games/variants/systems. I think Windows and macOS should be fairly easy as it's case-insensitive; I'd guess it's a legacy from "upper-case for stylistic reasons that worked just fine on Windows" (or, in the past all filenames were just upper-case).
Case handling is a mess and I have no good solution for EE-type games. Cf. the remark about case-insensitive file systems.
Just use weidu's .tp2 commands:
Either just:
COPY_EXISTING ~AMUL09.ITM~ ~override~
Or if you have more ambision, just use the variable version:
COPY_EXISTING ~*.itm$~ ~override~
etc, it will extract every item from the .bif's. You won't be able to extract the files from a .bif and make it unneeded. That's not how the game was programmed.
Apologies, as sharing the link to this issue on Discord has brought Jarno into the conversation, which is never good. You rarely should trust what he says, as he tends to give advice that resembles what an LLM does (seems legit due to the use of jargon, but makes no sense).
Here is some example of why the above advice is not useful:
$ cat clueless/setup-clueless.tp2
BACKUP "weidu_external/backup/clueless"
AUTHOR "JarnoGPT"
AUTO_EVAL_STRINGS
BEGIN "Test case" DESIGNATED 100
COPY_EXISTING ~AMUL09.ITM~ ~override~
$ weinstall clueless
weidu --log "setup-clueless.debug" "clueless/setup-clueless.tp2"
[weidu] WeiDU version 24900
ERROR: Unable to find DIALOG.TLK in:
./^dialog/.tlk$
Please run this program in your Infinity Engine game directory.
FATAL ERROR: Failure("Unable to find DIALOG.TLK")
Running that on a case insensitive file system works:
$ weinstall clueless/
weidu --log "setup-clueless.debug" "clueless/setup-clueless.tp2"
[weidu] WeiDU version 24900
Please choose the language in which you wish to play the game.
If you later wish to play the game in a different language you will need to edit the file weidu.conf and reinstall your mods.
0 [Czech]
1 [German]
2 [English]
3 [Spanish]
4 [French]
5 [hu_hu]
6 [Italian]
7 [Japanese]
8 [Korean]
9 [Polish]
10 [Portuguese]
11 [Russian]
12 [Turkish]
13 [Ukrainian]
14 [Simplified Chinese]
2
Using ./lang/en_us/dialog.tlk
Install Component [Test case]?
[I]nstall, or [N]ot Install or [Q]uit? i
Installing [Test case]
Copying 1 file ...
SUCCESSFULLY INSTALLED Test case
Press ENTER to exit.
$ ls override/
amul09.itm
Let's say I want to extract an item; it lists the file:
But extracting it fails:
The file exists as
./data/Items.bif
(with capitalI
); I can't rename the file as it will cause the game will segfault, although I can symlink it:The output of
--list-biffs
is always in full caps (and linking toITEMS.BIFF
doesn't work), so not sure for which other files this is an issue. Loading the filechitin.key
with just a text editor it does listdata/Items.bif
, so somehow weidu isn't preserving this capitalisation doing an uppercase in the output, but a lowercase when loading, or something to this effect.