#simple lua cutscene broken

17 messages · Page 1 of 1 (latest)

dapper flicker
#

for whatever reason this simple lua cutscene breaks after teleporting to the room c_grass

here's my current code:

function onTalk()
    disableMovement()
    say("d_huh")
    walk(-15)
    wait(1)
    walk(14)
    helpers.teleport(0, 0, "c_grass", "WalkInLeft")
    wait(1.5)
    walk(-30)
    wait(3)
    walk(30)
    helpers.teleport(30, 0, "1a", "ThinkForABit")
end
#

basically what happens is after being teleported the players movement comes back and the cutscene doesn't finish

#

what i need it to do is to teleport and then wait and walk a bit then teleport back to the main room and play the ThinkForABit intro

#

not sure at what point the code is breaking because there are no visible errors anywhere

polar wedge
#

teleporting unloads the lua cutscene entity

#

split your cutscene into two, before and after the teleport

dapper flicker
#

gotcha ty 🙏

#

i kinda figured that's what was happening, still kinda weird how that works tho 🤷‍♂️

polar wedge
#

transitioning unloads all entities

#

if you need the lua cutscene entity to not unload you can give it the global tag for the duration of the cutscene which prevents it from unloading

#

i dont have a snippet for you to try though cus im on phone

#

id still prefer splitting the cutscene

dapper flicker
#

i feel like splitting it makes more sense so i'll just do that 🤷‍♂️

#

ty ty

#

how can i trigger the second cutscene autoamtically?

#

is there a function for that?

#

oh i guess just put a lua cutscene trigger at the spawn point right