I made this extension because people have been having issue with the in-built save state extension. The in-built extension is marked as experimental and Gdevelop hasn’t seem to slow down to finish it. So I used some functions in Gdevelop that were already there to implement some basic things like Delete and Checking if a save exists and then duplication for advance save systems.
Thanks a lot for doing this. I was wondering if it might also be possible to fix the stick and link issue, since after a reload one ndof the two stops working…
like you mostly do stick and link at an object creation event with a trigger once..and after savestate load…the sticking is lost.
i’m not at my main pc rite now..but if i remembver well to replicate.
It happens when you creat an object dynamically to stick to an object already present in the scene.
In the link and stick event (I believe a trigger once is needed there). Make the object stick so it follows the target. After a reload, something is left behind and the link? (probably) stop working…but in the end i would also check the sticker.
i believe bcs postevent at reload some infos are left behind
Can replicate this? Checked the code and it seems fine. What exactly causes sticking to be lost and is it Linked Object or Sticker extension you’re refering to.
This is usually how I create and stick and link objects.
ojects are created dynamically, i mean they’re not in scene until created.
In this case it happen in one delta bcs i set back the var ITEM.COUNT to 1
Here’s a video showing the issue:
during the loading process, the attachment/link is lost. It’s not just the menu that’s affected,the enemies’ HP bars are also lost after loading. I should mention that this issue does not occur when I use JSON-based saving method.
I’m thinking to switch to c.objects to fix the problem…but honestly i spent too much time on the menu ..and i also hate the json method..
as mentioned the probblem happen here too..here is the enemy bars linking.
Many times i thought the problem could be about the trigger once there,-…but i don’t have any problems using json saves .and i honestly dunno at this point which method is considered fine to create and link 1 item per object.
Hmm
Does this run when loading and do you save/load the labels to storage?
How about you just save only the Collectables and Enemy and during loading create the labels back and relink it. I think that is a workaround.
And yes, there is a major bug in your work. Never use a trigger once inside a Repeat for each object. Rather you use a variable.
EDIT:
Yes Gdevelop Docs says:
Triggering Actions Once Per Object Instance
The “trigger once” condition is not evaluated per instance. If at least one instance meets the conditions, the action will not be triggered for any other instances, even if they meet the conditions later.
For example, if you want to play a “surprised” animation when the player gets close to an enemy, the “trigger once” condition may work if enemies are spaced far apart. However, if the player is already being chased by one enemy, other nearby enemies will not trigger the “surprised” animation.
To handle this, you need to use object variables to track the state of each object instance individually. While boolean variables can be used, string variables are often clearer, especially when objects have more than two possible states. Trigger Once Condition - GDevelop documentation
As it will cause it to trigger for only one instance. First try the saving only the Collectable and Enemies and then running those events again.
Var bind=0 \\\\\\\\\\\\\\\\-----------------------------> create bat to object pos
stick object post to enemy
\\\\\\\\\\\\\ Link object pos and enemy
Set bind var = 1
It’s just that I don’t really think it’s correct to put a creation action there without a t.once, despite you suggest to use a variable as replacement.
I may be wrong, but I remember that whenever you create something inside a Repeat For Each, you may use t.once. I think it depends on the kind of action you want.
At this point, I guess I’ll just scrap this and go with c.object instead to avoid cluttering things with variables.
Errr what programming language are you speaking in? I speak English and JS. Just kidding.
You simple just need to delete the things you don’t need like labels etc before loading, load the game back and run your for each again. Probably with a scene just loaded.
So that you’ll go through the same process you went through when creating them. And if so I’d expect it to work as the creation without needing to remove trigger once.
It is something i’ve already done and suggested on another thread and while it works i need to re-run the repeat for each in another event at scene just loaded (as you said)…kinda redundant but it works…and which i dun want..I guess i just hit another wall here…but thx for your time.
To be more precise, I’ve tested many different methods and workarounds, but none of them provide the smooth save/load events I’m aiming for. only thing which gonna probably fix this is go with c.objects
Because, in truth, just looking at that event stack above makes me feel sick…It’s horrible.
i find the create>stick>Link combo really bad no matter what…
I don’t use OR in tests so I can disable events when needed and read events better (despite it can be used as main condition). But that’s another gripe I have with the events sheet. Still, thanks for for havin taken a look into it and for the updated version.