Good news! To provide faster support and grow the community, we'll be changing the forum to "Read Only" and turn to Discord instead for support.
Join here: https://discord.gg/zjNj5zZ

Diablo style inventory and items

Tristran
Posts: 2
Joined: Sat Aug 12, 2017 10:56 am

Diablo style inventory and items

Postby Tristran » Sat Aug 12, 2017 11:00 am

Hello,

I’ve tried to not to border you with “trivial” questions so far, however I get to the point, I would really appreciate advice on these two subjects.
In my game, I have a lot of characters instantiated runtime and here is what I want to do:

1) I want to have character and inventory windows merged together (Diablo style). Do you think it’s better to have both windows separate and just open them at once and visually make them look as one window. Or do you think it would be feasible to create one UI window, functioning as character window with inventory below…?

2) I want to generate items runtime (again Diablo style :-). It means I should be able to create items runtime with different item stat types and values. I am not sure how to approach this. Create some template items in MyInventoryProFiles and once I need to create new random item, just choose the most suitable item from database, instantiate, modify its stats and put it to collection? And keep in-game items list with stats somewhere and once saved game is loaded, populate inventories with template items from database and modify them based on info from this list?

Thank you. Hope questions make sense :-)

Shipright
Posts: 68
Joined: Tue Jul 12, 2016 7:24 am

Re: Diablo style inventory and items

Postby Shipright » Sat Aug 12, 2017 12:49 pm

Whats the purpose for cramming all that functionality into a single window that resets itself to disparate uses rather than going the separate-but-layered=to-look-like-one route?

If there is no game mechanic that relies on it, why waste the time cramming square pegs in round holes?

Jimbob
Posts: 14
Joined: Mon Apr 11, 2016 11:58 pm

Re: Diablo style inventory and items

Postby Jimbob » Sat Aug 12, 2017 8:26 pm

If you cram enough pegs in, with the shavings left over from them you can make a new peg

User avatar
PeterBibinin
Posts: 194
Joined: Mon Oct 24, 2016 10:55 pm
Location: Poland
Contact:

Re: Diablo style inventory and items

Postby PeterBibinin » Sat Aug 12, 2017 9:09 pm

About creating items. It's not hard. Just create item, create script where you set item before add to inventory:

Code: Select all

var itemToEquip = ItemManager.database.items[itemID] as EquippableInventoryItem;
                        if (quantity != 0)
                        {
                            itemToEquip.currentStackSize = quantity;   //some setings before add to inventory
                           
                            //just set other value you want like me
                        }
                       
                        //and then
                        InventoryManager.AddItem(itemToEquip);  // Add the item to a collection, if it was already in a collection it will now be in both.
                       


Same methode for spawning items on scene or add to equippment.
Waiting for sunrise
-------------------------------------------
Try make world beter ;]

My Advanced Save System tutorial with screen capture like in The Forest !
Advanced Save System
-------------------------------------------
BAZINGA !

Tristran
Posts: 2
Joined: Sat Aug 12, 2017 10:56 am

Re: Diablo style inventory and items

Postby Tristran » Mon Aug 14, 2017 8:35 am

Ok. Thanks for your suggestions, I will do that this way.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests