Stencyl 3.4.0 is now out. Get it now!

External Data Extension [1.6.1]

yoplalala

  • *
  • Posts: 1389
why don't you use the save and game blocks ?

MichaelPel

  • *
  • Posts: 456
why don't you use the save and game blocks ?
I actually have no idea how they work and when they should be used : D
But the reason I'm asking is, I want to be able to copy a save file on anoher non-mobile project I'm working on.

ETHproductions

  • *
  • Posts: 405
@MichaelPel: On mobile, the "save text" and "save image" blocks save the data to the app's folder in the user's directory (the same place where assets from the "extras" folder are stored). It can be loaded with the "load text" and "load image" blocks even after the app is shut down and restarted. I'm not sure whether the data is deleted even when the app is uninstalled.

But the reason I'm asking is, I want to be able to copy a save file on anoher non-mobile project I'm working on.

I'm not sure I understand. Do you have saved data on a non-mobile device and you want to move it to a mobile device? Can you please elaborate?
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

MichaelPel

  • *
  • Posts: 456
@MichaelPel: On mobile, the "save text" and "save image" blocks save the data to the app's folder in the user's directory (the same place where assets from the "extras" folder are stored). It can be loaded with the "load text" and "load image" blocks even after the app is shut down and restarted. I'm not sure whether the data is deleted even when the app is uninstalled.

But the reason I'm asking is, I want to be able to copy a save file on anoher non-mobile project I'm working on.

I'm not sure I understand. Do you have saved data on a non-mobile device and you want to move it to a mobile device? Can you please elaborate?
Ah, sorry for being vague! I was hoping to be able to save the game progress to something like a .txt so it can be edited by a player or transfered from one computer to another. Examples include settings and preferences.txt, procedurally generated world data.txt and player save.txt

ETHproductions

  • *
  • Posts: 405
Oh, that makes sense. This would be possible, but you'll need to save all necessary data into text files with the extension's "save text" block (not the built-in "save game" block). Then you will need to build a system to load the files with the extension's "load text" block, and use the data to dynamically change the game (set game attributes, for example). Now the data files can be freely copied from one device to another, as long as the other device has the same game installed. (It may be easiest for the player if everything is stored in one specific file or folder.)
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

MichaelPel

  • *
  • Posts: 456
Oh, that makes sense. This would be possible, but you'll need to save all necessary data into text files with the extension's "save text" block (not the built-in "save game" block). Then you will need to build a system to load the files with the extension's "load text" block, and use the data to dynamically change the game (set game attributes, for example). Now the data files can be freely copied from one device to another, as long as the other device has the same game installed. (It may be easiest for the player if everything is stored in one specific file or folder.)
Yes, of course. I already have a simple system that saves game data to a listmap (don't remember what they're called), and is also able to load from it. It works flawlessly, so can I simply save that maplist as is?

ETHproductions

  • *
  • Posts: 405
I honestly don't know what will happen if you save a non-string attribute with the "save text" block. I think it'd need to be converted to a string first, and of course, the loaded result will also be a string. If you're using a Map attribute, you could try saving it in this format:
Code: [Select]
key1:value1
key2:value2
key3:value3

You could then reconstruct the map by splitting each line at ":", and setting the corresponding key to the corresponding value.

I could make a couple of blocks to make it easier to save and load data types other than text. Would that be useful to you?
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

MichaelPel

  • *
  • Posts: 456
I honestly don't know what will happen if you save a non-string attribute with the "save text" block. I think it'd need to be converted to a string first, and of course, the loaded result will also be a string. If you're using a Map attribute, you could try saving it in this format:
Code: [Select]
key1:value1
key2:value2
key3:value3

You could then reconstruct the map by splitting each line at ":", and setting the corresponding key to the corresponding value.

I could make a couple of blocks to make it easier to save and load data types other than text. Would that be useful to you?
I would love you even more.

smhsht

  • Posts: 1
I have tried many times to download the extension, but it seems the link is broken or I have problem with bitly link shortner. Could you please give me another link to the extension?
PS: Problem solved by using vpn

« Last Edit: July 26, 2016, 10:04:49 am by smhsht »

FMStudioGameDev

  • *
  • Posts: 125
Hello,
did anybody find a solution for the HTML5 issue? I am talking about the 'convertToPseudoUnicode' function not working.

Thanks

FMStudioGameDev

  • *
  • Posts: 125
The save .png block is not working on iOS.
Could it be related to iOS 10 that now requires to ask permission to access private data?

Testing on Simulator I got this
Code: [Select]
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CallKit.CallDirectory[23039]: [Default] Error migrating store: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/CallDirectory, NSUnderlyingError=0x7fb131500b30 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CoreSimulator.SimDevice.DCADEAA9-2D9B-458F-BFF8-442146036550.launchd_sim[22808] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CallKit.CallDirectory[23039]: [Default] Unable to initialize CXCallDirectoryStore for reading and writing: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/CallDirectory, NSUnderlyingError=0x7fb1314103f0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
[iOS] Mar 20 01:28:09 77-240-12-1 callservicesd[22883]: [Default] Error synchronizing call directory extensions: Error Domain=com.apple.CallKit.error.calldirectorymanager Code=0 "(null)"

Any help?

FMStudioGameDev

  • *
  • Posts: 125
Sorry for bumping this, can anyone let me if the Save .png block works on iOS?
I was building my whole game around this feature...
Thanks


The save .png block is not working on iOS.
Could it be related to iOS 10 that now requires to ask permission to access private data?

Testing on Simulator I got this
Code: [Select]
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CallKit.CallDirectory[23039]: [Default] Error migrating store: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/CallDirectory, NSUnderlyingError=0x7fb131500b30 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CoreSimulator.SimDevice.DCADEAA9-2D9B-458F-BFF8-442146036550.launchd_sim[22808] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit
[iOS] Mar 20 01:28:09 77-240-12-1 com.apple.CallKit.CallDirectory[23039]: [Default] Unable to initialize CXCallDirectoryStore for reading and writing: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/CallDirectory, NSUnderlyingError=0x7fb1314103f0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
[iOS] Mar 20 01:28:09 77-240-12-1 callservicesd[22883]: [Default] Error synchronizing call directory extensions: Error Domain=com.apple.CallKit.error.calldirectorymanager Code=0 "(null)"

Any help?

Dincicode

  • *
  • Posts: 189
Ok so the text reading and editing works on MACs. But unlike on the PC for some reason MACs don't allow the creation of new .txt files. This is only my experience on my friends  MAC, so it might not be the same for other people.

« Last Edit: June 14, 2017, 07:05:08 pm by Dincicode »

BMJ

  • *
  • Posts: 273
First - thank you for this extension!

I am making a desktop game and I am trying to use this extension to allow the player to save/load multiple games. I am having difficulty with the save text to file block.  I get the expected sound FX for "save successful" but no such file appears in my game's extras folder. This is a PC, and I'm using build 9328. See attached PNG for what I mean.

EDIT: I am using Cppia for testing -- I found the file ... it was saved to the following location:

C:\Users\Admin\AppData\Roaming\Stencyl\stencylworks\games-generated\SOB Aug 18\Export\cppia\assets\data

Is that supposed to happen?

EDIT #2: It seems to be writing/reading just fine, despite this file location ... but I haven't tried it on a full export yet.

« Last Edit: August 20, 2017, 06:43:11 pm by BMJ »

giordano

  • Posts: 55
Hi, I would like to know if there is a way to save images on a different path instead of extras. I'm asking this because I need to re-use these images on other different games. Thank you

« Last Edit: September 05, 2017, 02:06:15 am by giordano »