How do I deal with errors in Tutorial Arrays for Beginners?

Get help using Construct 2

Post » Wed Oct 07, 2015 9:40 pm

I'm stuck on a tutorial by ramones. It is titled, "Arrays for Beginners".

It is an excellent tutorial, however, just when I was getting to the place that I wanted to be: json, the examples stopped working.

After searching hard, I find that the older webstorage (ramones tutorial) has now been replaced with a localstorage api. The items in the action parameters have changed. The json piece based on loading and saving isn't working for me.

I've looked at other localstorage tutorials, but haven't found one that makes the sense that ramone's does. In fact, I was FINALLY getting the idea.

Can anyone give me a hand in understanding how to complete the tutorial successfully? The manual just doesn't make things clear enough for me to understand.

Is there a way to use webstorage rather than localstorage? I don't need to save lots of data. From what I've read, many others would welcome that as an option.

Here is where I am stopped in the tutorial:
https://www.scirra.com/tutorials/307/arrays-for-beginners/page-3

Pulling hair out and feeling disappointed...
TIA -Just4Fun
B
6
S
1
Posts: 21
Reputation: 822

Post » Wed Oct 07, 2015 11:30 pm

Here you go:
https://mega.nz/#!kAxBQRTJ!ZqM9eHA0R-q4 ... lPRiPPXQFA

Look for the Enter key, and the Click on the save button action to see how to load a string. With the demo running type anything in the box, and enter or click save to make a few keys.

Rightclick will show you how to delete the keys, right click on the list to see how to delete the keys durring runtime.

Sorry it is not a custom example, but it should help you.

If you wanted to use my example to save a JSON look for where it says "Some random text I entered", you would put the Array json there, without any quotes.

Hope it works for you, you will see how to make a quick LSD system (Load Save Delete).

Remember also, you can make a "Save array" which you can load with other arrays, so you only have to save and load 1 string.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Thu Oct 08, 2015 12:15 am

jojoe,

Thank you again! I just downloaded your kind help file. I will take a look right away. The tutorial that you recommended was/is excellent. Wish someone would update it for the current localstorage api. It was understandable and took me quite a ways into arrays.

-Just4Fun
B
6
S
1
Posts: 21
Reputation: 822

Post » Thu Oct 08, 2015 12:26 am

No problem! here is anoother tutorial about arrays showing you a sweet trick to instantly draw a sprite matrix on the screen.:
https://www.scirra.com/tutorials/360/ge ... m-tile-map


Great if you want to make a nice level editor for a tile based game or whatever.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Thu Oct 08, 2015 7:06 am

Ok @Just4fun

https://mega.nz/#!8Ngi3QyZ!iAa_Zv5_wGLz ... 0SNdNWMKOM

Try hat... I think that is what you are after. added the event 17, and tweaked where he had a webstoreage save.

You need to use a local storage OnLoad condition to load the array with whatever the button requested.
https://mega.nz/#!8Ngi3QyZ!iAa_Zv5_wGLz ... 0SNdNWMKOM

Be sure to check out the manual about local storage, It really is great. Ashley goes over just about everything you will need.

sorry for the Delay :/
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests