Ask here your questions to get help using GDevelop.
By Game Developer
#68666 I am making a HighScore game so that's why I need to know how to save variables in Native Games. I already saw some tutorials and followed it but it never worked but when I tried it on a WebGL Game the score just saved and loaded successfully!
So in Native Game the HighScore successfully saves in an XML file but it can't be loaded again in the Game.
I think that when I save it multiple times and edit the XML file with Notepad, I can see multiple Groups with same name that's why the Variable not loading...
Please help me to save and load variables successfully. If you can give me a example, that would be so good!
Note: If you are creating the example please use version 3 because I have 32-bit window so can't install GDevelop 5 :P
User avatar
By Lizard-13
#68671 Wow, version 3 !?, GD 4 has support for 32 bits, and you can compile GD 5 yourself to get a 32 bit version ;)

Check if the group you're using start with a number, the bug was discovered here: http://forum.compilgames.net/viewtopic.php?f=19&t=9876
And reported here: https://github.com/4ian/GDevelop/issues/479
But no solution so far, and probably there won't be, as GD 4 is being discontinued :(
By Game Developer
#68691 How to compile GD 5 for 32-Bit??? But anyways I am using version 3 because 4 just freezes when I open "Scene Editor".
The group is named as "1". Everyone names it like this! And it works for WebGL games and not for Native Games. Why???
I created a new project for WebGL and Copied the exact scene and pasted it on the WebGL game... Then how's this possible... I think that it can't load the file easily and it creates more than 1 groups with the same name,"1". :? :? :?
User avatar
By Lizard-13
#68695 If you follow the link to the GitHub issue you'll see that we suspect it's a problem from the XML parser, it does not affect web games because JSON is used instead XML.

Note that groups names are dynamic strings, if you name your groups “g1", "g2", "g3", etc instead "1", "2", "3" you can access them as easy as before, if right now you're doing something like:
Code: Select allToString(Variable(group_index))

you can do:
Code: Select all"g" + ToString(Variable(group_index))

And as "gN" groups don't start with a number you won't face the bug :)
By Game Developer
#68903 Here is the example:
Texte caché : cliquez sur le cadre pour l'afficher

https://drive.google.com/open?id=13H477-j6Acg0ti-uJDeteH1Ss1YdGVhB

Please help as soon as possible!!! :P
User avatar
By Lizard-13
#68915 Here, as I explained just change the group "1" by "g1" (for example, anything that doesn't start with a number works).
Also, it seems that the file must contain an extension, any extension, so I've renamed the file "Highscore" as "Highscore.sav", you can use "Highscore.txt" to be able to open easily with a plain text editor :)
Attachments
(22.37 KiB) Downloaded 11 times