Game Development Community

TGB Inventory Tutorial

by Jean-Pierre Key · in Torque Game Builder · 04/26/2010 (1:56 pm) · 3 replies

Hi, I am new to Torque Game Builder. I have done some of the tutorials so I have an "okay" grasp of some of the context of torquescript, but it should be noted that I am not a programmer. I have been scanning the TDN and the forum hoping to find a tutorial or some code to help me start implementing my inventory sytem for my action rpg (started working on things such as getting a character on screen and such first)as I think I have the other things like making a gui down. Can anyone point me in the right direction? Thanks in advance!

About the author

Recent Threads


#1
04/26/2010 (5:36 pm)
There is no simple answer to this question. How complex of an inventory system do you want? This could be as simple as managing a single array or a multitude of simsets. The first step is to create a structure to store inventory items. Personally, I would use a simset to store the list of objects in inventory. Various mechanisms would reference this list for different purposes. I would create an "Item" class that would manage inventory item properties and methods. Anything that can be put in inventory must be of the Item class, that way generic methods can deal with them. Sword, potion, gem would all descend from the Item class. I'm not sure how well torguescript handles class inheritance. That might be the purpose of "Super Class". Nevertheless, every class that qualifies as an Item will need to share certain properties. You will definitely need to learn scripting. I wouldn't want to try to accomplish this using only the level designer.
#2
04/27/2010 (12:46 pm)
The Inventory system I am trying to make is two fold. First there "item" inventory system. It (hopefully) will be like the GuiListEdit in which I can add and remove items between different menues (i.e. player, shop, chest)a la games like fallout 3 and such. the second one, is more like an inventory of stats like health, mana, and strength. By the way thank you for your quick response.
#3
04/27/2010 (1:01 pm)
There are 2 main aspects of this: 1) Gui handling and 2) under the hood management. I addressed #2 in my response since that is the logical place to start. Once you can move things around via code, then you can add the gui controls (at least, that would be my approach).