Page 1 of 1

[1.1.39] on_cutscene_waypoint_reached index starts at 0

Posted: Sun Sep 12, 2021 8:41 am
by Stringweasel
This is either a bug, or an error in documentation. If it's simply an error in documentation then I'll will make a post on that thread. If it's a bug, then I'm not sure how it remained in the game for so long :D (although cutscenes aren't used much)

What?
The on_cutscene_waypoint_reached event returns an index, and it states "refers to an index in the table previously passed to set_controller which started the cutscene". What I believe is the bug is that this returned indexes starts at 0, and not 1, because it should be the index to an entry in a lua table.

What did I expect?
I have four waypoints defined. I expect the four on_cutscene_waypoint_reached events triggered to return indexes [1,2,3,4]

What happened?
The four returned indexes are [0,1,2,3]

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

Posted: Sun Sep 12, 2021 11:00 am
by Deadlock989
My preference would be to change the documentation rather than break all the mods which currently compensate for this, probably some artifact of passing stuff between Lua and C++.

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

Posted: Sun Sep 12, 2021 11:06 am
by Stringweasel
Deadlock989 wrote:
Sun Sep 12, 2021 11:00 am
My preference would be to change the documentation rather than break all the mods which currently compensate for this, probably some artifact of passing stuff between Lua and C++.
Yes, of course. As long as it is documented.

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

Posted: Sun Sep 12, 2021 11:36 am
by boskid
Indeed it starts at 0. I am not willing to fix this issue as it would be a change that possibly breaks many mods and even the freeplay script from base game.

There is a note added to the on_cutscene_waypoint_reached event that will appear in 1.1.40. No changelog entry for this.