#what is the best way to detect when a storage vector ends?

1 messages · Page 1 of 1 (latest)

upbeat forge
#

the way im trying to do it feels TERRIBLE for performance, what would be a good way to go for this?

runic thunderBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1736905982:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

median grail
#

It sounds like you're referring to something that has a proper meaning in programming, but not a clear or direct analogue in normal data pack practices. Can you elaborate a little more on what you have and what you're trying to do with it?

upbeat forge
#

I am working on a saving and loading system using commands, and saving different entity data on different storage indexes.

Vectors in programming are spaces that accept multiple inputs, an example being Pos, that accepts x,y,z.

To load stuff from the saved data, I have to iterate through each index to retrieve what I had saved, but for that I would need to know the number of indexes it has

blissful pivot
upbeat forge
#

The method I'm doing this for now is iterating through each index and storing the success of a /data get on that index on a screboard

blissful pivot
#

wait let me check smthn rq

upbeat forge
#

But I'm having to use a ton of macros for other stuff on conversion to load data

blissful pivot
#
data modify storage poop:fart poop set value ["pee","poop","fart"]
execute store result score Count Count run data get storage poop:fart poop
upbeat forge
#

Just had an idea, would just storing the current index when creating it inside itself and just data get [-1] work

blissful pivot
#

should return the length of the array

upbeat forge
blissful pivot
#

ye

upbeat forge
#

God I'm a moron

#

I've been iterating through it and storing it for success

#

Not result

blissful pivot
#

lol

upbeat forge
#

Ughhhhhhhhh

#

Well atleast I can fix this tomorrow morning

#

Ty for the help lol

median grail
dense crane
#

Btw, what's this for? :3

upbeat forge
#

making a save/load system for a GUI library im making