Better data storing
MissingReports opened this issue ยท 6 comments
Suggestion
I feel like it would be nice for a way to store multiple data as one element in a list, since you can't store a list inside of a list
E.g:
set {_eventDataStructure} to an empty data structure
set element "Type" of {_eventDataStructure} to "Global Booster"
set element "EndDate" of {_eventDataStructure} to 10 minutes later
set element "Amount" of {_eventDataStructure} to 100
add {_eventDataStructure} to {events::*}
# Retrieving
loop {events::*}:
set {_eventDataStructure} to loop-value
set {_type} to element "Type" of {_eventDataStructure}
# And so on
Another option is using SkReflect's array, or making it so you can store lists inside of lists
Why?
It's pretty hard to store multiple values in a list as one element
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this suggestion.
You may enjoy #7064
it really depends on the end goal but I had the same issue on my minigame framework while creating instances of games.
the way i solved it is creating a random id for the game and storing that id in the player
ex.
function start(p: player):
set {_instance} to random uuid
set {var::%{_instance}%::end.date} to now
set {current.instance::%{_p}'s uuid%} to {_instance}
on jump:
set {_instance} to {current.instance::%player's uuid%}
broadcast {var::%{_instance}%::end.date}
you can take inspiration from this if applicable