From 186c73fca210c155a8d5787dfa3a1959abe86f95 Mon Sep 17 00:00:00 2001 From: CyndaquilDAC <65635932+CyndaquilDAC@users.noreply.github.com> Date: Sat, 17 Apr 2021 16:38:19 -0500 Subject: [PATCH 1/6] minor nitpick fixed --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 6b4c446..a4c6814 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,6 +1,6 @@ # Building Friday Night Funkin': Kade Engine -**Please note**: these instructions are for compiling/building the game. If you just want to play Kade Engine, **play in your browser or download a build instead**: **[play in browser](https://funkin.puyo.xyz) ⋅ [latest stable release](https://github.com/KadeDev/Kade-Engine/releases/latest) ⋅ [latest development build (windows)](https://ci.appveyor.com/project/KadeDev/kade-engine-windows/build/artifacts) ⋅ [latest development build (linux)](https://ci.appveyor.com/project/daniel11420/kade-engine-linux/build/artifacts)**. If you want to build the game yourself, continue reading. +**Please note** that these instructions are for compiling/building the game. If you just want to play Kade Engine, **play in your browser or download a build instead**: **[play in browser](https://funkin.puyo.xyz) ⋅ [latest stable release](https://github.com/KadeDev/Kade-Engine/releases/latest) ⋅ [latest development build (windows)](https://ci.appveyor.com/project/KadeDev/kade-engine-windows/build/artifacts) ⋅ [latest development build (linux)](https://ci.appveyor.com/project/daniel11420/kade-engine-linux/build/artifacts)**. If you want to build the game yourself, continue reading. **Also note**: you should be familiar with the commandline. If not, read this [quick guide by ninjamuffin](https://ninjamuffin99.newgrounds.com/news/post/1090480). From 5d60dc67a4330c94eeda6ae108dea9d1888bb2d6 Mon Sep 17 00:00:00 2001 From: CyndaquilDAC <65635932+CyndaquilDAC@users.noreply.github.com> Date: Sat, 17 Apr 2021 16:41:10 -0500 Subject: [PATCH 2/6] ModCharts Fixes --- ModCharts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ModCharts.md b/ModCharts.md index c0cb350..efd8bf6 100644 --- a/ModCharts.md +++ b/ModCharts.md @@ -1,6 +1,6 @@ # Kade Engine Lua Mod Chart Documentation -In the latest version of Kade Engine we introduced Mod Charts. Mod Charts are a way of changing gameplay without hard coded values, this is achieved by using the Lua Scripting language to create script files that run during runtime. +In the 1.4.2 release of Kade Engine, we introduced Mod Charts. Mod Charts are a way of changing gameplay without hard coded values. This is achieved by using the Lua Scripting language to create script files that run during runtime. All files **are located in** `assets/data/song/` @@ -197,7 +197,7 @@ Set's the current camera's zoom Set's the hud's zoom -### Actor's +### Actors ##### getRenderedNotes() From 6e3c9f45f40e9d31cc1fd5b779d5b3c5db79180e Mon Sep 17 00:00:00 2001 From: CyndaquilDAC <65635932+CyndaquilDAC@users.noreply.github.com> Date: Sat, 17 Apr 2021 16:52:19 -0500 Subject: [PATCH 3/6] UGH --- ...itBackground.png => KadeEngineWithBackground.png | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename KadeEngineWitBackground.png => KadeEngineWithBackground.png (100%) diff --git a/KadeEngineWitBackground.png b/KadeEngineWithBackground.png similarity index 100% rename from KadeEngineWitBackground.png rename to KadeEngineWithBackground.png From 82d3183264c13f89436a2fbdf47c6a1629df2008 Mon Sep 17 00:00:00 2001 From: daniel11420 <15311104+daniel11420@users.noreply.github.com> Date: Sun, 18 Apr 2021 14:24:29 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 3f6cc27..f39d709 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ Links: **[itch.io page](https://ninja-muffin24.itch.io/funkin) ⋅ [Newgrounds]( Links: **[GameBanana mod page](https://gamebanana.com/gamefiles/16761) ⋅ [play in browser](https://funkin.puyo.xyz) ⋅ [latest stable release](https://github.com/KadeDev/Kade-Engine/releases/latest) ⋅ [latest development build (windows)](https://ci.appveyor.com/project/KadeDev/kade-engine-windows/build/artifacts) ⋅ [latest development build (linux)](https://ci.appveyor.com/project/KadeDev/kade-engine-linux/build/artifacts)** -**Please note**: as of right now, linux CI has not been set up yet (the "latest developemnt build (linux)" link does not work). you can download a linux build [here](https://ci.appveyor.com/project/daniel11420/kade-engine-linux/build/artifacts) (temporary link) - **REMEMBER**: This is a **mod**. This is not the vanilla game and should be treated as a **modification**. This is not and probably will never be official, so don't get confused. # Screenshots ([skip](#Features)) From 183b3be97db7854edbe98bdf37120b2dae900e30 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Sun, 18 Apr 2021 08:56:39 -0700 Subject: [PATCH 5/6] tutorial is now a modchart :) --- assets/preload/data/tutorial/modchart.lua | 29 ++++ source/PlayState.hx | 161 +++++++++++++++------- 2 files changed, 144 insertions(+), 46 deletions(-) create mode 100644 assets/preload/data/tutorial/modchart.lua diff --git a/assets/preload/data/tutorial/modchart.lua b/assets/preload/data/tutorial/modchart.lua new file mode 100644 index 0000000..4db18f0 --- /dev/null +++ b/assets/preload/data/tutorial/modchart.lua @@ -0,0 +1,29 @@ +function start(song) -- do nothing + +end + +function update(elapsed) + if difficulty == 2 and curStep > 400 then + local currentBeat = (songPos / 1000)*(bpm/60) + for i=0,7 do + setActorX(_G['defaultStrum'..i..'X'] + 32 * math.sin((currentBeat + i*0.25) * math.pi), i) + setActorY(_G['defaultStrum'..i..'Y'] + 32 * math.cos((currentBeat + i*0.25) * math.pi), i) + end + end +end + +function beatHit(beat) -- do nothing + +end + +function stepHit(step) -- do nothing + +end + +function playerTwoTurn() + tweenCameraZoom(1.3,(crochet * 4) / 1000) +end + +function playerOneTurn() + tweenCameraZoom(1,(crochet * 4) / 1000) +end \ No newline at end of file diff --git a/source/PlayState.hx b/source/PlayState.hx index 26a16a2..e33e953 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -229,8 +229,10 @@ class PlayState extends MusicBeatState result = Lua.pcall(lua, args.length, 1, 0); if (getLuaErrorMessage(lua) != null) - trace(func_name + ' LUA CALL ERROR ' + Lua.tostring(lua,result)); - + if (Lua.tostring(lua,result) != null) + throw(func_name + ' LUA CALL ERROR ' + Lua.tostring(lua,result)); + else + trace(func_name + ' prolly doesnt exist lol'); if( result == null) { return null; } else { @@ -1257,6 +1259,8 @@ class PlayState extends MusicBeatState var startTimer:FlxTimer; var perfectMode:Bool = false; + var luaWiggles:Array = []; + function startCountdown():Void { inCutscene = false; @@ -1278,16 +1282,19 @@ class PlayState extends MusicBeatState var result = LuaL.dofile(lua, Paths.lua(PlayState.SONG.song.toLowerCase() + "/modchart")); // execute le file if (result != 0) - trace('COMPILE ERROR\n' + getLuaErrorMessage(lua)); + throw('COMPILE ERROR\n' + getLuaErrorMessage(lua)); // get some fukin globals up in here bois + setVar("difficulty", storyDifficulty); setVar("bpm", Conductor.bpm); setVar("fpsCap", FlxG.save.data.fpsCap); setVar("downscroll", FlxG.save.data.downscroll); setVar("curStep", 0); setVar("curBeat", 0); + setVar("crochet", Conductor.stepCrochet); + setVar("safeZoneOffset", Conductor.safeZoneOffset); setVar("hudZoom", camHUD.zoom); setVar("cameraZoom", FlxG.camera.zoom); @@ -1375,14 +1382,6 @@ class PlayState extends MusicBeatState return notes.members[id].scale.x; })); - trace(Lua_helper.add_callback(lua,"getRenderedNoteScaleY", function(id:Int) { - return notes.members[id].scale.y; - })); - - trace(Lua_helper.add_callback(lua,"getRenderedNoteAlpha", function(id:Int) { - return notes.members[id].alpha; - })); - trace(Lua_helper.add_callback(lua,"setRenderedNotePos", function(x:Int,y:Int, id:Int) { notes.members[id].modifiedByLua = true; notes.members[id].x = x; @@ -1399,16 +1398,6 @@ class PlayState extends MusicBeatState notes.members[id].setGraphicSize(Std.int(notes.members[id].width * scale)); })); - trace(Lua_helper.add_callback(lua,"setRenderedNoteScaleX", function(scale:Float, id:Int) { - notes.members[id].modifiedByLua = true; - notes.members[id].scale.x = scale; - })); - - trace(Lua_helper.add_callback(lua,"setRenderedNoteScaleY", function(scale:Float, id:Int) { - notes.members[id].modifiedByLua = true; - notes.members[id].scale.y = scale; - })); - trace(Lua_helper.add_callback(lua,"setActorX", function(x:Int,id:String) { getActorByName(id).x = x; })); @@ -1429,13 +1418,6 @@ class PlayState extends MusicBeatState getActorByName(id).setGraphicSize(Std.int(getActorByName(id).width * scale)); })); - trace(Lua_helper.add_callback(lua,"setActorScaleX", function(scale:Float,id:String) { - getActorByName(id).scale.x = scale; - })); - - trace(Lua_helper.add_callback(lua,"setActorScaleY", function(scale:Float,id:String) { - getActorByName(id).scale.y = scale; - })); trace(Lua_helper.add_callback(lua,"getActorWidth", function (id:String) { return getActorByName(id).width; @@ -1460,17 +1442,34 @@ class PlayState extends MusicBeatState trace(Lua_helper.add_callback(lua,"getActorY", function (id:String) { return getActorByName(id).y; })); - - trace(Lua_helper.add_callback(lua,"getActorScaleX", function (id:String) { - return getActorByName(id).scale.x; - })); - - trace(Lua_helper.add_callback(lua,"getActorScaleY", function (id:String) { - return getActorByName(id).scale.y; - })); + // tweens + Lua_helper.add_callback(lua,"tweenCameraPos", function(toX:Int, toY:Int, time:Float, onComplete:String) { + FlxTween.tween(FlxG.camera, {x: toX, y: toY}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + + Lua_helper.add_callback(lua,"tweenCameraAngle", function(toAngle:Float, time:Float, onComplete:String) { + FlxTween.tween(FlxG.camera, {angle:toAngle}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + + Lua_helper.add_callback(lua,"tweenCameraZoom", function(toZoom:Float, time:Float, onComplete:String) { + FlxTween.tween(FlxG.camera, {zoom:toZoom}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + + Lua_helper.add_callback(lua,"tweenHudPos", function(toX:Int, toY:Int, time:Float, onComplete:String) { + FlxTween.tween(camHUD, {x: toX, y: toY}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + + Lua_helper.add_callback(lua,"tweenHudAngle", function(toAngle:Float, time:Float, onComplete:String) { + FlxTween.tween(camHUD, {angle:toAngle}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + + Lua_helper.add_callback(lua,"tweenHudZoom", function(toZoom:Float, time:Float, onComplete:String) { + FlxTween.tween(camHUD, {zoom:toZoom}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,["camera"]);}}}); + }); + Lua_helper.add_callback(lua,"tweenPos", function(id:String, toX:Int, toY:Int, time:Float, onComplete:String) { FlxTween.tween(getActorByName(id), {x: toX, y: toY}, time, {ease: FlxEase.cubeIn, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,[id]);}}}); }); @@ -1494,6 +1493,54 @@ class PlayState extends MusicBeatState Lua_helper.add_callback(lua,"tweenFadeOut", function(id:String, toAlpha:Int, time:Float, onComplete:String) { FlxTween.tween(getActorByName(id), {alpha: toAlpha}, time, {ease: FlxEase.circOut, onComplete: function(flxTween:FlxTween) { if (onComplete != '' && onComplete != null) {callLua(onComplete,[id]);}}}); }); + + // shader + + /*Lua_helper.add_callback(lua,"setRenderedNoteWiggle", function(id:Int, effectType:String, waveSpeed:Int, waveFrequency:Int) { + trace('call'); + var wiggleEffect = new WiggleEffect(); + switch(effectType.toLowerCase()) + { + case 'dreamy': + wiggleEffect.effectType = WiggleEffectType.DREAMY; + case 'wavy': + wiggleEffect.effectType = WiggleEffectType.WAVY; + case 'heat_wave_horizontal': + wiggleEffect.effectType = WiggleEffectType.HEAT_WAVE_HORIZONTAL; + case 'heat_wave_vertical': + wiggleEffect.effectType = WiggleEffectType.HEAT_WAVE_VERTICAL; + case 'flag': + wiggleEffect.effectType = WiggleEffectType.FLAG; + } + wiggleEffect.waveFrequency = waveFrequency; + wiggleEffect.waveSpeed = waveSpeed; + wiggleEffect.shader.uTime.value = [(strumLine.y - Note.swagWidth * 4) / FlxG.height]; // from 4mbr0s3 2 + notes.members[id].shader = wiggleEffect.shader; + luaWiggles.push(wiggleEffect); + }); + + Lua_helper.add_callback(lua,"setActorWiggle", function(id:String, effectType:String, waveSpeed:Int, waveFrequency:Int) { + trace('call'); + var wiggleEffect = new WiggleEffect(); + switch(effectType.toLowerCase()) + { + case 'dreamy': + wiggleEffect.effectType = WiggleEffectType.DREAMY; + case 'wavy': + wiggleEffect.effectType = WiggleEffectType.WAVY; + case 'heat_wave_horizontal': + wiggleEffect.effectType = WiggleEffectType.HEAT_WAVE_HORIZONTAL; + case 'heat_wave_vertical': + wiggleEffect.effectType = WiggleEffectType.HEAT_WAVE_VERTICAL; + case 'flag': + wiggleEffect.effectType = WiggleEffectType.FLAG; + } + wiggleEffect.waveFrequency = waveFrequency; + wiggleEffect.waveSpeed = waveSpeed; + wiggleEffect.shader.uTime.value = [(strumLine.y - Note.swagWidth * 4) / FlxG.height]; // from 4mbr0s3 2 + getActorByName(id).shader = wiggleEffect.shader; + luaWiggles.push(wiggleEffect); + });*/ for (i in 0...strumLineNotes.length) { var member = strumLineNotes.members[i]; @@ -2099,6 +2146,12 @@ class PlayState extends MusicBeatState setVar('cameraZoom',FlxG.camera.zoom); callLua('update', [elapsed]); + for (i in luaWiggles) + { + trace('wiggle le gaming'); + i.update(elapsed); + } + /*for (i in 0...strumLineNotes.length) { var member = strumLineNotes.members[i]; member.x = getVar("strum" + i + "X", "float"); @@ -2419,6 +2472,10 @@ class PlayState extends MusicBeatState } #end camFollow.setPosition(dad.getMidpoint().x + 150 + offsetX, dad.getMidpoint().y - 100 + offsetY); + #if cpp + if (lua != null) + callLua('playerTwoTurn', []); + #end // camFollow.setPosition(lucky.getMidpoint().x - 120, lucky.getMidpoint().y + 210); switch (dad.curCharacter) @@ -2435,11 +2492,6 @@ class PlayState extends MusicBeatState if (dad.curCharacter == 'mom') vocals.volume = 1; - - if (SONG.song.toLowerCase() == 'tutorial') - { - tweenCamIn(); - } } if (PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection && camFollow.x != boyfriend.getMidpoint().x - 100) @@ -2455,6 +2507,11 @@ class PlayState extends MusicBeatState #end camFollow.setPosition(boyfriend.getMidpoint().x - 100 + offsetX, boyfriend.getMidpoint().y - 100 + offsetY); + #if cpp + if (lua != null) + callLua('playerOneTurn', []); + #end + switch (curStage) { case 'limo': @@ -2468,11 +2525,6 @@ class PlayState extends MusicBeatState camFollow.x = boyfriend.getMidpoint().x - 200; camFollow.y = boyfriend.getMidpoint().y - 200; } - - if (SONG.song.toLowerCase() == 'tutorial') - { - FlxTween.tween(FlxG.camera, {zoom: 1}, (Conductor.stepCrochet * 4 / 1000), {ease: FlxEase.elasticInOut}); - } } } @@ -2594,6 +2646,11 @@ class PlayState extends MusicBeatState dad.playAnim('singLEFT' + altAnim, true); } + #if cpp + if (lua != null) + callLua('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]); + #end + dad.holdTimer = 0; if (SONG.needsVoices) @@ -3483,6 +3540,12 @@ class PlayState extends MusicBeatState boyfriend.playAnim('singRIGHTmiss', true); } + #if cpp + if (lua != null) + callLua('playerOneMiss', [direction, Conductor.songPosition]); + #end + + updateAccuracy(); } } @@ -3631,6 +3694,12 @@ class PlayState extends MusicBeatState boyfriend.playAnim('singLEFT', true); } + #if cpp + if (lua != null) + callLua('playerOneSing', [note.noteData, Conductor.songPosition]); + #end + + if (!loadRep) playerStrums.forEach(function(spr:FlxSprite) { From 860e43e930511f7e27dbcf7036433db5efa04dc9 Mon Sep 17 00:00:00 2001 From: daniel11420 <15311104+daniel11420@users.noreply.github.com> Date: Mon, 19 Apr 2021 19:23:25 +0200 Subject: [PATCH 6/6] kadedev my beloved --- source/TitleState.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/TitleState.hx b/source/TitleState.hx index 657ff1f..31d1363 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -24,8 +24,11 @@ import io.newgrounds.NG; import lime.app.Application; import openfl.Assets; -#if cpp +#if windows import Discord.DiscordClient; +#end + +#if cpp import sys.thread.Thread; #end @@ -63,7 +66,7 @@ class TitleState extends MusicBeatState PlayerSettings.init(); - #if cpp + #if windows DiscordClient.initialize(); Application.current.onExit.add (function (exitCode) {