Skip to content

Commit

Permalink
converter can now auto add basic camera focus to charts
Browse files Browse the repository at this point in the history
converter script new reads the song events and sets a basic must hit section for the chart so it's not totally reliant on events to move the camera
  • Loading branch information
ThatRozebudDude committed Oct 16, 2024
1 parent 6d144b7 commit 79d9a8d
Show file tree
Hide file tree
Showing 7 changed files with 2,462 additions and 1,739 deletions.
39 changes: 36 additions & 3 deletions art/scripts/baseGameToFpsPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,40 @@ def processNotes(data, bpm, diff):

sections = [[]]
curSection = 0

sectionsMustHit = [False]

for note in data["notes"][diff]:
while(note["t"] >= curSectionTime + (sectionTime * 0.99)):
curSectionTime += sectionTime
curSection += 1
sections.append([])

skipAppend = False
for event in data["events"]:
eventTime = event["t"] + 20

if (eventTime < curSectionTime) or (eventTime > curSectionTime + sectionTime):
continue
else:
if event["e"] == "FocusCamera":
focusedCharacter = -1
if type(event["v"]) is int:
focusedCharacter = event["v"]
else:
focusedCharacter = event["v"]["char"]

match focusedCharacter:
case 0 | "0":
sectionsMustHit.append(True)
skipAppend = True
case 1 | "1":
sectionsMustHit.append(False)
skipAppend = True

if not skipAppend:
sectionsMustHit.append(sectionsMustHit[len(sectionsMustHit)-1])

l = 0
k = ""
if "l" in note:
Expand All @@ -31,20 +59,25 @@ def processNotes(data, bpm, diff):
print("Hold Duration " + str(round(note["l"])) + "\t>\t" + str(l))
if "k" in note:
k = note["k"]

sections[curSection].append([note["t"], note["d"], l, k])

output = "\"notes\": ["

for section in sections:
for i in range(len(sections)):
#for section in sections:

output += "\n{\n\"lengthInSteps\": 16,\n\"sectionNotes\": [\n"

for note in section:
for note in sections[i]:

if not sectionsMustHit[i]:
note[1] = (note[1] + 4) % 8

output += "[" + str(note[0]) + "," + str(note[1]) + "," + str(note[2]) + ",\"" + str(note[3]) + "\"],"

output = output[:-1]
output += "\n],\n\"bpm\": 0,\n\"changeBPM\": null,\n\"mustHitSection\": true\n},"
output += "\n],\n\"bpm\": 0,\n\"changeBPM\": null,\n\"mustHitSection\": " + str(sectionsMustHit[i]).lower() + "\n},"

output = output[:-1]

Expand Down
25 changes: 17 additions & 8 deletions art/scripts/baseGameToFpsPlusEvents.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ def processEvents(data, bpm):

match event["e"]:
case "FocusCamera":
match event["v"]["char"]:

focusedCharacter = -1
if type(event["v"]) is int:
focusedCharacter = event["v"]
else:
focusedCharacter = event["v"]["char"]

match focusedCharacter:
case 0 | "0":
tag += "camFocusBf;"
case 1 | "1":
Expand All @@ -36,17 +43,19 @@ def processEvents(data, bpm):

x = 0
y = 0
if "x" in event["v"]:
x = event["v"]["x"]
if "y" in event["v"]:
y = event["v"]["y"]
if type(event["v"]) is not int:
if "x" in event["v"]:
x = event["v"]["x"]
if "y" in event["v"]:
y = event["v"]["y"]

tag += str(column) + ", "
tag += str(x) + ";" + str(y)

if "ease" in event["v"]:
if not event["v"]["ease"] == "CLASSIC":
tag += ";" + str(event["v"]["duration"]) + "s;" + str(event["v"]["ease"])
if type(event["v"]) is not int:
if "ease" in event["v"]:
if not event["v"]["ease"] == "CLASSIC":
tag += ";" + str(event["v"]["duration"]) + "s;" + str(event["v"]["ease"])

print(event["e"] + "\t->\t" + tag)

Expand Down
Loading

0 comments on commit 79d9a8d

Please sign in to comment.