[1.1.39] on_cutscene_waypoint_reached index starts at 0

Things that we don't consider worth fixing at this moment.
Post Reply
User avatar
Stringweasel
Fast Inserter
Fast Inserter
Posts: 102
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

[1.1.39] on_cutscene_waypoint_reached index starts at 0

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

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

Post 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++.
"If Stalin had a good writeup on programming, would linking that be dangerous?"

User avatar
Stringweasel
Fast Inserter
Fast Inserter
Posts: 102
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

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

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 1792
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0

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

Post Reply

Return to “Won't fix.”