#How do I make a cutscene where the camera moves and dream blocks activate?
1 messages · Page 1 of 1 (latest)
https://github.com/EverestAPI/ModResources/wiki/Lua-Cutscenes-Recipe-Book#example-controlling-the-camera has good examples how to move camera
alright
ok
honestly just put there Activate Dream Block trigger somewhere outside room, then find it with GetEntity and change it's .X
alright
also
How can I make that the cutscene plays after destroying the lightning box
getEntity("ActivateDreamBlocksTrigger","Celeste.Mod.Entities") ig
._.
should ber very compicated i think...
or do
damn
or, put cutscene outside block (so player will touch it)
then getEntity the box
and check if it's deactivated (somehow..)
with while not <deactivated> coroutine.yield(nil) end
and after this loop put actual code for cutscene
w h a t
I just got into Lua 1 hour ago
that would be awesome
(obv you will have to give me credits and $20)
Yeah
Also
Ignore the music progression
I found a better way to place it
that line moves Activate Dreamblock trigger (assuming you placed it somewhere in room) to 0,0
with 4,0 being half tile offset
top left corner
oh no snip is typing
he will say that i havae 99999 errors in cutscene
just like last time
probably
i suggest reading up on magic numbers and doing something like
local ONE_TILE = 8
and referencing ONE_TILE elsewhere in place of 8
oh look he didn't 
functionally changes nothing, but makes it more readable
but who cares about readability..? 
ok, do as snip says
that way the reader doesn't ask "what does 8 mean", and the variable name tells you what it is
code is more often read than written
so readability is somewhat important
How do I build it in lönn so it works?
you kinda don't
oh
you just save the file in Assets/YourUsername/YourCampaignName/yourCutscene.lua
I did
and reference the file in your lua cutscene trigger
hover over the path property name for details
I did
then just enter the cutscene trigger
if it doesnt cutscene, check your log.txt for details
it doesnt :(
(02/10/2024 21:12:29) [Everest] [Error] [Lua Cutscenes] Failed to get entity: 'Celeste.LightningBreakerBox' is not trackable
(02/10/2024 21:12:29) [Everest] [Error] [Lua Cutscenes] Failed to resume coroutine
Detailed exception log:
System.Exception: [string "function onBegin()
..."]:3: attempt to index a nil value (local 'lightingBox')
at Celeste.Mod.LuaCoroutine.MoveNext() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Helpers/LuaCoroutine.cs:line 21
at Celeste.Mod.LuaCutscenes.LuaHelper.SafeMoveNext(LuaCoroutine enumerator)
@tight relic
oh well
wellllllllll
why i expected something like this ._.
so my getEntity functions from DH are useful
awesome

true
the only not incredible thing is that i have to close game and start doing stuff and it's 11pm
the getFirstEntity in the room:
me making a pr at 5 am:
getFirstEntity is like getEntity except it doesn't use the tracker
._. lol what
same for getAllEntities vs getEntities
@hard sonnet replace getEntity with getFirstEntity
does it mean that my functions are not useful? ok.
for both?
yea
Is that ya or nah?
the cutscene trigger?
don't forget Activate db trigger
uh wait uhh
idk, that looks like an
Ac
ti
va
te
Dr
ea
m
Bl
oc
ks
i think you should make it room size, and put offroom
enough off room
so you will be veryvery sure player will not touch it
Like that
I place it under the room
huh
(02/10/2024 21:24:08) [Everest] [Error] [Lua Cutscenes] Failed to resume coroutine
Detailed exception log:
System.Exception: [string "function onBegin()
..."]:3: attempt to compare number with nil
at Celeste.Mod.LuaCoroutine.MoveNext() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Helpers/LuaCoroutine.cs:line 21
at Celeste.Mod.LuaCutscenes.LuaHelper.SafeMoveNext(LuaCoroutine enumerator)
khmm
let me recheck
ah yes
put local dzhake = require("#Celeste.Mod.DzhakeHelper.Utils").Lua at very start of file
and put GetPrivateMember(lightingBox, "health") instead of lightingBox.health
Like that?
and make sure you have DzhakeHelper
yea
#code_modding message 
i do
rotation collab already uses it
hold on
lemme install Dzhake helper
ok I installed Dzhake helper and have put it as a dependency
hold on gotta update everest
the fuck
why did my everest now crash
I wished Frost helper had more of these activator stuff
(02/10/2024 21:40:53) [Everest] [Error] [Lua Cutscenes] Failed to resume coroutine
Detailed exception log:
System.Exception: [string "local dzhake = require("#celeste.Mod.DzhakeHe..."]:4: attempt to compare number with nil
at Celeste.Mod.LuaCoroutine.MoveNext() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Helpers/LuaCoroutine.cs:line 28
at Celeste.Mod.LuaCutscenes.LuaHelper.SafeMoveNext(LuaCoroutine enumerator)
@tight relic
?
put newline after it
yeah
and run
oh wait
try also putting log("next line is 'dzhake'!!") before it
so we will understand when dzhake is logged
Like that?
yes
try restarting game
nothing
where tf did log go
(02/10/2024 21:51:06) [Everest] [Info] [Lua Cutscenes] next line is 'dzhake'!!
(02/10/2024 21:51:06) [Everest] [Info] [Lua Cutscenes] C# Type: Celeste.Mod.DzhakeHelper.Utils.Lua
(02/10/2024 21:51:06) [Everest] [Error] [Lua Cutscenes] Failed to resume coroutine
Detailed exception log:
System.Exception: [string "local dzhake = require("#celeste.Mod.DzhakeHe..."]:6: attempt to compare number with nil
at Celeste.Mod.LuaCoroutine.MoveNext() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Helpers/LuaCoroutine.cs:line 28
at Celeste.Mod.LuaCutscenes.LuaHelper.SafeMoveNext(LuaCoroutine enumerator)
ok mybe test is better
so it is logged and it exists
Is session.setFlag a lua thing?
?
can you send cutscene?
how do I write it like you did?
ok whatever
replace GetEntity with dzhake.GetEntity
should work (?)
oh wait dlfgdjlfdsafksdjfasd
send cutscene pls
i'm a bit lost
local dzhake = require("#celeste.Mod.DzhakeHelper.Utils").Lua
function onBegin()
log("next line is 'dzhake'!!")
log(dzhake)
local lightingBox = getFirstEntity("LightningBreakerBox")
while lightingBox.health > 0 do coroutine.yield(nil) end
-- box is broken
setCameraOffset(-2) -- input some number instead of -2
local trigger = getFirstEntity("ActivateDreamBlocksTrigger","Celeste.Mod.Entities.")
trigger.Position = vector2(0,0) -- puts trigger at top left corner. 8 is one tile.
end
function onEnd(room, wasSkipped)
end
Ok no
How do I send it like a code wall or smt
```
local dzhake = require("celeste.Mod.DzhakeHelper.Utils").Lua
function onBegin()
log("next line is 'dzhake'!!")
log(dzhake)
local lightingBox = getFirstEntity("LightningBreakerBox")
while lightingBox.health > 0 do coroutine.yield(nil) end
-- box is broken
setCameraOffset(-2) -- input some number instead of -2
local trigger = getFirstEntity("ActivateDreamBlocksTrigger","Celeste.Mod.Entities.")
trigger.Position = vector2(0,0) -- puts trigger at top left corner. 8 is one tile.
end
function onEnd(room, wasSkipped)
end
huh
instead of lightingBox.health put dzhake.GetPrivateMember(lightingBox, "health")
(02/10/2024 22:00:35) [Everest] [Info] [Lua Cutscenes] next line is 'dzhake'!!
(02/10/2024 22:00:35) [Everest] [Info] [Lua Cutscenes] C# Type: Celeste.Mod.DzhakeHelper.Utils.Lua
(02/10/2024 22:00:35) [Everest] [Error] [Lua Cutscenes] Failed to resume coroutine
Detailed exception log:
System.Exception: [string "local dzhake = require("#celeste.Mod.DzhakeHe..."]:6: attempt to call a nil value (global 'GetPrivateMember')
at Celeste.Mod.LuaCoroutine.MoveNext() in /home/vsts/work/1/s/Celeste.Mod.mm/Mod/Helpers/LuaCoroutine.cs:line 28
at Celeste.Mod.LuaCutscenes.LuaHelper.SafeMoveNext(LuaCoroutine enumerator)
you didn't forget dzhake., right?
oops
what's in log
(02/10/2024 22:03:32) [Everest] [Info] [Lua Cutscenes] next line is 'dzhake'!!
(02/10/2024 22:03:32) [Everest] [Info] [Lua Cutscenes] C# Type: Celeste.Mod.DzhakeHelper.Utils.Lua
nah
also remove those logs
log s?
other trigger 
click at bg
it may say something about "ActivateDreamBlocksTrigger" in top left thing

Thats just debug mode.
good night
I could use the activator triggers from frost helper

