Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmem command with HTML exports? #1148

Closed
Gate88 opened this issue Aug 21, 2020 · 6 comments
Closed

pmem command with HTML exports? #1148

Gate88 opened this issue Aug 21, 2020 · 6 comments
Assignees
Labels

Comments

@Gate88
Copy link

Gate88 commented Aug 21, 2020

Is the pmem command supposed to save state in a browser, or does it only work when doing executable exports or running the cart? I can't seem to get pmem to save between sessions on itch.io, nor when accessing the html export locally.

(This is with a recent dev version -- looks like 0.80.1276-dev).

@nesbox
Copy link
Owner

nesbox commented Aug 22, 2020

pmem supposed to save state in a browser, do you see any errors in the browser console?
Thanks

@Gate88
Copy link
Author

Gate88 commented Aug 23, 2020

I'm seeing this in both Firefox and Chrome. I could make a minimal cart and you could check if you're having the issue too.

image

@Gate88
Copy link
Author

Gate88 commented Aug 23, 2020

Here's a working example of the issue -- the value should increment every time you view the page, but it doesn't.

https://gate.itch.io/tic80-workspace
pass: pmem-test

code:

-- script: lua
-- saveid: tic80_pmem_browser_test

pmem(0,pmem(0)+1)

function TIC()
 cls(0)
 print("You've viewed this cart "..pmem(0).." times",40,60,12)
end

@Gate88
Copy link
Author

Gate88 commented Aug 28, 2020

@nesbox - lmk if you can't reproduce. Seemingly happens w/ any browser & any cart I try in this version.

@nesbox
Copy link
Owner

nesbox commented Aug 28, 2020

I think I know the reason, all the file I/O operations are asynchronous in the browser, we have to wait for the end of file writing somehow...

@nesbox nesbox added the bug label Aug 28, 2020
@nesbox nesbox self-assigned this Aug 28, 2020
@nesbox
Copy link
Owner

nesbox commented Aug 29, 2020

Fixed here 111d092.
Thank you for the report.

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

No branches or pull requests

2 participants