Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Read File #188

Closed
bojjenclon opened this issue Jul 11, 2018 · 6 comments
Closed

Read File #188

bojjenclon opened this issue Jul 11, 2018 · 6 comments

Comments

@bojjenclon
Copy link

Is it possible to read a file from a game? There's JSON parsing support, but it seems the fs global isn't available from a cart, so loading an actual JSON file doesn't seem possible (unless I'm missing something).

@Rami-Sabbagh
Copy link
Collaborator

The JSON api is intended for game saving

@Rami-Sabbagh
Copy link
Collaborator

Rami-Sabbagh commented Jul 11, 2018

And yeah, DiskOS environment is different than games environment

@bojjenclon
Copy link
Author

Are there any workarounds for that, or will it simply not be supported? I've been enjoying using LIKO-12 as a means of quickly throwing together ideas, but I'd prefer to have some data about entities remain external so as to not clutter my main code file too much, hence the JSON. I totally understand if you don't intend to support it at all given the nature of the fantasy console, but even if there's a somewhat "hackish" way around it I'd be willing to load files in a less than conventional way.

@Rami-Sabbagh
Copy link
Collaborator

Rami-Sabbagh commented Jul 11, 2018

There's a way, you can use multiple code files,
There's a function called dofile, dofile("D:/mygameScript.lua")

So place your JSON in a code file:

JSONDatas["Player 1"] = [[
{}
]]

@bojjenclon
Copy link
Author

Awesome, that should work! Thanks, I'll go ahead and close this.

@Rami-Sabbagh
Copy link
Collaborator

Thanks for closing it, feel free to use discord so you can have faster answers from me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants