Answer the question
In order to leave comments, you need to log in
How to make paser written for English work?
I tried to parry the game with Nscripter on Rren'py, I found a ready-made code on github
, it works, so
it replaces all Nscrirpt commands with renpy ones , only it was written with the expectation of English and when you try to feed it a code with Russian text, it starts to swear at everything
D:\ren'py games\nscripter2renpy-master\src>python parsar.py 0.txt > script2.rpy
Traceback (most recent call last):
File "parsar.py", line 905, in <module>
parser.tokenize(input.read())
File "parsar.py", line 59, in tokenize
self.tokens = [token for token in lex.scan(content) if token is not None and token.type != "COMMENT"]
File "parsar.py", line 59, in <listcomp>
self.tokens = [token for token in lex.scan(content) if token is not None and token.type != "COMMENT"]
File "D:\ren'py games\nscripter2renpy-master\src\lexer.py", line 49, in __next__
return self.scan_next()
File "D:\ren'py games\nscripter2renpy-master\src\lexer.py", line 74, in scan_next
raise UnknownTokenError(self.input[self._position], self.lineno)
lexer.UnknownTokenError: Line #9866, Found token:
input = open(sys.argv[1], 'r', encoding = 'utf-8')
input = open(sys.argv[1], 'r', encoding='windows-1251')
D:\ren'py games\nscripter2renpy-master\src>python parsar.py 0.txt > script2.rpy
Traceback (most recent call last):
File "parsar.py", line 905, in <module>
parser.tokenize(input.read())
File "C:\Users\gama\AppData\Local\Programs\Python\Python38\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 248964: character maps to <undefined>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question