Inventory extension

I am making a Battle Royal game with the split-screen extension but, if I had the inventory set to camera, which I don’t have, it would show duplicate the inventory four times in the four screens, but it wouldn’t move with the one sprite it was supposed to be attached to. So, I used the on Z-index but it draws the image without being able to scale the drawn image down.

Here’s the game:

there is a lot of code though, so there’s a big mess, sorry.

1 Like

Hmmm…you may need to manually position the toolbar sprites every frame. (so a fake implementation of relative to camera)

Then you can use the scaling attribute to make it smaller.

1 Like

Thank you very much!

2 Likes

Ho do I get an array of all the inventories?

1 Like

Why do you need to do this? Typically you just need to keep it assigned to the player

2 Likes

I tried to change the amount of items you can have in your hot bar to be one and change the amount of items in your inventory to 30 and it stopped working is there a solution to this? https://arcade.makecode.com/S38308-86097-72373-28412

1 Like

It seems to be working just fine for me, but when I first opened the game there was a black screen for a couple of seconds. Can you describe what is happening?


Sorry it took so long to respond, I was on vacation lol.

2 Likes

could you add an add item to inventory to it that would really simplify my game

1 Like

how do you make usable items? not like the eating thing but like using it, i was wanting to use it so you can equip tools and weapons if your holding it in your toolbar, i also wanted to know how do you make it so that it will update a variable with the number of the item held?

also a icon like this would be nice al you need to do is paste this after the color icon="\uf187"

You should look at the example code I’ve posted to see how I used a function to add an item. Although I wouldn’t be the first to concede that this extension is very basic - I think a new version is due.

Check the name of the selected item in the toolbar on A pressed, or something similar. This extension is very primitive as I mentioned.

Check the example code.

3 Likes

oh yah I figured out how to do that a while ago thank tho

use a custom icon instead please like this box icon it would look so good

3 Likes


import this instead of the og it just has incon for it in the blocks toolbar on the left

i use the inventory system like the example but when i try to get debug to see which item is currently held it wont work and gives me errors. im trying to make a tool system with this

Can you adjust it so that if you increase the screen size using the userconfig method, it increases the amount of items per row or the size of the items and doesn’t go into the next row halfway across the screen

well actually thats kinda hard cos im not sure if theres a simple way to check for screen size changes. Makecode wasnt exactly optimised for that bit of code so you would expect it to be a little janky :upside_down_face:

Pretty sure there’s a screen size variable, somewhere in the scene/tilemap stuff. Also couldn’t you just read the variable? The constant that holds the screen size?

1 Like

1 Like

ahhh yes i forgot lol

1 Like