Basic Inventory System - Don't know where to start
by Steven Peterson · in Torque Game Engine · 11/08/2005 (10:21 am) · 27 replies
I think the built-in scripted inventory system would be adequet for my needs, but I've read inventory.cs and item.cs three times and I still just don't "get it". How does it work? Where is the inventory stored? How do I check whats in the inventory to display it in GUI, or use an item?
I've checked out Tim Newell's tutorials and they seem old and overkill for what I need but i'm not sure. Going to go read them again. Haven't found anything written on here about the scripted system.
All I need to store is:
- a dozen or so items/weapons - you have 'em or you don't
- 1/2 dozen "ammo" type items
The hardest thing I will need to do is write the inventory out to a file with a handfull of other variables and thats the saved-game-state.
[i]Does anyone see a blatent reason here why I can't use the scripted inventory system? Or can anyone sum up how it works? the code didn't do it for me...[i]
Thanks once again,
Raven
I've checked out Tim Newell's tutorials and they seem old and overkill for what I need but i'm not sure. Going to go read them again. Haven't found anything written on here about the scripted system.
All I need to store is:
- a dozen or so items/weapons - you have 'em or you don't
- 1/2 dozen "ammo" type items
The hardest thing I will need to do is write the inventory out to a file with a handfull of other variables and thats the saved-game-state.
[i]Does anyone see a blatent reason here why I can't use the scripted inventory system? Or can anyone sum up how it works? the code didn't do it for me...[i]
Thanks once again,
Raven
#22
God that makes no sense i think. I've only got support for up and down direction at the moment. adding support for left and right probably won't be hard i'd imagine. I'm still evloving the menu system, with recent support for that dynamic hilighting being one of the latest additions. it will add a highlight to any menu that has a tag saying to do so.
The trickiest part of it i'd say is the actual navigation from one window to another. I keep track of the current open window, the cursor slot... and all the other previous windows and slots... so when i'm done with the current window, i call a function to go back to the last window and cursor position.

here's another random menu shot of my "Store". Which works well i can buy and sell stuff now, which is good.
11/14/2005 (7:50 am)
Well, yes and no. it took a little figuring out to get working right. but the basics of it is position a pointer on a gui element that's contanined in another one. basically all the menu items are children of a parent gui like GUIWindowctrl or something like that. i move the cursor by keeping track of what "slot" it's in in relation to the group the gui elements are in. God that makes no sense i think. I've only got support for up and down direction at the moment. adding support for left and right probably won't be hard i'd imagine. I'm still evloving the menu system, with recent support for that dynamic hilighting being one of the latest additions. it will add a highlight to any menu that has a tag saying to do so.
The trickiest part of it i'd say is the actual navigation from one window to another. I keep track of the current open window, the cursor slot... and all the other previous windows and slots... so when i'm done with the current window, i call a function to go back to the last window and cursor position.

here's another random menu shot of my "Store". Which works well i can buy and sell stuff now, which is good.
#23
I like those trees in the background. Nice Job! Not going to comment on the viagra though... :-P
11/15/2005 (11:52 pm)
K, I'm going to have to come back to this tomarrow or somthing. This GUI stuff is proving boreing and tedious compared to some of the other stuff i'm working on... (sigh)I like those trees in the background. Nice Job! Not going to comment on the viagra though... :-P
#24
@Raven, never forget that a GUI is your Game Face, even if you don't precisely lay your GUIs out up front you need to keep them in mind in everything you do, other wise you wind up like I do alot of times, trying to cram a bunch of kewl commands into a GUI that wasn't meant to hold it.
I desperately need to work on that part of my programming skills, it's my number 1 mistake, and I seem to make it with every single game I try.
I think on my next game I'm going work out the GUI and it's functions first and build the game around that ;)
11/16/2005 (2:15 am)
Hey Ramen, is that GUI just your programmer art, or do you have a 2D artist I could borrow?@Raven, never forget that a GUI is your Game Face, even if you don't precisely lay your GUIs out up front you need to keep them in mind in everything you do, other wise you wind up like I do alot of times, trying to cram a bunch of kewl commands into a GUI that wasn't meant to hold it.
I desperately need to work on that part of my programming skills, it's my number 1 mistake, and I seem to make it with every single game I try.
I think on my next game I'm going work out the GUI and it's functions first and build the game around that ;)
#25
11/16/2005 (4:26 am)
@Dreamer, Yeah, you could call it my programmer art. I got so sick of the normal windows and just threw something together based on an old web site design i used to use. I haven't got around to making it look nice or anything just yet. I wanna get more content before i start doing that sort of thing. Same with my battle GUIs, very basic.
#26
smorrey@gmail.com
11/16/2005 (5:34 am)
@Ramen, hey man if thats your programmer art, and you want to make some quick cash, I could sure use the UI graphics for my own place holders until I can get me a good 2D artist, drop me a line if you want to sell them to me.smorrey@gmail.com
#27
@Dreamer
Oh you must mean like this website: lcpavers.com. The numb-skull before me designed for 7 or 8 tabs. There's now more like 30 I think. They seem to think my layered-tab system is unintuitive - but hey their paying me to start-over. It works. ;-)
I would deffinitly reccomend designing your GUI's on paper well ahead of time. Mine have gone through numerous revisions. It 's the only part of my design doc. I actually look at. Ironic part is i change it too often, and it never really makes it off the yellow-pad and into the official doc...
Actually implementing them though? Shoot me.. I want to go do AI or somthing cool already...
11/21/2005 (3:48 pm)
Hehe, torque does have a way makeing a GFX-artist out of ya doesn't it?@Dreamer
Quote:other wise you wind up like I do alot of times, trying to cram a bunch of kewl commands into a GUI that wasn't meant to hold it.
Oh you must mean like this website: lcpavers.com. The numb-skull before me designed for 7 or 8 tabs. There's now more like 30 I think. They seem to think my layered-tab system is unintuitive - but hey their paying me to start-over. It works. ;-)
I would deffinitly reccomend designing your GUI's on paper well ahead of time. Mine have gone through numerous revisions. It 's the only part of my design doc. I actually look at. Ironic part is i change it too often, and it never really makes it off the yellow-pad and into the official doc...
Actually implementing them though? Shoot me.. I want to go do AI or somthing cool already...
Torque Owner Steven Peterson
While we're on the subject though, I 'm going to want to make the joystick control navigation of my inventory gui. Was this hard to do?