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

This subforum contains all the issues which we already resolved.
Post Reply
asher_sky
Inserter
Inserter
Posts: 44
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

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

Post 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 97 times

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

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

Post 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.

Post Reply

Return to “Resolved Problems and Bugs”