Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better data storing #7074

Open
1 task done
MissingReports opened this issue Sep 13, 2024 · 6 comments
Open
1 task done

Better data storing #7074

MissingReports opened this issue Sep 13, 2024 · 6 comments

Comments

@MissingReports
Copy link

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.
@Asleeepp
Copy link
Contributor

I like this idea

@Pikachu920
Copy link
Member

why not {events::1::type} and so on

@MissingReports
Copy link
Author

It'd be hard to add an event and reidentify it later

@sovdeeth
Copy link
Member

You may enjoy #7064

@Pikachu920
Copy link
Member

It'd be hard to add an event and reidentify it later

what do you mean?

@erenkarakal
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants