Is there a more memory efficient method?

im trying to make a chest system for a Minecraft remake (ill probably make one in this and the other one), and this was the system for chests I had made. i didn’t want to just teleport the player into a room, or have more than 1 button. this was the best system I could come up with, is there a more efficient way to do this?

Hey @dumdumstudios! Welcome to this community! Don’t forget to read the FAQ!

Could you elaborate a bit on what this is exactly, and what you have set up? It’s a bit hard to tell from a short description and a picture.

Thanks!

3 Likes

This hurt me inside
PLEASE use grid snap or organize that monstrosity
Could you explain in more depth how this system works, just so we know what to remove?

6 Likes

Sorry for taking so long to reply, but I ended up cleaning some stuff up and making a whole section dedicated to showing off how it works for one item.

The first text box is just for asking if you would want to put items in or withdraw. i don’t have withdrawal set up yet. Ill figure that out when I get there

The second text box is asking if you want to put in bait (which is all I’m showing in this) or bananas. the check is for if you click off, it will pop up with a text box that shows the next 2 items (being beach fish, and I cant remember the other one.) the main reason I added this is so that the player wouldn’t have to go through 75 textboxes to get to the final item, they just have to go through 38. That’s still a lot, but it’s the best way I could figure out without teleporting the player into a new room or adding multiple buttons.

If you click bait as an example, it will move up one text box instead of over. However, it also updates the leftmost counter. The counter is just a part of the check. it’s just
if counter = 0, move onto the next 2 items. Otherwise, go up one textbox.

The textbox up one asks if you want to put in one or 2 of the items. Either way, it updates the right counter, which keeps track of the amount of each item in the chest. The textbox one above that is the same thing. The reason I added it was that I couldn’t figure out a way to make it so you could click off to stop putting in items without it triggering the textbox again otherwise. i probably could’ve used another check using the original counter, but this route works.

The 3 with fish counters are for granting and taking away the players’ items, even though I haven’t made the withdrawal system yet.

The repeater is for if the player clicks on putting in 2 items. That’s pretty self-explanatory

The pink trigger at the bottom is if you click the button, it resets the left counter so you can see every set of items. If you go up one pink trigger to the left, it just says that if you put in one item, it goes to the highest textbox, so it doesn’t repeat a time after you click off. The one to the right of that just channels an extra trigger so I can update the counter 2 times without triggering it an extra time (that seems to be a recurring theme here). The trigger in the top right activates the higher text box if you click put in 2. Idk why I put it diagonal to the one that does that when you say to put in 1 but whatever. The final pink trigger resets the left counter when the right one, which keeps track of items, updates. That should be everything.

funny how this is longer than the original post. lol. also I had to write this twice cause you cant say the opposite of withdrawal. i hope that’s not an issue whenever I get around to posting this. its not very close to being done but still.

3 Likes

before anyone says anything, i forgot to add the property that actually keeps track and saves that. ill add that in the morning.

wow!

that’s a lot of words…

i’m not a cool coder, but I can tell from my own eyes that you should use not a repeater but a trigger loop, which will save you space several times!

i think you know what a trigger loop is (if not, let me know)
i see you’re using 3 repeaters, it takes 1500 memory, but if you use a trigger loop, you’ll use only 120 memory! maybe this will help…?


I think @bird can tell you more than I can

3 Likes

Like Monoreuk said, using a trigger loop in place of the repeaters is very memory saving. Also, you wanted a chest system right? If you really wanted to save memory you could just have an area for the player to dropstuff. If you wanted an elaborate system like this, then it would be three times as difficult. If you have ST you could use the call to action list device rather than spamming the pop-ups. Additionally, I believe you could use block code to save some of the devices here.

3 Likes

My ADHD could not keep focused when reading his explanation :sob:
gosh darn

so you pretty much want to figure out a Pseudo system to store other items and you want it to remember the items?

I’m confused-- what do you mean by this?


(sorry if this looks kindo of bad, i had to do it in google drawings)

this pretty much shows what textbox it moves to when you pick a certain option. when I say something like over one, or up one, its just a way of saying which textbox is used afterwards based on how I sorted this. sorry for the confusion!

1 Like