[VX Ace]Setting multiple events' Self-switches with Nicke's Simple Self Switches script[Solved]

Hi. So, first of all, the script I'm having trouble with is the one called 'Simple Self Switches' by Nicke. Here's a link to that.


So, what I'm trying to do is set all Self-switches on multiple events across multiple maps to false in a single script call. The script has a command that goes 'setAllSelf(map, id, true/false)'. This command allows me to set all Self-switches of a single event on a single map to either true or false. Fortunately, with a more complicated script call, I can set all Self-switches of multiple events across multiple maps. The script call I use is the following.

event_ids = [3,5,7]
map_ids = [3,4]
for event in event_ids
for map in map_ids
setAllSelf(map, event, false)
end
end

This script call sets all Self-switches on events 3, 5 and 7 on maps 3 and 4 to false. I don't know if there's a less complicated way to do it and I don't remember if I came up with this script call myself or found something similar somewhere on the Internet (Probably the latter) but what I do know is that it works. However, this method is a bit tedious and unreliable due to the sheer amount of events and maps that I want to affect. The end result would look more like the following.

event_ids = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, all the way up to 100]
map_ids = [1,2,3,4,8,9,10,11,13,17,18,19,20,21,22,23,51,52,53,54,55,56,57,61,62,63, and who knows how many other maps]
for event in event_ids
for map in map_ids
setAllSelf(map, event, false)
end
end

The issue that comes with this is that a script call can only fit so much on a single line. The program can't read it causing a crash and an error message. I was under the impression that I could somehow compress the arrays (Is that what they're called?) and make it look more like the following.

event_ids = [1..100]
map_ids = [1..11,13,17..23,51..57,61..63]
for event in event_ids
for map in map_ids
setAllSelf(map, event, false)
end
end

This no longer causes a crash but instead does absolutely nothing. Isn't that '..' thing supposed to mean 'All values between the former and the latter' or did I completely misunderstand that? Anyway, can this somehow be achieved? Can my script call somehow be fixed to work or is this a lost cause? Fortunately, I have a backup plan so I'm not too worried.
Isn't that '..' thing supposed to mean 'All values between the former and the latter' or did I completely misunderstand that?
you understood that, but not the computer. Different programming languages have different ways to handle things, and that will never work that way.

However let's go back to your original problem:
a script call can only fit so much on a single line.
that is not entirely correct. If done correctly, a script sequence CAN be split over multiple lines. You just have to make sure that the computer understands that something is missing on a line and looks at the next line for the missing parts.

so please give a screenshot of how you tried to use multiple lines, then we can tell you how to make it work.
and next time please use the code tag for displaying code, to prevent the indents from vanishing.
So, I did a little bit more testing and, it turns out, the program didn't like the way one of the commas was placed. Using only the event_ids variable as an example, the program can read the following...

Code:
event_ids =
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,
90,91,92,93,94,95,96,97,98,99,100]

but it cannot read...

Code:
event_ids =
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60
,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89
,90,91,92,93,94,95,96,97,98,99,100]

I guess that's one of the rules of coding. Always check the commas. Anyway, I can work with this. It's not compressed but the script call is working. Thanks. This thread can now be closed as solved.
it isn't exactly about the commas.
the end of the line needs something that tells the computer that there is more to follow. A comma there is just one of several possibilities telling the computer that the list is not yet complete and it has to continue looking, but there are other ways as well. but ending in a number can be considered line-end, that is why it doesn't work without the comma there.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-setting-multiple-events-self-switches-with-nickes-simple-self-switches-script-solved.149613/