Stencyl 3.4.0 is now out. Get it now!

2D List Extension

Tebbo

  • *
  • Posts: 48
Is there a way to go about creating a 2D List as a game attribute?
Sorry if there is a very obvious answer, I'm just getting the hang of using lists and game attributes. A 2D List would be excellent for keeping things organized and cutting down on the amount of redundant work with having many separate lists I just don't quite understand how to utilize it and store it as a game attribute.

Thank you for the extension regardless.

Photon

  • Posts: 2697
Just set the game attribute to the new 2D list. Since a 2D list is really just a list of lists, Stencyl shouldn't have a problem saving it into a list game attribute.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Tebbo

  • *
  • Posts: 48
Just set the game attribute to the new 2D list. Since a 2D list is really just a list of lists, Stencyl shouldn't have a problem saving it into a list game attribute.
Thanks for the quick response.
I've read your posts for stencyl noobs on your blog. they helped clarify a few things!

So should I have an empty list game attribute , lets say named 'mylist'.
Then use,
set [mylist] to [generate new 2d list]
and use your custom blocks to go about constructing the whole list.
effectively naming that 2d list as a game attribute?

edit: Also we should just use the custom block replace entry to set values for each entry? since they're all null by default?

Sorry if this is rudimentary stuff or not the right place to ask.

« Last Edit: May 10, 2014, 05:58:29 pm by Tebbo »

Photon

  • Posts: 2697
Yeah, sounds like you have the right idea. :)
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Toolkitz

  • Posts: 12
Hello,

I've been using your extension and it has been a tremendous help so far, but now I've hit perhaps some kind of bug or maybe I'm not using it right, and that is changing the value of an entry.  I can access every single cell perfectly fine, but using *replace entry at column* does not do anything.  I can't think of anything that I could possibly have done wrong (typed in what I needed, converted numbers to text, used an attribute instead of typing it in, etc.) and the cell never changes attribute. I even tried the command immediately after I created the list and the same results happen, so the cells will always remain null. Is this the only way to change the values or is there anything else I can try?

I attached a capture of what I did. Maybe I'm doing something wrong. Though keep in my mind that I also tried just inputting the coordinates manually and that resulted the same thing.

EDIT: Okay, looks like the command does work as I just tested it on a completely different situation. For some reason it's not working on the situation I previously mentioned.

UPDATE: I finally figured out what was wrong so all is well.

« Last Edit: June 03, 2014, 04:51:04 pm by Toolkitz »

SadiQ

  • Posts: 1715
A Trace list block would have been nice to have based on number of columns and rows :P
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

theabbott

  • Posts: 271
Hey Photon!

I've run into interesting bug seemingly. I'm procedurally generating a grid with X and Y number attributes. I'm using your 2d list extension and in particular the "swap entries at X, Y with X,Y" block and all is well until I make a grid that has a bigger X than Y.

If the grid is 3 by 3 for example the entries in the last column will swap fine, no problems. However as soon as you go bigger than Y; so 4 by 3, or 7 by 3 for example, every entry in a column bigger than Y will stop swapping.

I've populated a 2d list with random numbers and you can hit enter to swap the first two entries in each column. It works fine while X<=Y  but once you make a grid with X>Y the last column will no longer swap entries. Can someone help me with this? Any suggestions on why this is happening? I've attached the test below for you to play with and hopefully give me some advice.

Thanks!

Tebbo

  • *
  • Posts: 48
Is there a typo of sorts in the wording of the blocks?

The situation:
I'm making a 2D list. Using 'generate a new...' which lists ROWS then COLUMNS (Y, X). so I put in 15 rows, 10 columns (should give me a 10x15 grid). I get the reverse, a 15x10 grid.

Alright no biggie, I just switch the values and get what i'm after. Simple.

I set two attributes, one X, one Y.
Using 'get entry from...' (which is column, row order) I insert those values... Does not get the entry I want. I switch them, works as expected.

I noticed that the wording order of the blocks changes around but the code in preview code does not (i assume it always goes X, Y since its just being recorded as std.int)

It's kind of like everything was turned once clockwise.  Rows become columns but X and Y are still X and Y. Has anyone else experienced this?

LIBERADO

  • *
  • Posts: 2253
Hey Photon!

I've run into interesting bug seemingly. I'm procedurally generating a grid with X and Y number attributes. I'm using your 2d list extension and in particular the "swap entries at X, Y with X,Y" block and all is well until I make a grid that has a bigger X than Y.

If the grid is 3 by 3 for example the entries in the last column will swap fine, no problems. However as soon as you go bigger than Y; so 4 by 3, or 7 by 3 for example, every entry in a column bigger than Y will stop swapping.

I've populated a 2d list with random numbers and you can hit enter to swap the first two entries in each column. It works fine while X<=Y  but once you make a grid with X>Y the last column will no longer swap entries. Can someone help me with this? Any suggestions on why this is happening? I've attached the test below for you to play with and hopefully give me some advice.

Thanks!
Confirmed. The "swap entries..." block does not work properly in the situation you describe.
Let's hope this bug does get fixed.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Exportforce

  • *
  • Posts: 90
Is there a way to edit the lists "visually" ?
Meaning in an overview you would have in an excel sheet?

cloa513

  • Posts: 245
It be great if you could convert a normal list to a 2D List say using the comma as separator. I am trying to do it now but it not working right.  Then you could use the inbuilt List Management upload tool to manage the data.


« Last Edit: January 26, 2016, 02:05:47 am by cloa513 »

Rainbros

  • *
  • Posts: 171
How do I fix the following error?

/My Stuff/stencylworks/engine-extensions/2DList/List2D.hx:70: characters 10-14 : On static platforms, null can't be used as basic type Float

I tried looping through the list and changing every entry to something other than null, but it didn't help.

Looks like this extension hasn't been updated in a while, is everything working correctly?

gjturner01

  • Posts: 1
Can't find link to download 2D List Extension.  Thank you.

LIBERADO

  • *
  • Posts: 2253
Can't find link to download 2D List Extension.  Thank you.
At the end of the first post, in the first page of this thread.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

tomiello

  • Posts: 3
Photon, great job on the 2D array.  I need to dump my LIST to a text file, then retrieve it. I've looked through the blocks and searched info files.  no luck.  Pls help.
l