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 (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]
[1.1.39] on_cutscene_waypoint_reached index starts at 0
- Stringweasel
- Filter Inserter
- Posts: 318
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
[1.1.39] on_cutscene_waypoint_reached index starts at 0
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
- Deadlock989
- Smart Inserter
- Posts: 2528
- Joined: Fri Nov 06, 2015 7:41 pm
Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0
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++.
- Stringweasel
- Filter Inserter
- Posts: 318
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0
Yes, of course. As long as it is documented.Deadlock989 wrote: ↑Sun Sep 12, 2021 11:00 amMy 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++.
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Re: [1.1.39] on_cutscene_waypoint_reached index starts at 0
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.
There is a note added to the on_cutscene_waypoint_reached event that will appear in 1.1.40. No changelog entry for this.