Reasoning:
I wanted to pcall(player.jump_to_cutscene_waypoint, event.waypoint_index + 1) during on_cutscene_waypoint_reached, to test if the waypoint just reached was the final (within reason). Was in the middle of testing what was true (are we still in cutscene controller, what gets raised, etc) and ran into a side-effect.
Logically speaking, either the waypoint is set to it's current value (doing nothing, maybe raising reached event which would be avoided the second time) or an error is raised: index out of bounds, meaning the last waypoint just ended the cutscene.
Expectation: Error is raised without side-effects.
Reality: Error with side effect of raising on_cutscene_waypoint_reached only when omitting a final_transition_time
Reproduction:
0) listen to reached event and set an incremented index
1) Create a set_controller argument table with some waypoints.
2) omit a final_transition_time
3) set_controller(cutscene)
Game repeatedly raises waypoint reached with higher indices, never leaving the cutscene.
If final_transition_time is present* [edit], there is no side-effect.
Code is provided:
I understand the nature of this is "there's a side effect from *an error*, could you fix the side effect?", but it is a strange incident that I thought someone might want to know about.
[Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds
Re: [Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds
Its not really a side effect of an error, just a bug, that if you set the index to the last index when you have no final transtion time, it would fail its 'Am I finished check' and loop forever.
I fixed it for 1.2
I fixed it for 1.2