pmrowla / pylivemaker

Python package for manipulating LiveMaker game resources
https://pylivemaker.readthedocs.io/en/latest/
GNU General Public License v3.0
63 stars 16 forks source link

lmsb insert isn't working with unmodified files #116

Closed num421337 closed 11 months ago

num421337 commented 11 months ago

Description

I'd like to change one script for another so when it essentially loads another scenario when the button on the main menu is pushed

What I Did

I used lmlsb extract 00000001.lsb

I tried to edit the files and kept getting errors, then I just tried to insert the unmodified files to see if that would at least work

lmlsb batchinsert 00000001.lsb extracted

Backing up original LSB.
Scenario 0000132D at line 997 will be replaced.
Scenario 0000085D at line 17 will be replaced.
Scenario 00001F34 at line 1109 will be replaced.
Traceback (most recent call last):
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\Scripts\lmlsb.exe\__main__.py", line 7, in <module>
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\cli\lmlsb.py", line 395, in batchinsert
    new_body = cc.compile(script)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1296, in compile
    self.feed(line)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1305, in feed
    self.goahead(0)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1338, in goahead
    k = self.parse_starttag(i)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1422, in parse_starttag
    self.handle_startendtag(tag, attrs)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1508, in handle_startendtag
    self.handle_starttag(tag, attrs)
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\site-packages\livemaker\lsb\novel.py", line 1512, in handle_starttag
    tag = LNSTag[tag.lower()]
  File "C:\Users\num42\AppData\Local\Programs\Python\Python310\lib\enum.py", line 440, in __getitem__
    return cls._member_map_[name]
KeyError: 'unk'
pmrowla commented 11 months ago

It sounds like there's something unsupported in one of the text scripts. I should be able to take a look into it this weekend if you attach the original 00000001.lsb for your game to a comment in this issue.

num421337 commented 11 months ago

I found out problem, and it seems almost dumb now, but. I translated the game to english using translator ++. and then tried to swap the files. It works untranslated. So now I can try and translate from there I think