Miscellany Shops

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Miscellany Shops
Warrior
Member # 1250
Profile #0
I'm attempting to program a miscellany shop, and it isn't going well. I got up to the point where the add_item commands look like this: add_item_to_shop(3,(get_ran(1,min,max)),(get_ran(1,1,5)));
I thought this was pretty nifty on my part... until I actually tried to make the shopkeeper sell me stuff more than one time. I need a way to *completely* re-initialize a miscellany shop every time I call it, and I can't figure out how to do it. Any ideas, tips, discussion on this?
Posts: 93 | Registered: Saturday, June 1 2002 07:00
Agent
Member # 2820
Profile #1
Not until we can prod Jeff to implement the shopping calls listed in the BoA Suggestions thread.

You can only add items with these calls, never remove.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
...b10010b...
Member # 869
Profile Homepage #2
I suppose you could make a whole new shop each time you want the items to change, and then have the shop go out of business altogether once you get bored of making new shops.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Warrior
Member # 4202
Profile Homepage #3
You could set up a way to do this sort of automatically, but...

From the docs: ...which_shop (which can be from 0 to 129)

There are only 130 total shops.

--------------------
Creator of the 3D Blades of Avernum Editor for Mac. Get it at Ingenious Isaac's Illusion, my web page. Better yet, get Battle for Wesnoth, a wonderful free TBS game.
Posts: 192 | Registered: Sunday, April 4 2004 08:00
Warrior
Member # 3082
Profile #4
The shop doesn't need to change every time you shop there. It just needs to change every x ticks. I don't think most people would notice if the shop repeated its pattern every 20-30 days. You can set that up with a quick while loop or two.
Small scenarios are over in a week or two of game time. Larger ones could see repeats.
On the other hand, miscellany shops selling ANY item can be a bad idea. Crafty players can use them to outfit the whole party with Blessed Plate and similarly powerful items.
Posts: 54 | Registered: Saturday, June 7 2003 07:00
Warrior
Member # 4202
Profile Homepage #5
That's why their prices are usually exorbitant or similar to that.

--------------------
Creator of the 3D Blades of Avernum Editor for Mac. Get it at Ingenious Isaac's Illusion, my web page. Better yet, get Battle for Wesnoth, a wonderful free TBS game.
Posts: 192 | Registered: Sunday, April 4 2004 08:00
Warrior
Member # 250
Profile #6
One thing I'd recommend is running the get_ran part outside of the add item command. It depends on your scenario, but if you add a new item that is plot critical, you want to check to make sure that random chance doesn't make it appear in this shop and to do that you would need to make the random item generation a loop, that checks that the item number isn't a plot item, and then it can add it to the store. Otherwise just doing a loop over the course of 20-30 game days like suggested earlier seems like the best way to implement this.
Posts: 61 | Registered: Saturday, November 3 2001 08:00