ID:178335
May 26 2002, 1:22 pm
|
|
Lets say i want a store that updates as it sells things, the store will buy and sell items to and from players, and as it does, the numbers and types of items will change, but the default items in store willl eventually respawn, i need this on a constantly updating style, is there any way to do it with the List()?
|
In response to ShadowWolf
|
|
ShadowWolf wrote:
There's a tutorial or something on associative lists, search for it. It can explain them better than I could because there's an accompanying example. It's actually a buy thing too. Yup, that's one of Lummox JR's Dream Tutor articles on BYONDscape. |
Ter13 wrote:
Lets say i want a store that updates as it sells things, the store will buy and sell items to and from players, and as it does, the numbers and types of items will change, but the default items in store willl eventually respawn, i need this on a constantly updating style, is there any way to do it with the List()? Wow. This sounds a lot more complicated than a standard shopkeeper system. It's perfectly doable, though. For this, you're probably going to need four lists: One for objects and their prices, another with the number of each such object you have, another for specific objects bought from players and their prices (unless you want to count those objects as just like every other one of the same kind--that is, don't factor in wear and tear, etc.), and another for the number you want to keep in inventory. The last list is the big one. Essentially you'll want to set up a proc to handle the respawning for you, like this: mob/shopkeeper More sophisticated systems could be devised, but hopefully that's a good start. Lummox JR |
I reccomend doing it that way to track stock of items too. :-)
Search for:
Buy Script
RPG Buying
etc...