List Utils (Sorter, Duplicate Remover, and 2D Arrays)

Dom818

  • *
  • Posts: 1296
It doesn't seem to work. I get this message when I try to convert a game list into a 2D list

"Events for 'TextBox3' (57) -  Invalid assign"

Can anybody help me out on this?

Hmm, I never considered this to be used with Game Attribute Lists. I'll look into it tomorrow and see if I can make them compatible.

MyChairHasALooIn

  • Posts: 310
3d arrays next yes? 4d? brain twisting 5d?

I jest, great work sir :).

Dom818

  • *
  • Posts: 1296
3d arrays next yes? 4d? brain twisting 5d?

I jest, great work sir :).

Thanks. 3D,  4D, 5D and any other dimensional arrays are possible. I would like to add that kind of functionality but there is currently no good way to expose it in Stencyl.

betofantasioso

  • Posts: 76
It doesn't seem to work. I get this message when I try to convert a game list into a 2D list

"Events for 'TextBox3' (57) -  Invalid assign"

Can anybody help me out on this?

Hmm, I never considered this to be used with Game Attribute Lists. I'll look into it tomorrow and see if I can make them compatible.

Thanks for all your effort Dom818 it's really appreciated!

aprotasenya

  • Posts: 10
Got an error with the 2D array.

I populate the array with zeroes (as number) and letters "x" (as text). And then a script loops through every item in the 2D array and if it's not equal zero (number) - removes the item. The thing is - it treats any text value as if it is a zero, so it does not remove an item with text in it.
I've also tried to check whether the item is zero as text, but had no effect.

Do I do anything wrong or is there an error on the extension's side?

Would be grateful for assistance.

aprotasenya

  • Posts: 10
My issue (read above) was solved, so if you happen to come across the same thing, here's an explanation and a workaround from Dom:
"It seems the problem comes from how Haxe, the language behind Stencyl, returns values from the list. It seems to return everything as text; when you compare this to a number, in your case 0, it also casts the string to a number, by default 0. This makes it always return true. To solve this, simply wrap the 0 in an "as text" block."

Cheers!

designpeg

  • *
  • Posts: 594
Hi, I might be missing something, but the sort list block seems to only order by the first digit, i.e.. 2 is considered to be higher than 12.

log shows  a list of lists before and after sorting (2, 12, 3 sorted highest to lowest becomes 3,2,12)

is this an openFL thing? is the block not for v3?

Hectate

  • *
  • Posts: 4643
That is standard computer behavior. Each character in a string is compared and then sorted. If you want to sort a "12" lower in a list than a "2" you need to use values like "02" instead.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.