I made one mod adding the (musical) instruments highlighted in red, and a different mod adding the (musical) instruments highlighted in yellow/blue.
https://mods.factorio.com/mod/Robotic-V ... or-Speaker
https://mods.factorio.com/mod/DJRobotMIXTAPE1/
I don't understand what i'm doing wrong that cause 1 instrument to appear in the middle of the list from another mod and not at the bottom :
The mod adding the yellow/blue song is adding all of them in the data-update stage and has an optionnal dependancy on the other mod adding the song in red.
The mod adding the song in red adds some of them in the data-update stage those are fine, but there is this one 1 category, the problematic one, that is added in the data-final-fixes stage. I was expecting this to cause it to appear AFTER ALL the othe songs in yellow/blue ideally, or at least at the end of the "red" list.
I read this page : https://lua-api.factorio.com/latest/aux ... cycle.html
But i still don't understand why it appears "in the middle" of the list from the other mod.
This is an empty save with just a speaker and only the 2 mentionned mods in case it help someone helping me :
data-update vs data-final-fixes with 2 dependant mods to order speaker sound list : i don't understand why i fail
Re: data-update vs data-final-fixes with 2 dependant mods to order speaker sound list : i don't understand why i fail
The mod that adds the instruments in data-updates is inserting into speaker.instruments[#speaker.instruments+2] and speaker.instruments[#speaker.instruments+3] etc, so it is leaving gaps. The final fixes mod inserts the instruments into one of those gaps.
The first mod would have to insert into speaker.instruments[#speaker.instruments+1] to not leave gaps or use the more foolproof table.insert without an index.
The first mod would have to insert into speaker.instruments[#speaker.instruments+1] to not leave gaps or use the more foolproof table.insert without an index.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: data-update vs data-final-fixes with 2 dependant mods to order speaker sound list : i don't understand why i fail
Thank you, i will document on the table.insert to try and fix the things that worked despite the way it was done