#what is the best way to detect when a storage vector ends?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 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
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?
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
it is super easy to know the number of the indexes a storage is
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
wait let me check smthn rq
But I'm having to use a ton of macros for other stuff on conversion to load data
data modify storage poop:fart poop set value ["pee","poop","fart"]
execute store result score Count Count run data get storage poop:fart poop
Just had an idea, would just storing the current index when creating it inside itself and just data get [-1] work
should return the length of the array
Wait, if you just store the data get into a scoreboard it gives u the count?
ye
God I'm a moron
I've been iterating through it and storing it for success
Not result
lol
Gotcha, we just call that an array here
Btw, what's this for? :3
making a save/load system for a GUI library im making
Woaw!! :0