Well, i guess i should explain more about the rest of the code.
- In the tour i have some buttons which are meant as Categories.
- Each scene has a parameter "group".
- Scenes are scattered, like: scene[0].group = 'CAT1'; scene[1].group = 'CAT2'; scene[2].group = 'CAT1' ...
- When pressing on a Category button, code filters all corresponding scenes and sets their scene.index consecutively starting from 0 to count of these scenes. The rest (other category) scene indexes are set to a number higher than total scene count not to interfere with anything.
- Basically scene.index != scene[index] anymore.
So, knowing this,
i can not really set the variable let's say 'sequence' as correct scene[index] number and work with it because scenes are not in sequence.
Let's say, in category 'CAT1' there are scenes [0],[2],[14],[15],[17]. So, if the current scene is [0] and i press "NEXT", i need to move to the scene[2].
I was wondering maybe sorting scenes by groups could bring up to something,
but i'm having also an idea in the future that one scene could be in 2 groups (like variables 'group1' and 'group2'). In that case this solution wouldn't work..
I hope i did explain it understandable.