• Hey! Register here to create your account, engage with the community, and talk about what is new!

Variable "Get item num" or "Set item num"

ImaFrenchFryBoy

New member
Joined
Jun 19, 2023
Messages
1
Reaction score
0
Ok, so here's my idea. You have the ability to set a variable to the number of items in an inventory. Said I had 5 stacks of gold, and I had no var system for keeping track. I could use Get item num to set a var to the five stacks. It would work with a variable, and then item(s) being counted. Set item num I'm not sure on how it would work beyond filling an inventory if neccesary. Excess items might not be given, or replace other items. I'm not sure but Get item num would be a great addition to the items tab of set var.

This is just my thought from a player who's only been on DF for 2 years. Anyone reading is welcome to give feedback or suggest ideas on how this could work.
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
356
Well technically, you can code Get Item Num but it will take you a few blocks, what you do is you repeat thru the player's inventory, check if the item material is equals to the one you want, if it is, get item amount and add it to a counter; but you might need to do this for these game values (or combine the gamevalues together before looping ig): Hotbar Items, Inventory, Offhand Item, Armor Items
 
Top Bottom