Game Development Community

RPG Type Shop System

by Andrew Patterson · in Torque Developer Network · 02/24/2012 (3:30 pm) · 5 replies

Hello,

I am a bit confused on this one. I am wondering how I would make an RPG style shop system. Would I make the GUI controls in the GUI editor first or do it all from scripting. I also can't find how you would close the torque game window pressing the exit button using a gui button.

#1
02/25/2012 (10:34 pm)
"I also can't find how you would close the torque game window pressing the exit button using a gui button. " Kinda has me lost.... Are you wanting to close your "game" or whatever using a button inside of your game?
#2
02/25/2012 (10:47 pm)
Yeah I am wanting to close the game using a button inside of the game.
#3
02/25/2012 (11:26 pm)
inside the button control add : Command = "quit();";
#4
02/25/2012 (11:54 pm)
Alright thanks
#5
03/01/2012 (12:50 pm)
Well, I have some experience with these kind of systems, so let me give you a list of things you will need.

* An item list, preferably by using unique item ID #'s for each item. Store this in a optimized (fast) database to allow your system to quickly obtain the details for each item.

* A system that runs in the fashion of a C++ linked list for your inventory, one that can add and remove items without affecting the others in the list. Also, if you have stacking items you will need to deal with those. Personally, I'd recommend making use of Torque's SimXMLDoccument object to allow you to invoke XML to do this.

* GUI Windows for each one. To handle closing via X, do this when you wake the GUI object: %this.closeCommand = canvas.popDialog(%this);

* The functions to calculate shop prices for buying and selling (this one's totally on you to decide :D)

That's about all I can think of! If you need help just ask, I'm sure someone (even if it must be me :P) will answer.