[request] Friendly user storage

Post your work in progress addons and get feedback

Post » Wed Jul 01, 2015 10:35 pm

Hey,

Is it possible to create a friendly user plug-in, that allow brainless user like me to store multiple value?

How do i see this stuff : insert "storage system object", edit a list (or an array) visually in a window, go to event sheet, add a condition then an action to "set firstLineOfTheList to (variable)". And that's it! The value is stored and can be loaded by a "load from the saving list" action, for example.
On the back side, the addon manage all things are needed to do a proper storage system : creating array/dictionnary, setting localstorage, etc.

Obviously I'm not a programmer, so i don't know if what I say is feasible... But it should be awesome :)
B
7
S
1
Posts: 64
Reputation: 585

Post » Wed Jul 01, 2015 11:21 pm

What you want is to look at the Local Storage plugin.
And the way to "store" an array or dictionary into a single value is to use the expression "AsJSON" that allows to "export" the content of an array (or dictionary) to a single string sequence (Set value of your variable to Array.AsJSON for example) and "import" an array from such a single "sentence" as well (Action "Load").

Read carefully the manual for each plugins (linked previously) and check out implementations examples in the How do I FAQ.

No need for a third-part plugin, first learn the ways of Construct. Especially since built-in plugins already provide what you are looking for !
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Thu Jul 02, 2015 1:44 am

I understand what you mean but built in plugins doesn't provide what I am looking for. I talk about a plug-in that allow user to jump over the localstorage set up. Actually, the user have to do many things if he wants to store value on hard drive : check if key exists, then, if key exist get the key, then, when you get the key, set the key to, etc, etc... This system needs a developper mind kind to be decently used.

What I am talking about is a visual way within the layout view that allow user to save values more intuitively with minimum work on event sheet.
B
7
S
1
Posts: 64
Reputation: 585

Post » Fri Jul 03, 2015 12:12 am

I just realized that my request was poorly expressed now that I have discovered the functions "save and load" in the manual. I did not know this feature because my research on saving system led me to the webstorage, then to the localstorage.

So my request changes: it would be exactly the same function as adding "save and load" but for specific objects - by name - as arrays, variable etc.

In fact, I even wonder why it does not already exist in official functions.

In my dreams I see a variable whose value changes all time an ennemy is destroyed... then I see inserts in the event sheet, simple, basic, open to the most ignorant game creator:
on layout start > load "higscoreVariable" from "mySaveSlot"
and
on player destroyed > save "higscoreVariable" to "mySaveSlot"

I smile at the mere idea of the size of tutorial about this kind of storage system :)
B
7
S
1
Posts: 64
Reputation: 585

Post » Thu Jul 09, 2015 11:48 am

norab wrote:on layout start > load "higscoreVariable" from "mySaveSlot"
and
on player destroyed > save "higscoreVariable" to "mySaveSlot"


Isn't this exactly what the localstorage-plugin does?

Well before loading you'd have to check if "mySaveSlot" exists, you can't tell the computer to open a drawer when there is no drawer to open..
If the drawer doesn't exist you let the computer make one, so next time you ask him to open the drawer there will be a drawer to open..
'Then you tell the computer what to do with the stuff he finds in the drawer and when to put something else in the drawer..
Sounds pretty straightforward to me..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests