Hello, I am just getting started with Gdevelop and enjoring making lots of animated games, but I also need to do something more data-oriented.
My hope is to make a web app that lets people keep a track of their blood pressure, stores it in local storage (i.e on the device)… but when needed to be shared can be either downloaded as .csv or emailed… or using whatever means to get it to a doctor. I’ve got all the form items working (even multiple choice/drop downs which are sadly missing).
My plan was to use 3 global variables to handle this.
entryStruct // a diary entry including name, bpOne, bpTwo, height, weight, datestamp etc.
diaryArray // a list of entrStructs
diaryJSON //where I will serialise diaryArray for saving into storage (persistent in web right?)… and at some point later, read it in and write out as .csv.
Firstly, does this all add up and look reasonable? (Even though it may be an unusual use case for gdevelop)
Secondly, why isn’t there no-code, menu-based ways to create a Struct? It seems I maybe can call these items with code, but there always seems to be levels of coercion going on…
In my mind, when I click the “ADD ENTRY” button, my pseudo-code might look something like this…
//MAIN SCREEN
//BUTTON CLICKED on Main Screen Adding a diary entry
// create a struct to store the diary entry
//How do I create a notional Struct? Remove a child is the only option available?
entryStruct.name = GlobalVariableString(name)//we asked for it on the previous screen
entryStruct.bpOne = bpOneInput.Value()
entryStruct.bpTwo = bpTwoInput.Value()
entryStruct.height = heightInput.Value()
entryStruct.weight = heightInput.Value()
entryStruct.datetime = "10:20 06/02/2023" //automatically filled in to be now.
//add it to an array
diaryArray .addChild( key=datetime, data=entryStruct )
//save it to Storage
storage.diary = GlobalVarToJSON( diaryArray )
//close structured data "storage" //to do a hard save?
This approach (if I’m going down the right track) would be made easier if the Global Variables were in the list of objects I could create and assign values to.
Thanks for any guidance.
Tom
p.s Just another note, it seems some of the content on the forum is very old and maybe isn’t up-to-date any more.