marsfan Lv 1
My apologies if something like this has been asked for before, I did not see anything recent in the suggestions page.
I just started teaching myself scripting a few days ago, and discovered that operations that run across the entire structure can take a long time because their operations require being done in a for loop.
A couple examples I can think of:
- Determining which parts of the structure are selected require looping across the entire structure and finding the selected elements.
- Changing the strength of multiple bands requires looping through them and setting strength individually
The core issue with this is that there is no way to query for all elements that fit a specific criteria, or specify a set of elements to operating on. This could be solved by allowing users to query for a list of elements with specific parameters, or to pass a list of elements to operate on.
Below are examples of using a list based system that would (in theory), speed up the examples I mentioned above
- A listof all segments that are currently selected could be queried with structure.getCurrentlySelected()
- The strength of a specfic set of bands could be set by passing a list of the bands to adjust, for example: band.setStrength({1, 2, 3}, 5} would set bands 1, 2, and 3 to have a strength of 5. </ul> I have never used LUA before, so I do not know if it is actually possible to perform operations like this with LUA, but I feel that this would allow for faster scripts, and cleaner code than what we currently have to work with.