Add a maparray. #841
Unanswered
Orochikyocr
asked this question in
Feature Request
Replies: 2 comments 1 reply
1 reply
|
Checking for an array's content through an equal operator seems like a good idea to unhardcode command trigger behavior related to syntax, since it could simply return an array of all current commands being performed by the player, so syntax would be able to stay the same.
Arrays should be added as a new data type, as opposed to just some special behavior for maps. Maps could hold an array/table of values, in any case. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Let's say I need to trigger to activate a function.
trigger1 = var(5) = 10; single value
trigger1 = var(5) = [5,10]; range between 5 and 10 ,5,6,7,8,9,10
But what if I need only 5, 7, and 9 for whatever reason I would need such a thing, right now is like this.
trigger1 = var(5) = 5 || var(5) = 7 || var(5) = 9
I can think of two solutions.
trigger1 = var(5) = [5 || 7 || 9]
or an array
type = maparray
trigger1 = 1
map = "thevaluesneeded"
value = 5
value = 7
value = 9
then
trigger1 = var(5) = map(thevaluesneeded);
This should look way shorter, now imagine this with many values.
I'm working converting Stupa code to be used as a standard helper that any char could use,
since I needed to change how advframe sprites are being called, I needed to create a new
function that calls the same map, over and over. I just amazed at how nobody has think of adding arrays to cns or zss so far.
This code could be way shorter with an array. Also, this is more likely to cause errors because a typo.
All reactions