script.lua modules in chart folder for events and other stuff, added onDraw for modules, added mist to limoErect stage, added video intro to ugh hard

This commit is contained in:
entar 2025-06-08 22:32:00 +07:00
parent 0a49f9e06a
commit 0021509866
30 changed files with 331 additions and 208 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
settings.json
log.log
log.log
*.log

View File

@ -1,44 +0,0 @@
function onGameOverStart()
playSound("explode", 0.8)
makeAnimatedLuaSprite('explosion', 'explosionfrom_edd', -1600, -850);
addAnimationByPrefix('explosion', 'boom', 'TordBotBlowingUp', 18, false);
setProperty('explosion.angle', -90);
setProperty('explosion.alpha', 0);
addLuaSprite('explosion', true);
scaleObject('explosion', 2.5, 2.5);
cameraShake('camGame', 0.02, 0.5);
makeLuaSprite('bgd', 'BlackFlash', -1500, -1500)
scaleObject('bgd', 3, 3.5)
setObjectOrder('bgd', getObjectOrder('gfGroup') + 4)
addLuaSprite('bgd', false)
setProperty('explosion.alpha', 1);
objectPlayAnimation('explosion', 'boom', true);
playSound('shot1', 1)
runTimer('picoded', 1.5)
end
function onTimerCompleted(tag, loops, loopsleft)
if tag == 'picoded' then
playSound('cutscene/nene_laugh', 1)
end
if tag == 'picoded2' then
doTweenAlpha('fadebgdgone', 'bgd', 0, 4, 'linear');
end
end
-- crash prevention
function onUpdate() end
function onUpdatePost() end

View File

@ -1,19 +0,0 @@
local stop_countdown = true
function onCreatePost()
if stop_countdown == true then
stop_countdown = false
playSound("traffic", 0.5)
return Function_Stop
end
return Function_Continue
end
-- crash prevention
function onUpdate() end
function onUpdatePost() end

View File

@ -1,97 +0,0 @@
-- RANK ONLY UP TILL 20, 0 MINIMUM, CHANGE THIS TO SUGGEST HOW HARD THE SONG IS, BY MARKEDAMAN
function onCreate()
if difficulty == 0 then -- easy
rank = 2
elseif difficulty == 1 then -- normal
rank = 4
elseif difficulty == 2 then -- hard
rank = 5
elseif difficulty == 3 then -- erect
rank = 0
elseif difficulty == 4 then -- nightmare
rank = 0
end
end
function onCreatePost()
if not hideHud then
if rank > 10 then
makeLuaSprite('star', 'star2', 1070, 590)
makeAnimatedLuaSprite('starFlame', 'starFlame', 1030, 440)
addAnimationByPrefix('starFlame', 'starFlame', 'fire loop full instance', 24, true)
setProperty('starFlame.alpha', 0)
scaleObject('starFlame', 1.5, 1.5)
setObjectCamera('starFlame', 'hud')
addLuaSprite('starFlame', true)
elseif rank <= 10 then
makeLuaSprite('star', 'star1', 1070, 590)
end
scaleObject('star', 0.9, 0.9)
setObjectCamera('star', 'hud')
setObjectOrder('star', getObjectOrder('starFlame') + 1)
setProperty('star.alpha', 0)
addLuaSprite('star')
makeLuaText('difficulty', ''.. rank ..'', 2230 , 0, 620)
setTextSize('difficulty', 37)
setTextFont('difficulty', 'combo.ttf')
setProperty('difficulty.alpha', 0)
addLuaText('difficulty', false)
setObjectOrder('difficulty', getObjectOrder('star') + 1)
if downscroll then
setProperty('difficulty.y', 70)
setProperty('star.y', 40)
setProperty('starFlame.y', -5)
setProperty('starFlame.angle', 190)
end
if rank > 10 then
setTextColor('difficulty', 'ffffff')
setTextBorder('difficulty', 2, '00AEFF')
elseif rank <= 10 then
setTextColor('difficulty', '000000')
setTextBorder('difficulty', 3, 'FFFFFF')
end
runTimer('ready', 0.5) -- star fade in
runTimer('wait', 8) -- star fade out
runTimer('wait2', 7.5) -- difficulty fade out
if rank > 10 then
runTimer('pausefire', 2) -- difficulty fade in
elseif rank <=10 then
runTimer('pause', 2)
end
end
end
function onTimerCompleted(tag)
if not hideHud then
if tag == 'ready' then
doTweenAlpha('hi', 'star', 1, 0.5,'linear')
end
if tag == 'wait' then
doTweenAlpha('gone', 'star', 0, 0.5,'linear')
doTweenAlpha('fireout', 'starFlame', 0, 0.5,'linear')
end
if tag == 'wait2' then
doTweenAlpha('bye', 'difficulty', 0, 0.5,'linear')
end
if tag == 'pause' then
doTweenAlpha('hi2', 'difficulty', 1, 0.5,'linear')
end
if tag == 'pausefire' then
setProperty('difficulty.alpha', 1)
setProperty('starFlame.alpha', 1)
playSound('light', 0.7)
end
end
end

View File

@ -1,4 +0,0 @@
function onCreate()
setTextFont('scoreTxt', 'vcr.ttf')
setTextFont('timeTxt','timer.ttf')
end

48
charts/ugh/script.lua Normal file
View File

@ -0,0 +1,48 @@
local videoPath = "videos/ughCutscene.ogv"
local song
local videoStream
local video
local module = {}
function module.onCreate(songName)
if songName == "Ugh" then
module.shared.canStart = false
song = songName
videoStream = love.video.newVideoStream(love.filesystem.newFile(videoPath))
videoStream:play()
video = love.graphics.newVideo(videoStream)
video:play()
end
end
function module.onUpdate()
if videoStream then
if not videoStream:isPlaying() then
module.shared.canStart = true
video = nil
videoStream = nil
end
end
end
function module.onDraw()
if video then
love.graphics.draw(video, 0,0,0,1.5,1.5)
end
end
function module.onClose()
if video then
video:stop()
video:release()
video = nil
videoStream:stop()
videoStream:release()
videoStream = nil
end
end
return module

View File

@ -2,7 +2,7 @@
"song": {
"player1": "bf",
"events": [],
"gfVersion": "gf-tankmen",
"gfVersion": "gf",
"notes": [
{
"sectionNotes": [
@ -3270,7 +3270,7 @@
"player2": "tankman",
"player3": null,
"song": "Ugh",
"stage": "tank",
"stage": "stage",
"needsVoices": true,
"validScore": true,
"bpm": 160,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 KiB

After

Width:  |  Height:  |  Size: 430 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 310 KiB

94
log.log

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,12 @@ local function state(songName, songDifficulty)
voices = love.audio.newSource(string.format("songs/%s/Voices.ogg", chart.song), "stream")
end
local sharedVars = {
canStart = true,
}
local countDown = true
local speed = chart.speed and chart.speed / 3 or 0.5
local miss = love.audio.newSource("sounds/missnote1.ogg", "static")
@ -155,8 +161,6 @@ local function state(songName, songDifficulty)
local deadBF
local restart = false
local startTimestamp = os.time()
local function quit()
if restart then return end
playing = false
@ -266,6 +270,27 @@ local function state(songName, songDifficulty)
function state.update(dt)
if not playing then
for index, module in next, modules do
if module.onUpdate then
module.onUpdate(dt)
end
end
if sharedVars.canStart then
inst:play()
if chart.needsVoices then
voices:play()
end
while not inst:isPlaying() do
end --waiting till the song actually plays.
elapsed = 0
playing = true --countdown now
startTime = socket.gettime()
end
if dead then
myTypes.render.cameraTarget = deadBF.stageCamera
if not restart then
@ -556,12 +581,18 @@ local function state(songName, songDifficulty)
end
end
-- HEALTH BAR
for i, module in next, modules do
if module.onDraw then
module.onDraw() --mainly for cutscenes i guess
end
end
love.graphics.setCanvas()
love.graphics.draw(mainCanvas, (love.graphics.getWidth() - (love.graphics.getWidth() * zoom)) / 2, (love.graphics.getHeight() - love.graphics.getHeight() * zoom) / 2, 0, love.graphics.getWidth()/1920 * zoom, (love.graphics.getHeight()/1080 * zoom))
love.graphics.print({{0,0,0,1}, string.format("FPS: %s \nVolume: %s", love.timer.getFPS(), volume)}, font)
end
love.window.setMode(1280, 720, { fullscreen = false , resizable = false})
@ -589,10 +620,14 @@ local function state(songName, songDifficulty)
modules[#modules+1] = stageModule
end
if stageModule and stageModule.onCreate then
stageModule.onCreate(chart.song)
end
local songScriptExists = io.open(string.format("charts/%s/script.lua", songName))
if songScriptExists then
songScriptExists:close()
local songScript = require(string.format("charts/%s/script", songName))
modules[#modules+1] = songScript
end
-- GF first so she is below other chars
if chart.gfVersion ~= "none" then
@ -770,24 +805,33 @@ local function state(songName, songDifficulty)
state.loaded = true
for i, module in next, modules do
for i, func in next, module do
if type(func) ~= "function" then goto evilContinue end
local newEnv = getfenv(func)
newEnv.game = {
characters=characters,
step=step,
beat=beat,
volume=volume,
ratings=ratings,
keyBinds=keyBinds,
zoom=zoom
}
setfenv(func, newEnv)
::evilContinue::
if type(module) ~= "boolean" then
for i, func in next, module do
if type(func) ~= "function" then goto evilContinue end
local newEnv = getfenv(func)
newEnv.game = {
characters=characters,
step=step,
beat=beat,
volume=volume,
ratings=ratings,
keyBinds=keyBinds,
zoom=zoom
}
setfenv(func, newEnv)
::evilContinue::
end
module.characters = characters
module.shared = sharedVars
if module.onCreate then
module.onCreate(chart.song)
end
end
module.characters = characters
end
logging.log(logging.dump(modules))
local sickImage = myTypes.Image("images/ui/sick.png")
local goodImage = myTypes.Image("images/ui/good.png")
local badImage = myTypes.Image("images/ui/bad.png")
@ -815,21 +859,23 @@ local function state(songName, songDifficulty)
end
function state.finish()
inst:play()
if chart.needsVoices then
voices:play()
if sharedVars.canStart then
inst:play()
if chart.needsVoices then
voices:play()
end
while not inst:isPlaying() do
end --waiting till the song actually plays.
elapsed = 0
playing = true --countdown now
startTime = socket.gettime()
sharedVars.canStart = false -- already started
end
while not inst:isPlaying() do
end --waiting till the song actually plays.
elapsed = 0
playing = true
startTime = socket.gettime()
startTimestamp = os.time()
end
function state.keypressed(key, un, is)

View File

@ -19,7 +19,7 @@ function module.note(raw, mustHitSection, hold, holdEnd)
direction = raw[2] <= 3 and raw[2] + 1 or raw[2] - 3,
spawned = false,
sprite = nil, -- For unspawned notes
altAnim = raw[4] == "Alt",
altAnim = raw[4] == "Alt" or raw[4] == "Alt Animation",
hold = hold,
last = holdEnd,
hitHealth = 0.02,

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,6 +8,9 @@ local shootingStar
local shootingStarCountdown = love.math.random(20, 40)
local mist = {}
local evilMist = {}
return {
onCreate = function(song)
curSong = song
@ -18,19 +21,34 @@ return {
sunset.position = myTypes.Vector2(-100, 0)
sunset.resize = myTypes.Vector2(1, 1)
sunset.modifier = 0.1
sunset.layer = -10
sunset.layer = -12
shootingStar = myTypes.Sprite("sprites/limo/erect/shooting star.png", "sprites/limo/erect/shooting star.json")
shootingStar:PlayAnimation("shooting star idle", 24, true)
shootingStar.position = myTypes.Vector2(200, 0)
shootingStar.modifier = 0.12
shootingStar.layer = -9
shootingStar.layer = -11
local mistBG1 = myTypes.Image("images/limo/erect/mistBack.png", .2)
mistBG1.position = myTypes.Vector2(860, 100)
mistBG1.resize = myTypes.Vector2(1.8, 1.3)
mistBG1.layer = -10
local mistBG2 = myTypes.Image("images/limo/erect/mistBack.png", .2)
mistBG2.position = myTypes.Vector2(-300, 100)
mistBG2.resize = myTypes.Vector2(1.8, 1.3)
mistBG2.layer = -10
mist[1] = mistBG1
mist[2] = mistBG2
local road = myTypes.Sprite("sprites/limo/limoRoad.png", "sprites/limo/limoRoad.json")
road:PlayAnimation("COOLROAD", 24, true)
road.position = myTypes.Vector2(-300, 230)
road.modifier = 0.6
road.layer = -8
road.layer = -9
--nevermind
--funkin team why would you need to alpha this out in game
@ -42,7 +60,22 @@ return {
limobg:PlayAnimation("background limo blue", 24, true)
limobg.position = myTypes.Vector2(-100, 350)
limobg.modifier = 0.6
limobg.layer = -7
limobg.layer = -8
local mistMid1 = myTypes.Image("images/limo/erect/mistMid.png", .5)
mistMid1.position = myTypes.Vector2(860, 300)
mistMid1.resize = myTypes.Vector2(1.8, 1.3)
mistMid1.layer = -6.5
local mistMid2 = myTypes.Image("images/limo/erect/mistMid.png", .5)
mistMid2.position = myTypes.Vector2(-300, 300)
mistMid2.resize = myTypes.Vector2(1.8, 1.3)
mistMid2.layer = -6.5
mist[3] = mistMid1
mist[4] = mistMid2
local limoDriver = myTypes.Sprite("sprites/limo/erect/limoDrive.png", "sprites/limo/erect/limoDrive.json")
limoDriver:PlayAnimation("Limo stage", 24, true)
@ -58,6 +91,19 @@ return {
dancers[i] = dancer
end
local mistFront1 = myTypes.Image("images/limo/erect/mistFront.png", .7)
mistFront1.position = myTypes.Vector2(-350, 500)
mistFront1.resize = myTypes.Vector2(1.8, 1.3)
mistFront1.layer = 5
local mistFront2 = myTypes.Image("images/limo/erect/mistFront.png", .7)
mistFront2.position = myTypes.Vector2(-1630, 500)
mistFront2.resize = myTypes.Vector2(1.8, 1.3)
mistFront2.layer = 5
mist[5] = mistFront1
mist[6] = mistFront2
end,
onBeat = function(beat)
@ -84,5 +130,14 @@ return {
shootingStar:PlayAnimation("shooting star", 24, false)
shootingStarCountdown = love.math.random(20, 40)
end
end,
onUpdate = function (dt)
for index, sh in next, mist do
if sh.position.x > 720 then
sh.position.x = -1630
end
sh.position.x = sh.position.x + 5000 * dt
end
end
}

View File

@ -10,7 +10,7 @@
"camera_boyfriend": [0, 0],
"camera_opponent": [0, 0],
"camera_girlfriend": [-500, 0],
"camera_girlfriend": [500, 0],
"camera_speed": 1,
"default": true
}

BIN
videos/2hotCutscene.mp4 Normal file

Binary file not shown.

BIN
videos/blazinCutscene.mp4 Normal file

Binary file not shown.

BIN
videos/darnellCutscene.mp4 Normal file

Binary file not shown.

45
videos/encoding_info.txt Normal file
View File

@ -0,0 +1,45 @@
Hello there,
If you are reading this, I've likely already been captured, tortured, and murdered.
I'm sharing with you the secrets I know about The Funkin' Crew's secret formula for video encoding.
This letter is meant for those of you who hate compression artifacts,
those who wince at h264 blocks, Those who share in my anguish of
blurring anytime static or confetti appear.
These settings may not work for each and every application,
but I've found them to be a good tradeoff between quality, and filesize.
Using Handbrake 1.8.2 (can likely use an earlier or later version)
This is a bit of an offshoot of the "Fast 720p30" preset, so you can start there.
Filters
- Interlace Detection: Off
- Deinterlate: Off
Video
- Video Encoder: H.265 (x265)
- Uses H.265 on the CPU encoder, since GPU/Hardware encoding has more artifacts.
- Framerate: Same as source - Constant Framerate
- Quality: Constant Quality RF21
- The number can be tweaked as desired a lil bit
- Preset: veryslow
- differences between slow and veryslow might be marginal
- Tune: Animation
- Different tuning could yield better results, I simply went with this one since it said animation!
- Profile: Auto
- Level: Auto
- 3.1 might be good for 720p @ 24fps
Audio
- Codec: AAC
- Biterate: close to whatever source bitrate is, max should be 192kbps prob
To whoever reads this, best wishes and good luck.
In my dying breaths, I will be thinking about a world with good
video compression.
Godspeed, and thank you for reading.
- The Funkin' Crew Inc.

BIN
videos/gunsCutscene.mp4 Normal file

Binary file not shown.

BIN
videos/introSelect.mp4 Normal file

Binary file not shown.

BIN
videos/stressCutscene.mp4 Normal file

Binary file not shown.

Binary file not shown.

BIN
videos/toyCommercial.mp4 Normal file

Binary file not shown.

BIN
videos/ughCutscene.mp4 Normal file

Binary file not shown.

BIN
videos/ughCutscene.ogv Normal file

Binary file not shown.