I’m working on a ideia that i want to separate an amount of slots of an wrap box and put in other, all this in the same widget.
use the node “%” after your loop. The node has 2 inputs. For the first input use the index output of your loop for the second type in 2. This will check if the loop is even or odd. if the output after “%” node is greater than 0 than it is odd. The node outputs the remainder after dividing by the second number 2 so if it isn’t a whole number it is not even. This way you can create a branch. % > 0 → branch. odd or TRUE put in one box, even or FALSE put in the other.
Thank you very much for your help, but I did it in a much simpler way. I just ask my array if its indexes are greater than a certain value, and then create the rest in another wrap box when I’m creating the slots. But your method works too! Thanks!
Your way is perfect especially since you know the items will always be 10 then >= 5 is all you need. I usually do it the way I suggested only because my lists differ each time.
Yes, I like the fact that the other slots created in another wrap box work as a kind of Hotbar/Inventory Extension ready and functional as a normal slot. I recommend it!
This was a little insight I had. Remember that when using a for loop you will need to do something like:
Number of item slots + Number of hot bar slots - 1
Then: Is the index greater than the Number of hot bar slots -1 ? If yes, continue placing the larger slots (the indexes) in the first wrap box, if not, place the quantity you want in the hot bar/Inventory extension. If you use this with a drag and drop, array swap… my friend… it looks amazing!
OH, don’t forget to Resize the inventory array with" Number of item slots + Number of hot bar slots" as the index in Resize array.
It certainly always feels good when something works out the way we wanted (or better). My neighbors don’t like it as much when things don’t. I tend to be quite vocal. Glad it’s all working out for you. Keep up the good work!!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.