Help again with editor

For questions about using Classic.

Post » Thu Oct 18, 2012 6:02 pm

Hi, i'm here again
i have again problems with arrays.
i tried many ways, but i don't know hoe to do a "save"
in my editor :/
Help needed!

here is the .cap : http://www.multiupload.nl/6J865YMA82
B
5
Posts: 22
Reputation: 494

Post » Thu Oct 18, 2012 6:16 pm

There's a whole bunch of good examples in this thread here:

http://www.scirra.com/forum/help-saving-level-data-in-an-array_topic41705.html

Basically there is a command to "save array to file" and "load array from file." It's all a matter of how you want to do it UI wise and any differences in how you've made it. For example, before I load my array I have some map properties stored in a hashtable that I load, and I resize the map first too.

Those examples should get you started.

B
7
S
2
Posts: 123
Reputation: 1,061

Post » Fri Oct 19, 2012 3:21 pm

Thanks, but this didn't solved my problem. :/
i have in ma cap this:

but when i click on load, it just destory the objects, but it didn't
load the objects.
btw i changed the .cap
http://www.multiupload.nl/3GXFTNEL9R
B
5
Posts: 22
Reputation: 494

Post » Fri Oct 19, 2012 4:17 pm



Change your load event to this. seemed to work for me.
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Fri Oct 19, 2012 4:19 pm

On second look it seems to be loading the array fine, but that doesn't necessarily match up with what was on the screen.

I think this may be due to your event that sets the array based on the mouse?
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Fri Oct 19, 2012 7:08 pm

Yeah, i did it like in the screenshot and it don't works.
Can you please upload me your array file? i'll be really happy.
I'm not sure, because the basic sytem of mouse and animation comparing
with hashes did someone other in a tutorial.- i just remade it.Frantataa2012-10-19 19:09:08
B
5
Posts: 22
Reputation: 494

Post » Sat Oct 20, 2012 2:37 am

My example worked fine for me, it just seemed to save the arrays slightly off. Let me take a look at it later and see if I can fix the rest.
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Sat Oct 20, 2012 5:10 am

Ok so this one seems to work now.

If my screenshot didn't work for you it's probably because you forgot to move "For Each Element" on top of the condition that cycles through the array.

The only other change I made other than the screenshot is that instead of just spawning objects at CurrentX * 32 and CurrentY*32 I made it CurrentX * 32 + 16 and CurrentY * 32 + 16.

I believe this to be necessary because the sprites are recreated from their center. If you leave the + 16 out then on loading they will appear in a slightly different spot then when you saved them.

I've saved the working cap to my dropbox... Hope this helps:

https://dl.dropbox.com/u/69407974/Saving%20and%20Loading.cap

B
7
S
2
Posts: 123
Reputation: 1,061

Post » Sat Oct 20, 2012 6:09 am

Oh! thanks a lot!
i'm really happy.
B
5
Posts: 22
Reputation: 494


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests