(08/23/18) CHANGED THE TOPIC TO "PICO-8: SUPPORT"
Was just trying out my Haunted House game as a Windows EXE. Although making high-score, it did not appear in the scoreboard. This is odd because score is kept when it's played either in HERE or as a raw HTML.
Here is the code:
if debug==0 then reload(8192,8192,180,"_hauntedhouse_dw817") end if peek(8192)+peek(8193)==0 or peek(17152)==254 then str2mem(defhs,8192) cstore(8192,8192,180,"_hauntedhouse_dw817") end |
Can someone confirm this on their own games that save data ?
Update. Apparently when running the windows EXE compilation, this is only affecting commands RELOAD and CSTORE. The standard CARTDATA, DSET, and DGET do work correctly, as tested in "Pico Monsters."
So it will need to be for a cart that needs to store more than 256-bytes. I am doing this in my Easy Notepad program. It saves if you run it here or from itch, but not as a single EXE or even directly in the IDE from P8.
Found problem, partial.
RELOAD and CSTORE do not work if you load the game from "SPLORE."
If you save the game proper to your HD, REBOOT, load it, then run it without SPLORE, the save and load of RELOAD and CSTORE work just fine.
...
Confirmed ! Found problem - complete.
RELOAD and CSTORE do not work at all when you EXPORT to EXE and try to run it from there, either if you originally loaded it from SPLORE or off your HD. Both do not work.
Yes, this is an error that needs fixing.
CARTDATA(), DSET(), and DGET() do work if compiled to EXE. Not sure where the save data is being stored and read from though as it does not appear in the EXE directory.
Good morning !
Yep, it's worse. I went ahead and used the EXPORT to HTML to test. If you run the program locally, like this:
file:///C:/David/Games/Pico-8/pico-8_win32/ROMs/Easy%20Notepad.html/easy-notepad.html
Then RELOAD and CSTORE also do not work correctly.
So ... to recap, RELOAD and CSTORE only work for =2= instances:
[1] If your P8 App is truly Online
[2] If you run it from the P8 GUI and the P8 App is also stored on your hard-drive. You must have both.
It will not work:
[1] If you convert it to EXE
[2] If you convert it to local HTML & .JS
[3] If you try to run it from SPLORE.
I'll experiment further, but if [1] and [2] cannot be repaired - then that's going to seriously curb my ability to write what I planned:
[1] An in-house programming language
[2] A RPG Maker
[3] A Platformer Game Maker
[4] A Board Game Maker
And if I can't write these ... I may need to consider another programming language for them. :(
Taking a break from programming until something positive appears.
Exported carts are read-only so they can run in limited environments. So yes, cstore is disabled in those cases. Similarly, Splore can at any time load the cart fresh from its source (it isn't obligated to preserve its local cache), so disabling cstore makes more sense to me than having it work intermittently. I wouldn't want a Splore arcade box in a public space to be able to run carts that can modify themselves or others. Cartdata is an exception, but it's an intentionally small one.
(Do consider cartdata for high scores in your Haunted House game. That's an intended use case.)
https://pico-8.wikia.com/wiki/Cstore
https://pico-8.wikia.com/wiki/Cartdata
You have the right intuition that cstore is motivated by an interest in on-platform dev tools. These are intended to work with the Pico-8 dev environment, where the user can manage local files. An RPG/platformer/board game maker could store all of its user data in addressable regions of cart files. It could persist the user data in its own cart or a separate cart, or with some external tooling you could create/update user carts with the player engine code. (You can't update cart code from another cart, because code lies outside of addressable space.) The user could then export that result to a standalone executable, if desired.
As for language interpreters, there have been several custom languages and IDEs implemented on Pico-8 so far, mostly as tech demos. I don't recall if any of these can store their programs in cart files, but it's entirely feasible, as long as the data can be encoded as bytes and fit into the addressable space. I suspect the experiments so far keep programs in Lua memory, which doesn't translate directly in format or size.
For completeness: reload works in exported carts. You can export up to 16 carts in a single bundle and use reload to pull data from them. They're just read-only.
Dddaammnn ... no, not at you. At the situation.
Well that bites. The main reason I'm back working in PICO is 3-reasons.
[1] It's super-fast for pixel work.
[2] A true EXE can be made.
[3] I remembered that PICO could load and save 8192-bytes of data, more than enough for my big projects.
A 4th bonus reason would be, and not very successfully, to compile to APK. I suspect even then that CSTORE will not work.
And yes, I was toying with re-releasing "Haunted House as "Mildew's Mansion" where the High-Score uses standard DSET().
Also send an update to those customers who bought it in ITCH. It would only be fair to them. Naturally I would post it here, too.
Last night I was toying with building (at least on paper) a 256-byte RPG Maker. Hah ... yeah, that doesn't sound very good ...
What a disappointment about CSTORE ... 😩
BIG THANKS for letting me know where the situation stood though, D. I was totally in the dark on its availability.
To be fair, none of this is mentioned in the manual as far as I can tell - perhaps it's worth adding a note there.
edit: the wiki does cover it, but it's not usually my first point of reference.
There are actually quite a few things not mentioned in the PICO manual. It takes a basic understanding of the LUA programming language to know the fine details, and I certainly didn't know them.
But don't think those 2-commands stood out. I found out about them accidentally myself and persisted in learning how they worked.
https://www.lexaloffle.com/bbs/?tid=31613
https://www.lua.org/manual/5.3/
Your link is still attempting to load, Tobias. But yes, I'm familiar with CSTORE. Is what I was working with for several hours this morning so my game could finally retain high scores.
To see a working (or to put it more succinctly) a NON-working example of CSTORE, go HERE:
https://www.lexaloffle.com/bbs/?tid=31613
Hope to see you when I finish my next cart, a good old-fashioned monster hunt !
[Please log in to post a comment]