HLVM04 / Tesla-Beat-Saber-Light-Show-Converter

Convert Beat Saber maps to Tesla light shows!
GNU General Public License v3.0
22 stars 0 forks source link

Error while translating (appendToNodes) #1

Closed RaminGe closed 2 years ago

RaminGe commented 2 years ago

Hey man,

first of all: Incredible script! Really good idea to do it like that! I found a bug while trying it out.

Run your script with this url: https://eu.cdn.beatsaver.com/8061055d363292dda7b055eefc1c5dbebb13e616.zip You can find the beat saber show here: https://beatsaver.com/maps/4e8d

If you run the script the following error comes up:

python3 Main.py https://eu.cdn.beatsaver.com/8061055d363292dda7b055eefc1c5dbebb13e616.zip
Downloading...
Extracting...
Converting egg to wav...
Translating...
Traceback (most recent call last):
  File "/Users/***/teslabeatsaber/Main.py", line 18, in <module>
    translateBeatmap(difficultyMapPath)
  File "/Users/***/teslabeatsaber/Translator.py", line 65, in translateBeatmap
    appendToNodes(etree.fromstring('<Effect ref="0" name="On" selected="1" startTime="' + str(startTime) + '" endTime="' + str(startTime + LightBlinkDuration) + '" palette="1"/>'), LightBindingsLeft[positionString])
KeyError: '18895000'
HLVM04 commented 2 years ago

Thanks for the report :) This happens because the beat map requires the mod Mapping Extensions to be played. The mod makes some changes to the way note positions are saved, which makes the translator very confused 🤔 I've made the script ignore malformed position strings and display a warning when converting beat maps that requires any mods. The conversion should now still finish, but there most likely won't be any light events on the front lights, because all the notes in this modded beat map are malformed.

Adding support for such mods should be doable, but it's not something I'll be doing in the near future. However, anyone is welcome to fork the project and contribute :D

RaminGe commented 2 years ago

Ah ok I understand. I just wanted to try the script out and that was the first show popping up for my filters so I was wondering if that might be a more general problem. However I tried it with some others and all of them worked perfectly fine.

Thanks for the quick fix!