I need to impliment some sort of shop for my RPG soon but I'm stumped on how I could do it efficiently.
I'd like to have multiple vendors or different items but try and do it all within one object!
What would be the best way to go about setting the items of each shop without using a million objects and without using a txt/ini file that is easier editted?
Question on making a "shop"
Started by Carl Lawl, Dec 23 2011 07:44 PM
4 replies to this topic
#1
Posted 23 December 2011 - 07:44 PM
#2
Posted 23 December 2011 - 07:59 PM
You will need to use arrays or data structures or it becomes complex and messy. If you know little about arrays then learning about them would be a good place to start. A shop holds a stock, thus it is little different from an inventory. Players will also hold things they buy - so that is another inventory.
Handling these using arrays or data structures is the most efficient - unless you plan of holding in excess of 32,000 different items.
Handling these using arrays or data structures is the most efficient - unless you plan of holding in excess of 32,000 different items.
#3
Posted 23 December 2011 - 10:42 PM
Ok so what if I had a switch or something that contained what style of vendor it is (armour, weapons, potions etc) ive already got the items stored for each, but I wanted to use 1 object is there a way to set which one it will be for each object? Like room creation code or anything like that?
#4
Posted 24 December 2011 - 12:04 AM
Are you asking how to use one object for different purposes? You want to know how one instance from an object can be used as the armor and another instance from the same object can be used as weapons, etc?but I wanted to use 1 object is there a way to set which one it will be for each object? Like room creation code or anything like that?
#5
Posted 24 December 2011 - 10:54 AM
Are you asking how to use one object for different purposes? You want to know how one instance from an object can be used as the armor and another instance from the same object can be used as weapons, etc?
but I wanted to use 1 object is there a way to set which one it will be for each object? Like room creation code or anything like that?
What? No, I'm asking about making shops and having different vendors under one object...
Lets say I make obj_thisisgoingtobeashoppeoplecanbuystufffrom
then I play a few of these in a room, is there anyway to set it to a specific vendor (ie weapons vendor, armour vendor, potions vendor) maybe using a variable that gets set in the room creation code? Ive never used room creation code so I don't know!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











