Stencyl 3.4.0 is now out. Get it now!

Attribute Saving [Extension]

yoplalala

  • *
  • Posts: 1392
@ShimieGames
I've updated the extension so that you can delete a field or delete anwhole save file

( the link can be seen by logged in users)

LIBERADO

  • *
  • Posts: 2382
I've updated the extension so that you can delete a field or delete anwhole save file
Great!
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

svintaj

  • *
  • Posts: 283
@ShimieGames
I've updated the extension so that you can delete a field or delete anwhole save file

( the link can be seen by logged in users)

Great work GeorgeN and Yoplalala, thanks!

I can now manage to both save and load an image as well as delete it dynamically, by using the "image as text" and "text as image" blocks in Stencyl.

However I also would like to save and load image "as an image" to get a much greater load and save speed, is that something that someone can add to Yoplalala:s latest version?

Thanks in advance!

svintaj

  • *
  • Posts: 283
Aslo, for each image I save, it takes much longer time to save it, It's like if every image has to be 're-saved'. The same happens when deleting an image, so if I have ten images saved it takes 10 times longer to delete one file? Is there something that can be done to aviod that? I really like to load, save and delete an image as 'one separate unit'. (To be able to save images in a gallery for a painting app)

Maybe there is a better way/Extention? But I need it to work on both Android and iOS?

KramerGames

  • Posts: 404
Pretty wild guess but I read about images not being dumped from memory automatically, maybe this is of help:

http://community.stencyl.com/index.php/topic,50432.0.html

the pre-last post on page 2 by designpeg
Parasites United  (Idle Parasite Game)

svintaj

  • *
  • Posts: 283
Thanks for your help KramerGames, but I dont think its a memory leak in this case.

It's more 'like all images(files) share a SharedObject', even though I specify a unique name for each new image(file) in the 'file name/SharedObject' field?

Hm... can the 'data name' and 'file name'  have been mixed up internally within the block? I haven't tried to swich them around myself yet... but maybe I should, just to see if it works...

My problem is that: Saving takes much longer time for each saved image, the same with deleting images, the more images the longer time. Loading them goes however fast, even if I have a lot of images saved....??

yoplalala

  • *
  • Posts: 1392
Do you need it to work on Flash or HTML 5? The problem  with these platforms is that you need to use a SharedObject but if you only use the other platforms, there should be simpler ways to save an image.

svintaj

  • *
  • Posts: 283
Ok, no I "only" need my app to work on iOS and Android.

So please let me know what ways you are thinking about Yoplalala! I would love to hear how I may save one or more images, without having to save all my GameAttributes at the same time.

( I think I also would like to save the images to the device ordinary 'Camera roll' if it was possible, but I have not find any way to do that on both platforms so far... So I have instead done my own image 'gallery'/'browser' for now, with all saving, loading and deleting based on this useful 'Attribute Saving Extension'... but I have now found this strange sideeffect; that it takes a much longer time to save an image for each image that I save... )

« Last Edit: May 20, 2017, 04:47:34 am by svintaj »

svintaj

  • *
  • Posts: 283
Ok, so then I have a feature request to this Attribute Saving Extension :   8)

-> Could we have a 'Dropdown Menu' in all Save Blocks with the two options to save the file as a 'OneSharedObject' or an 'IndependentSingleFile*?  (For Android and iOS) That would be very usefull, and should totally solve my current issue previously described in this topic.

Also, -> when trying to save a big or many files, the app can crash, so it seems like we also need ~something to check for disk space to prevent such a crash?

« Last Edit: May 20, 2017, 04:50:38 am by svintaj »

yoplalala

  • *
  • Posts: 1392
Hi svintaj ! Sorry I didn't test how to do it. I'm trying Stencyl 3.5 and for now windows and android compiling doesn't work ... so quite difficult to test. Maybe I'll try on some old version.

(http://stackoverflow.com/questions/22630008/save-bitmapdata-bytearray-as-a-png-file)
Maybe this could help.
(image is an attribute of type image ;) )
// Saving the BitmapData
var b:ByteArray = image.encode("png", 1);
var fo:FileOutput = sys.io.File.write("test.png", true);
fo.writeString(b.toString());
fo.close();

svintaj

  • *
  • Posts: 283
Thanks Yoplalala, since we are getting a bit of topic here I decided to move over to a new thread, please see: http://community.stencyl.com/index.php/topic,51520.0.html