(Solved) Some things don't work in web/android

Hi guys, i just pur my project into some web space and in my android mobile and there are some mistakes:

1.- It doesn’t save/load…
I’m making it through save a value on a line in the a file “save.txt” in the root, and then read it, it was working perfectly in the preview, but not in the web or android… Also create a “save.txt” file in the root by my own but it doesn’t make any difference… Do i have to try with JSON method or there is a solution?

2.- The sound doesn’t stops in Android, it does in the web when i finish the stage, or i push select stage or start again (you can try my game it’s in my signature). Of course i just use the action “stop music of chanel X” i suppose it’s the only way…

3.- How could “Exit” really quit the game, i make a text object with the text “Exit” and make the action “Quit the game” but it doesn’t close the app on android, just stops the game… What the correct action to close the app/window?

4.- This is just curiosity… Why the music sometimes doesn’t starts “at the beginning of the scene” i think it could be because my computer is a big shit… but my mobile is good and it’s also happening there… :cry:

And also if you wanna tell me something about the game i’ll be glad to hear you, you can do it in this post: Proty - Platform puzzle game

About the point 2, i think that when i push Butrón i make stop muaic, and when starts again, it plays the music x2. I’ll check it

Storage actions uses the webstorage HTML5 feature to store the data. It’s a storage that is not really a file because HTML apps can’t read files from the local system (for security reasons).

So what’s the solution to save/load the game :cry: :cry: .
I spend a lot of time trying to save/load and now it’s useless? :frowning:

It’s not useless. The save/load works and doesn’t use a file but the webbrowser internal storage…

But it’s not working on the web nor on the android, only in the preview of the game…
I don’t see the utility, it has to be changed somewhere

Solved adding a javascript text as subevent of the conditions:

Touch or left button mouse is donw
Thec cursos/touch is on "exit" (my text object)

It’s not really working on the web, but it doesn’t matter, android is where the biggest problem was.

1 Like

Changing the action code

  • Pause and start a new scene “X”
  • Change for scene “X”

Make me correct the mistake for the button select stage, still the problem of “start again” because it stays in the same stage… will try something diferent :smiling_imp:

Well, checking everything, to be correct:

  • The save/load process is not working on the web, it’s working on android.
  • The audio problem only exists in the mobile, it doesn’t matter if you are using android or web, if you are using the mobile, there’s the sound problem, if you are in the web with a computer, there is no error… :confused: :confused:

Try this project for the save/load system:
storage.zip (4.23 KB)
I have tested and it works in Firefox, Chrome, IE and also on Android, Windows, and Linux.

And try this project for the sound:
sound.zip (1.39 MB)
Different places different formats required. In this project you can try mp3, ogg and wav to see which one works and which one does not.

Everything working +/- XD.

1.- Everything it’s clear about save/load again finally, i don’t know why but was giving problems the “erase the line” (not the file) from the file where you are saving and then save, just remove this action and everything working.

2.- TO ALL OF YOU WHO WANNA EXPORT TO ANDROID. Don’t activate the music of the game with the condition “At the begining of the scene” a lot of times will play it double and sound very bad, the solution, create a timer for example “music_timer” and set the condition “If music_timer is greatest than 0.1s” action “play music song.ogg in channel x”

3.-To close the game in android ALL OF YOU gonna need a javascript window.close.() if not, is not gonna close it, that’s something i really think must be corrected in the own program gdevelop. Because quit game only freezes the game, if the owner of the mobile or any other device doesn’t know how to go out you are f****d… So… Add a condition like “touch this object” “push this text” whatever, and then create as a sub-event the javascript code, you’ll need to conserve the “currentScene” code to use it, you’ll see if you use it :wink:

4.-… Still don’t know why sometimes (always) starts the music later the first time you play… later it works perfectly… will see in other post :confused:

Thanks for your help friends.