How to open a scene from system.DocumentsDirectory?

I’m trying to setup an app where the users may buy additional scenes with “in-app purchases” transactions.
So after the user finish the transaction, the scene is downloaded from the internet and saved into the system.DocumentsDirectory, where my storyboard should load them.
I’ve tried to load a test scene that I manually saved in the documents folder, but the simulator outputs a path related error, because I cannot use slashes in the path, and if replace the slashes with dots the path becomes invalid… seems like a dead end.

Can anyone cast some light on me? [import]uid: 123238 topic_id: 33290 reply_id: 333290[/import]

Are you trying to put lua files in the documents directory and then use them, because that won’t work [import]uid: 8697 topic_id: 33290 reply_id: 132262[/import]

yeah, that was what I was trying to achiev :confused:
Any suggestion to work around that?
[import]uid: 123238 topic_id: 33290 reply_id: 132266[/import]

Nope, the Lua is compiled into the app so the Lua files don’t exist in the final build. [import]uid: 8697 topic_id: 33290 reply_id: 132267[/import]

I was afraid of something like that!
HOW can I download additional programmatic content to the users?
If I can’t read LUA files, How can I achiev this?
I’m truly lost! and somewhat disappointed. [import]uid: 123238 topic_id: 33290 reply_id: 132268[/import]

Corona does this because Apple prohibits the downloading of code in iOS apps. No dynamic linking, no downloadable Lua, etc… This is prevents you from opening up a nasty hole in your app, where someone could replace your file and basically modify anything they want within your game.

You can update your app, so that the code is already in the build, but once the user pays, you unlock it’s use. You can do the unlocking a number of ways, and can even download JSON data from the server that would be required to load the level (e.g. enemy and tile positions are in a downloaded JSON file, even if all enemy code is in the build, or you download all assets when unlocking the purchase, since the level can’t load without those assets).

Ideally, you can split up your data and logic for your levels so that the logic is there, but the data is downloaded. This gives you the best post-release extensibility, because you can take what you have in the build and continue to construct all kinds of levels by simply adding new level data files, and image assets, leaving version updates to add new game logic. [import]uid: 134101 topic_id: 33290 reply_id: 132274[/import]

Thanks for the explanations Ntero, it really cleared my mind, and makes perfect sense.
I had already thought of that approach of splitting data and logic… I guess I was trying to run away from building an extensive “custom-logic-library” that do not restrain me in future releases.
But since there is no other way to do it… I’m already on it!

Thanks all [import]uid: 123238 topic_id: 33290 reply_id: 132275[/import]

Are you trying to put lua files in the documents directory and then use them, because that won’t work [import]uid: 8697 topic_id: 33290 reply_id: 132262[/import]

yeah, that was what I was trying to achiev :confused:
Any suggestion to work around that?
[import]uid: 123238 topic_id: 33290 reply_id: 132266[/import]

Nope, the Lua is compiled into the app so the Lua files don’t exist in the final build. [import]uid: 8697 topic_id: 33290 reply_id: 132267[/import]

I was afraid of something like that!
HOW can I download additional programmatic content to the users?
If I can’t read LUA files, How can I achiev this?
I’m truly lost! and somewhat disappointed. [import]uid: 123238 topic_id: 33290 reply_id: 132268[/import]

Corona does this because Apple prohibits the downloading of code in iOS apps. No dynamic linking, no downloadable Lua, etc… This is prevents you from opening up a nasty hole in your app, where someone could replace your file and basically modify anything they want within your game.

You can update your app, so that the code is already in the build, but once the user pays, you unlock it’s use. You can do the unlocking a number of ways, and can even download JSON data from the server that would be required to load the level (e.g. enemy and tile positions are in a downloaded JSON file, even if all enemy code is in the build, or you download all assets when unlocking the purchase, since the level can’t load without those assets).

Ideally, you can split up your data and logic for your levels so that the logic is there, but the data is downloaded. This gives you the best post-release extensibility, because you can take what you have in the build and continue to construct all kinds of levels by simply adding new level data files, and image assets, leaving version updates to add new game logic. [import]uid: 134101 topic_id: 33290 reply_id: 132274[/import]

Thanks for the explanations Ntero, it really cleared my mind, and makes perfect sense.
I had already thought of that approach of splitting data and logic… I guess I was trying to run away from building an extensive “custom-logic-library” that do not restrain me in future releases.
But since there is no other way to do it… I’m already on it!

Thanks all [import]uid: 123238 topic_id: 33290 reply_id: 132275[/import]