31
SCI Development Tools / Re: Convert SCI0 vocab to SCI1 vocab?
« on: July 21, 2022, 05:07:01 AM »Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.Code: [Select]Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define: SORTCOPY
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch: {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch: {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch: {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch: {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch: {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch: {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch: {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch: {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
vocab_export(args.gamedir, args.csvdir)
File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
dict_writer.writerows(vocab)
File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set
The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.
When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.
OK, we have 2 distinct problems here:
1. The original vocab has 2 strange bytes, after 'anynumber' entry, on the beginning of '!*' entry. The csv writer couldn't handle those. I fixed it locally. Anyway, I don't understand why are they there - any input will be great.
2. That's not the reason it failed to work for you - but rather that I had only ScummVM in mind when writing those tools. The vocab file has pointers in the beginning, that are unused by ScummVM, so I didn't bother to handle them.
I suppose I can add support for those pointers - however, it'd be much easier if someone can refer me to an explanation how they are working. I'm aware of http://sci.sierrahelp.com/Documentation/SCISpecifications/27-TheParser.html#AEN5794, but it describes only the old format (which uses 26 pointers, one for each letter) and not the new format (which uses 255 pointers).
EDIT
====
If I understand correctly SCICompanion's code, the 255 pointers are for ascii codes. Therefore, I can continue with this.