[Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds
Posted: Mon May 30, 2022 8:49 am
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.
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.