HalfstarDev / matchanovel

A visual novel framework library for Defold.
MIT License
37 stars 2 forks source link

Save write error #3

Closed T-harrison1 closed 3 months ago

T-harrison1 commented 3 months ago

I am experiencing a bug with the save system. When I click save I get this error:

ERROR:SCRIPT: matchanovel/engine/defold/filesys.lua:29: bad argument #1 to 'write' (string expected, got boolean) stack traceback: [C]:-1: in function write matcha novel/engine/defold/filesys.lua:29: in function write_binary matchanovel/defold_gui/images.lua:149: in function save_cached_screenshot matchanovel/defold_gui/menu.gui_script:1220: in function write_save matchanovel/defold_gui/menu.gui_script:1430: in function use_save_slot matchanovel/defold_gui/menu.gui_script:1663: in function input_save matchanovel/defold_gui/menu.gui_script:2120: in function <matchanovel/defold_gui/menu.gui_script:1966>

To reproduce this error, I did this: (on linux ubuntu 22.04): git clone https://github.com/HalfstarDev/matchanovel I opened the game.project in defold 1.8.1 stable I added https://github.com/subsoap/defos/archive/refs/tags/v2.7.1.zip as a dependency (defos) I built the game with ctrl+B while playing the demo, I try to save in the options menu.

I also noticed an issue if I bundle the game for linux. The bundle doesn't show any errors, but if I play the bundle, the game takes me to a black screen after the title screen. I was able to play the demo in the editor with ctrl+B but the bundle doesn't let you play the demo at all.

HalfstarDev commented 3 months ago

Thanks for the report. I fixed this in v0.2.3. Try opening the newest template project with Defold 1.9.0.

For screenshots to work, you also need the extension defold-screenshot, which is already included in the template. I also changed it to just use no screenshot for saving if the extension does not work or is not installed, instead of crashing.

For bundling, you have to add the assets folder to the custom resources in game.project for the bundled game to access them. This is preset in the template project as well, so just use this: MatchaNovel.Empty.Defold.project.English.zip

T-harrison1 commented 3 months ago

Thank you for looking into this. The saves and screenshots are working for me now. I really appreciate it.

I am still having problems bundling the game. Is there another setting that needs to be enabled to get the pictures to show up in the bundled game?

I put the assets from the chloe example project into the assets folder of the template. The game plays correctly when I build it in the editor with defold 1.9.0 and I can see the pictures. In the game.project settings, custom resources says assets. When I bundled game and played it, I see only white backgrounds with the name of the background in the top left corner. Texts appear and are interactive, but none of the sprites or background pictures are showing up.

whiteBundleIssue

HalfstarDev commented 3 months ago

Can you try if this version works? Just replace the old folder /matchanovel with it. matchanovel_fix.zip

T-harrison1 commented 3 months ago

Yes! The bundles work perfectly with this new folder! Thank you so much.