The one line...
There is a single array line in all of DS-cadia that does not behave like the typical array lines. Variable arrays store both the x and y coordinates of the entry in question, and when placed in a variable, copies both x and y coordinates with it. Normally, the coordinates are not treated like separate entries, but the following line is special:
(5:390) starting with entry #, set # entries in array # to #.
This line sets coordinate specific entries. In our previous array%Jukebox, we would have to declare entries 0, 2, 4, 6, and 8 to store the same data line (5:311) did since this line only stores half the array value. In reality, our%Jukebox array, if represented as a line of data would look like this:
4 0 72 0 2 0 34 0 16 0
As you can see, to properly use (5:390), you’d have to multiply the entry you’re trying to store by 2 if it's an X coordinate, or multiply by 2 then add 1 if you wanted to store a Y coordinate instead.
To further illustrate this concept, let's use a short example to compare how to store coordinates to arrays first using line(5:311) use variable # as an array, and set entry # of it to # and then again, using line(5:390) starting with entry #, set # entries in array # to #.
Share this:
-
-
-