- This topic has 6 replies, 3 voices, and was last updated 3 years, 3 months ago by AVerge3Der.
-
AuthorPosts
-
2021-06-08 at 6:36 pm #41940rollos5sonParticipant
Hi all!
I’ve been tinkering with Puzzles for some time with little difficulty and much enjoyment but I’ve finally run into a challenge.
What I’m trying to do is simulate the loading and saving of a set of objects for eventual hookup to a database (as project files). As part of this testing process I store my List of objects in a Dictionary on “save”, then attempt to load the contents of the Dictionary entry back to the List on “load”.
My problem is that when I do this, rather than replacing the contents of the List array variable, the loaded Dictionary content is appended, so that when I do my test load I get multiple iterations of the set of objects. Worse, some of my attempts to clear the List variable first make it impossible to load the contents of the Dictionary list at all.
If necessary I can provide an example app.
2021-06-08 at 10:21 pm #41948GLiFTeKCustomerHi,
Before you save to your list, define it as an empty list using the “create empty list”Then do your adding of values to it, then set it as the value ofyour dictionary key.
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2021-06-08 at 10:28 pm #41949rollos5sonParticipantThanks for the tip!
I’m feeling a bit foolish now because I went back over my code more thoroughly and found the problem:
I’d set up a function within a loop to assign new names to the reloaded objects, but I was then adding the new names to the same list! I solved the problem by assigning those names to a second list which I could then copy back into the first after finishing up the renaming. Everything is working perfectly now!
For any relative newb like me, let this post be a helpful lesson – proofread, proofread, proofread!
2021-06-09 at 2:09 am #41951GLiFTeKCustomerOh it happens heh.
I’ve seen my share of facepalms.
I have a plugin you may be interested in I’ll be releasing soon for saving to offline storage that may help in your project.
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2021-06-09 at 3:25 am #41952rollos5sonParticipantTrue, yet I’m also coming to appreciate more and more that mistakes truly are a great teacher. I’ve had to learn coding on the fly and the behavior of functions still makes my head hurt, but I’m getting more used to that.
Thanks for the heads-up on the plugin!
2021-06-09 at 4:35 am #41954GLiFTeKCustomerTrue, yet I’m also coming to appreciate more and more that mistakes truly are a great teacher. I’ve had to learn coding on the fly and the behavior of functions still makes my head hurt, but I’m getting more used to that.
Thanks for the heads-up on the plugin!
Join the Verge 3D Discord server chat if you like.
Contact me there for info and help!Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2021-08-02 at 1:20 am #43362AVerge3DerParticipantThis sounds interesting to me as well, the plugin. If this can work with SQLite that would be a plus.
-
AuthorPosts
- You must be logged in to reply to this topic.