how do i stack items up in inventory?

0 favourites
From the Asset Store
Stack as many colored blocks as possible to create the biggest structure ever! Overcome your limits!
  • you need to also pick the text object to match the item uid ... or something that pairs the text to the object you create...

    Edited: for example i mostly used local variables on objects... and do lets say item.orderid & text.orderid

    if you have a dictionary or array with your item, you can also set that variable, and when u spawn the text object just feed the orderid of the item on the text orderid.

    and then when u add a new item in your inventory pick the text that matches orderid with item.orderid

    something like bellow code

    repeat 5 create item at XY 
    	set item.order id to loopindex
    	create text at item.X item.y + 10
    	set text.orderid to loopindex
    on click add to array item.atorderid + 1 
    pick text.object by evaluate text.orderid = array.at(text.orderid) set text to array.valueAt(text.orderid)
    
    
    

    the above code might not work properly, but should give you an idea on how to set the text and pick its value, depends on how you declare the orderid or value you pick/pair items to text object and viceversa.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It is working now :) the problem was the container, the text and inventory slot weren't in the same container.

    Thank you so much for your help! and thank you dop2000 for the simple inventory example :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)