Coming from Kade Engine¶
Kade Engine modcharts are a modchart.lua per song with hooks (start, update, beatHit, ...), receptors and
characters addressed by number, and global variables like camHudAngle. Good news: MineFunkin's
modcharts work the same way - a song script with callbacks - so most of a Kade modchart translates
line by line.
This page maps the names (Kade Engine 1.4-1.8's modchart API), and at the end translates all of Kade's own example modcharts, so you can see a few whole ones side by side.
The big differences¶
Five things to keep in mind - they'll save you some head-scratching:
- No compiling. A Kade modchart needs a game built from source. Here the script is just a
.modchartfile in the song's folder (the camera and the rest go in a.eventfile - why), and the chart editor's Reload picks up your changes while you work. No waiting for a build. - Your four lanes, not eight receptors. Kade numbers the receptors 0-7 (0-3 the opponent's, 4-7 yours).
MineFunkin's
strum[0]...strum[3]are your lanes - Kade's 4-7. In a fight only yours are on screen; in practice the opponent's receptors beside them fade withstrums.opponentAlpha. - Offsets, not positions.
setActorX(x, 4)puts receptor 4 at screen positionx.strum[0].x = 30moves lane 0 30 pixels away from its home. So Kade'sdefaultStrum4X + 30is just30here, and 0 is home. - Milliseconds.
onFrame(dt)gets milliseconds (Kade'selapsedis seconds),timeis the song time in ms. Durations are writtenbeats(2),seconds(1). - The characters are Minecraft players.
boyfriendisplayer,dadisopponent- the real fighters in the world, in a fight. There's no girlfriend; a picture on the stage can play her part.
Hooks¶
| Kade | MineFunkin |
|---|---|
start(song) |
onStart() |
update(elapsed) |
onFrame(dt) - dt in ms |
beatHit(beat) |
onBeat(b) |
stepHit(step) |
onStep(n) |
keyPressed(key) |
onKeyPress(lane) - the lane 0-3, not "left" / "down" / ... |
playerOneSing(note, position) |
onHit(note) |
playerTwoSing(note, position) |
onOpponentHit(note) |
playerOneMiss(note, position) |
onMiss(note) |
playerOneTurn() / playerTwoTurn() |
read song.singer ("player" / "opponent") in onBeat |
Receptors¶
| Kade | MineFunkin |
|---|---|
setActorX(x, i) / getActorX(i) |
strum[lane].x (an offset from home) |
setActorY(y, i) / getActorY(i) |
strum[lane].y |
setActorAngle(a, i) / getActorAngle(i) |
strum[lane].angle |
setActorAlpha(a, i) |
strum[lane].alpha (or hideLane / showLane) |
setActorScale(s, i) |
strum[lane].scale |
defaultStrum4X ... defaultStrum7Y |
0 - the home of every offset; strums.spacing is the distance between two lanes |
receptor.defaultX / defaultY (1.8's objects) |
strum[lane].homeX / homeY - where the receptor rests on the screen, in pixels |
tweenPos(i, x, y, time) |
tween(strum[lane].x, x, seconds(time)) + the same for .y |
tweenAngle(i, angle, time) |
tween(strum[lane].angle, angle, seconds(time)) |
tweenFadeIn(i, alpha, time) / tweenFadeOut |
tween(strum[lane].alpha, alpha, seconds(time)) |
tweenPosXAngle / tweenPosYAngle |
two tweens: .x (or .y) and .angle |
setActorVelocityX, setActorAccelerationX, setActorDragX |
no physics - work the position out in onFrame from time, or tween it |
setStrumlineY(y) / strumLineY |
strums.y |
strumLine1Visible = false |
strums.opponentAlpha = 0 (practice) |
strumLine2Visible = false |
strums.alpha = 0 (or hideStrums) |
Notes¶
| Kade | MineFunkin |
|---|---|
getRenderedNotes() |
notes.count - see notes one by one |
getRenderedNoteX(i), getRenderedNoteY(i) |
note[i].distance (ms until the hit) - positions are worked out from that |
getRenderedNoteType(i) |
note[i].lane |
getRenderedNoteStrumtime(i) |
note[i].time |
isSustain(i), note.isSustain |
note[i].hold > 0 |
note.beat (1.8's objects) |
note[i].beat |
setRenderedNotePos(x, y, i) |
note[i].x, note[i].y - offsets, set every frame |
setRenderedNoteAlpha(a, i) |
note[i].alpha |
setRenderedNoteScale(s, i) |
note[i].scale |
setRenderedNoteAngle(a, i) |
note[i].angle |
createWiggle(freq, amplitude, speed) + setNoteWiggle / setSustainWiggle |
the ripple modifier: set(0, 30, "ripple"), ripple.freq, ripple.speed - only the lanes wave, like Kade's |
Camera, HUD and window¶
| Kade | MineFunkin |
|---|---|
camNotes / camSustains (1.8: .angle, .x, .y, tweenZoom, .alpha) |
the lanes' own modifiers: turnZ, x, y, zoom, fade - e.g. ease(beat, 2, "cubicOut", 120, "zoom") |
camHudAngle / setHudAngle(a) |
hud.angle |
setHudPosition(x, y) / getHudX() |
hud.x, hud.y |
hudZoom / setHudZoom(z) |
camera.zoom (zooms the playfield, and in a fight the world with it) |
cameraZoom / setCamZoom(z) |
the fight camera's lens: camera.fov - see the fight camera |
cameraAngle |
camera.roll |
setCamPosition(x, y), followXOffset, followYOffset |
camera.x, camera.y |
showOnlyStrums = true |
hideHud() + hideJudgments() |
setWindowPos(x, y) / getWindowX() |
window.x, window.y - offsets from where it was (game window) |
resizeWindow(w, h) / getWindowWidth() |
window.width, window.height (factors) |
getScreenWidth() / getScreenHeight() |
monitor.width, monitor.height |
Characters and sprites¶
| Kade | MineFunkin |
|---|---|
playActorAnimation("boyfriend", "singUP", true, false) |
pose("player", "up") (pose) |
changeBoyfriendCharacter(id) / changeDadCharacter(id) |
setSkin("player", "skins/bf.png") (setSkin) |
setActorX(x, "dad") |
opponent.x (blocks, in the fight's frame - see the fighters) |
makeSprite(image, id, drawBehind) |
image[n].file = "image.png", image[n].layer = "stage" (behind) or "back" (in front) |
Global variables¶
| Kade | MineFunkin |
|---|---|
curBeat, curStep, songPos |
beat, step, time |
bpm, crochet |
bpm, beats(1) (one beat in ms) |
downscroll |
player.downscroll |
scrollspeed |
scroll.speed (change it with scrollTo) |
mustHit |
song.singer == "player" |
screenWidth, screenHeight / hudWidth, hudHeight |
screen.width, screen.height |
difficulty, fpsCap, flashing, distractions |
not available |
Kade's examples, translated¶
Kade's wiki ships eight example modcharts. Here's each one next to its MineFunkin version - you'll notice most of them get a bit shorter.
The full example (receptors in a circle)¶
Spinning receptors¶
Kade adds 15 degrees per frame, so it spins faster on a faster computer (someone with 240 fps gets a very different
song!). Working the angle out from time spins at the same speed for everyone.
The spinning HUD¶
Spin at a specific part of the song¶
Showing and hiding the receptors and the HUD¶
Looping through the notes on screen¶
Centering your side¶
Kade moves the player's receptors to the middle of the screen. In a MineFunkin fight, your lanes already are in the
middle - nothing to do. In practice, fade the opponent's receptors out (strums.opponentAlpha = 0) and slide yours
over with moveStrums if you like.
Jumping arrows¶
Want more? Lots of modchart moves - with pictures - are in the Modcharts guide.