Ask here your questions to get help using GDevelop.
By okbrenners
#65776 Image
I'm sorry but I can't seem to figure out how to save scenes, so that they don't reset. :I

I'm trying to figure out a sort of unlock feature, you buy a worker you've clicked on, and their icon would go to a location and stay there

but when I click to return to the homepage the scene resets, but the variable has been activated still so I can not add it to the slot location again.
User avatar
By MicosS
#65777 Hey!
Not really sure what are you talking about mate, but are you using scene vars or global vars?
At the first look it seems you are using scene vars. But if you want to go through scenes then global vars are the right option.

Im really dont get that "make scene persist" 'cause the moment you have a scene, well, the scene stays there no matter what (unless you make a couple of events in order to change it). :)
By okbrenners
#65778
MicosS wrote:Hey!
Not really sure what are you talking about mate, but are you using scene vars or global vars?
At the first look it seems you are using scene vars. But if you want to go through scenes then global vars are the right option.

Im really dont get that "make scene persist" 'cause the moment you have a scene, well, the scene stays there no matter what (unless you make a couple of events in order to change it). :)


Image
The variable charslot1 is global, and it stays activated when I leave the scene, but when I exit the scene to go to the home scene, the common object(which is global if that matters) returns to its start position, and disappears from where I put it.

By scene persist I meant when I change the scene(move the common object to the slot object) I want it to stay there when I go to home scene.
By okbrenners
#65780
MicosS wrote:Hmmm.
Can you post the .zip or .rar file so i check that out?
Im not the God of GD, far from that really, but i find this very interesting. That .rar or ,zip file, please? :)
Attachments
(5.42 KiB) Downloaded 19 times
By okbrenners
#65782
MicosS wrote:You .zip file is completely useless., noting there...
Are you under Native or Html5?


Sorry about that, I opened it and it worked for me, not sure what that is about :I

Uhm I don't know the difference or how to tell, I literally started using it yesterday and I'm not a coder or anything of that nature. The file is a .json if that helps.
User avatar
By Lizard-13
#65783 GD lets you pause a scene before switching, with the action "Pause and start a new scene". If you use it, the paused scene state will be stored in the memory, then you can use the action to go to the previous paused scene (the action "Stop and go back to previous scene"), the paused scene will be resumed.

EDIT: But for complex scenarios, I think you'll need global variables anyway :|
By okbrenners
#65784 Image
Image
Sorry if double posting is allowed, but I had an epiphany and thought I should update for anyone that is looking for something similar!

I changed my whole way of thinking about this and instead of moving the object decided to make the object already there with layers then activate it with global variables and layers! I feel really silly but I am glad that it works now.
By okbrenners
#65785
Lizard-13 wrote:GD lets you pause a scene before switching, with the action "Pause and start a new scene". If you use it, the paused scene state will be stored in the memory, then you can use the action to go to the previous paused scene (the action "Stop and go back to previous scene"), the paused scene will be resumed.

EDIT: But for complex scenarios, I think you'll need global variables anyway :|


Oh thank you for your reply, Ill see what this can do! I have just been using "change for scene" I managed to get something working for now.