Skip to content

Instantly share code, notes, and snippets.

@anice-guy
Last active September 30, 2025 21:46
Show Gist options
  • Select an option

  • Save anice-guy/6a7baf29de2571818cbb62c828e0a688 to your computer and use it in GitHub Desktop.

Select an option

Save anice-guy/6a7baf29de2571818cbb62c828e0a688 to your computer and use it in GitHub Desktop.
A Python script to convert Codename Engine charts to Friday Night Maker! charts

CNE-TO-FNM

a Python script to convert Codename Engine charts to Friday Night Maker! charts

no one asked for this but i was bored okay?

INSTRUCTIONS

TODO: make all of this automated

  • drop this script and your chart in a folder, the chart file needs to be named just chart.json
  • run the script, it should output a bunch of numbers separated by semicolons
  • copy the CHART: section of the output
  • open your level data.lvl file in some text editor and replace the first line with the chart output you copied
    • IT NEEDS TO BE A SINGLE LINE btw
    • levels are located in %localappdata%\FridayNightKing\Weeks\WeekDefault
  • go back to your script output and now copy the CAMERA EVENTS: section at the bottom
  • paste it in the penultimate line
  • save the file and this fuckass engine should load your Codename chart!
    • player and opponent cameras working too!
ezgif.com-gif-maker.mp4

IF MY INSTRUCTIONS SUCK, CHECK THIS VIDEO OKTHX

CREDITS

  • angg (me :3): writing this tool
  • KinGamesCreator: FNM creator and explaining to me how tf the chart format works lmao

(king seriously what were you thinking 😭)

# CNE-TO-FNM
# a tool to convert Codename Engine charts to Friday Night Maker! charts
#
# CREDITS
# angg (me :3): writing this tool
# KinGamesCreator: FNM creator and explaining to me how tf the chart structure works lmao
# (king seriously what were you thinking :sob:)
import json
with open('chart.json') as jsonRaw:
chartJson = json.load(jsonRaw)
chart = ''
cameras = ''
if chartJson['codenameChart'] != True:
raise Exception('ERROR!!!!!!!!!!!!!!! this aint a codename engine chart dummy')
def trunc(num, dec):
factor = 10 ** dec
return int(num * factor) / factor
def genNote(time, len, id, mustHit = False):
xPos = [180, 360, 540, 720, 1200, 1380, 1560, 1740]
thing = 0
if mustHit:
thing = 4
note = ';'.join(str(i) for i in [trunc(time / 1000 * 60, 2), xPos[id + thing], trunc(len / 1000 * 60, 2), id])
return note + ';'
def genCamEvt(time, cam):
evt = ';'.join(str(i) for i in [trunc(time / 1000 * 60, 2), cam])
return evt + ';'
# BY THE WAY (btw) if your chart has more than two strumlines, you can tweak shit here
for note in chartJson['strumLines'][0]['notes']:
chart = chart + genNote(note['time'], note['sLen'], note['id'])
for note in chartJson['strumLines'][1]['notes']:
chart = chart + genNote(note['time'], note['sLen'], note['id'], True)
for evt in chartJson['events']:
if evt['name'] == 'Camera Movement':
if evt['params'][0] == 1: # bf
cam = 2
elif evt['params'][0] == 2: # gf
cam = 1
else: # default to dad
cam = 0
cameras = cameras + genCamEvt(evt['time'], cam)
print('CHART: ' + chart)
print('CAMERA EVENTS: ' + cameras)
# copyright angg 2025 dont steal yeah i made this yeah baby
@anice-guy
Copy link
Copy Markdown
Author

psych engine version when 👶 👶 👶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment