Page 1 of 1

[Therenas][1.1.32] on_cutscene_cancelled() not called when cutscene finishes on its own

Posted: Mon Apr 19, 2021 4:24 am
by asher_sky
The lua-api says that the on_cutscene_cancelled event is "Called when a cutscene finishes on its own or is cancelled by the player or by script" but it does not appear to be called when a cutscene finished on its own.

steps to reproduce:

Code: Select all

1. listen to the event
script.on_event(defines.events.on_cutscene_cancelled, function(event)
  game.print("on_cutscene_cancelled")
end)
2. Create a cutscene and terminate it early with /c game.player.exit_cutscene()
3. The event is called and text is printed to console
4. Create a cutscene and let it play out without cancelling it.
5. The event does not fire and nothing is printed.
Here's my log:
factorio-previous.log
(65.28 KiB) Downloaded 116 times

Re: [Therenas][1.1.32] on_cutscene_cancelled() not called when cutscene finishes on its own

Posted: Mon Apr 19, 2021 9:31 am
by Therenas
Thanks for the report. This is not actually a bug, but a mistake in the documentation, which is fixed for the next version.

I added the 'on its own' part recently because that's how the vanilla freeplay cutscene behaves, so I mistakenly assumed this is the default behaviour. Looking into it again, I realised that the freeplay script manually exits the cutscene every time at the end, causing this event to be fired.