Request for a new syntax

Hello everyone,

can we add a new syntax called “set_array” that will complements “create_array” and “temp_array”?

both create and temp array has become my favorite syntaxes, but there seems to be a problem when I want to change the value of array variables while the game runs
( on runtime )

not exactly a huge problem, but a tedious ones since I have to change each variable per command line, my coding lines are increased unnecessarily just for changing variable values

as of now I have to do this:

set attribute_1 10
set attribute_2 12
set attribute_3 20

I hope we can do this:

set_array attribute 3 10, 12, 20

it’s very similar to create and temp array, but it can be used to change values on runtime,
I hope we can implement this, thank you :pray:

3 Likes

Meanwhile, take a look at CSLib. It’s an assorted collection of subroutines, including some to manage arrays.

4 Likes

Well, you could put this code somewhere:

*label set_array
*params
*temp aux 1
*label set_array_loop
*set {(param_1&("_"&aux))} {("param_"&(aux+2))}
*if (aux < param_2)
    *set aux +1
    *goto set_array_loop
*return

and then call it like this:

*gosub set_array "attributes" 3 10 12 20

(You need to put “attributes” in quotation marks.)

And yes, I am a geek. :grinning:

4 Likes