cruor / luacutscenes Goto Github PK
View Code? Open in Web Editor NEWCeleste mod that adds cutscenes written in Lua.
License: MIT License
Celeste mod that adds cutscenes written in Lua.
License: MIT License
Golden berries, regular berries, and (presumably) keys (though I have not tested those) don't persist through teleports like they should. Probably best to look at other teleport impls like in VivHelper or ContortHelper and just copypaste from there.
InstantTeleport and InstantTeleportTo readd the player to the level after it's reloaded, meaning the player isn't there during Awake, which some entities rely on. Just adding the player before then is sufficient to fix it. Here's a diff.txt of the code that fixes it, as well as a screenshot , and a mod with the fix. (Note this mod also contains code for limiting debris from spinner breakage - this is unrelated.)
because this method sets locked first, the subsequent set state is invalid
Not sure what magic makes it work for regular private methods, but it unfortunately doesn't work for coroutines. Here's a simple cutscene that can be used to replicate the crash:
function onBegin()
getRoom():Options(0, false)
end
Options attempts to run CloseAndRun
from Level
and then crashes. You can also see this by attempting to run this one while over a watchtower:
function onBegin()
celeste.Lookout.Interact(player)
end
...as Interact
tries to run LookRoutine
and also crashes.
In general any private coroutine will crash even if it's not wrapped in a method like the 2 examples above - see coroutine.yield(celeste.Lookout.LookRoutine)
, that also crashes.
If you write a lua cs like
function onBegin()
disablePause()
...
end
and then use a lua cs trigger (but with unskippable = false
) to trigger it, then you will actually have 2 frames to skip the cutscene, even if the lua cs seems to prevent pausing
yeah i know we should set unskippable = true
in this case, but i just want to write everything here, in case you think this should be improved, or someone else curious about what actually happens
order-or-operation analysis:
Frame 1.
LuaCutsceneTrigger.OnEnter
called (when Player.Update
)LuaCutsceneEntity
is createdLuaCutsceneEntity
is to be added to sceneLuaCutsceneEntity.OnEnter
invokedLevel.Update
doneFrame 2.
EntityList.UpdateList
, LuaCutsceneEntity
is actually added into the sceneLuaCutsceneEntity
is a CutsceneEntity
, so Level.StartCutscene
is called, and LuaCutsceneEntity.OnBegin
is calledLevel.StartCutscene
makes it possible to skip cutscene this frameLuaCutsceneEntity.OnBegin
adds a new Coroutine(onBeginWrapper(level))
as a component of itself private IEnumerator onBeginWrapper(Level level)
{
yield return onBeginRoutine;
EndCutscene(level);
}
Level.Update
beginScene.Update
LuaCutsceneEntity.Update
, which leads to its Coroutine
component updateonBeginWrapper(level)
, so onBeginWrapper(level).MoveNext
is called, which makes enumerator.Current = onBeginRoutine
onBeginRoutine
is pushed onto Coroutine's enumerators stackFrame 3.
LuaCutsceneEntity.Update
, so the Coroutine
updateonBeginRoutine.MoveNext
is called, which finally calls disablePause
, that makes level.PauseLock = true
, so you can't pause from now onFrame 4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.