Game Development Community

Inventory

by Cap'n Kegger · in Torque Game Engine · 05/25/2003 (11:43 am) · 2 replies

We are looking to add a Diablo/Resident Evil style inventory to our game. How would I would go about adding this capability to Torque? Please someone help. Thanks.

#1
05/25/2003 (8:35 pm)
At one point I had coded up a drag/drop inventory and it wasnt too difficult. You just need to set up the inventory structure in the player class, and expose functions to the script so you can modify the inventory, such as add, remove, increment, decrement, and the query functions to see how many you have in the inventory.

Then you build a GUI that represents what is in that structure, and update the GUI every time you adjust what's in the player's inventory.

The drag/drop buttons were created by looking at how the window code works. I had a tutorial around here somewhere, with a .cc file you could just drop in to add drag/drop buttons, but I'll have to find it.
#2
05/26/2003 (4:17 am)
Thanks. If you can find that code, that would be great, if not that's cool too. You've already pointed me in the right direction, which is what I needed.