Ok, this problem turned out somewhat more complicated then I originaly anticipated, but here is a possible solution.
First off, it became more complex when the limited quantity item has mass. This is because the placeholder items have to have mass too, otherwise there are no controls to limit overloading the ship. Seeing as the invisible placeholders have mass, then they need to be paired with another invisible item to cancel it out. Which of course, complicates the random generation scheme.
Secondly, I am not using any missions to be run when taking off/landing/entering outfitter. This is to limit collision with other potential hacks. Nor am I doing any dateposting, for the same reason. I tried to keep the basic outfit item as untouched as possible, but ultimately has to add functions to the OnSell field. It should be possible to not touch it at all, but with a large increase in complexity - mostly to prevent abuse. (It is hard to check requirements for being able to sell an item using the "sell" button.)
Third, it is possible to make the limited quantity items cost different ammounts, however this makes for some problems.
Say you have a basic missile cost 1,000 credits normally, but want them to cost 2,000 at the limited supply area. You can do this easy enough, but the player will only be able to sell them for 1,000 no mater where they are. It is possible to have the player get more for it in different places, but probably increases complexity more than it's worth. Not to mention that the player will turn them into a comodity item to be bought low and sold high.
At any rate, here is a first look. Limited Quantity (16 KB)
In this example, you can buy missiles at Earth in unlimited quantities - as many as you can hold.
Then there is a Station that has between 2-23 missiles.
And also an Outpost 1 system away that has 2-13 missiles.
So the same item can be different varieties of scarceness. You'll need 1 extra outfit for each difference in quantity.
These quanties are changed every 4 days.
It is important to note that using the current method, you'll want to keep places that share the share the same randomness of an item further apart than the regeneration time (4 days in this example) or it will look like they share inventories (this might be usefull for stations in the same system).
And you will not want the unlimited quantity areas near the limited areas. This is because when you sell off a missile, it adds one to the limited quantity inventory, so you can buy and sell at a particular place. There is potential for exploit if any limited ares are near an unlimited area.
For simplicity, I did not seperate the areas by enough travel time in the plug.
Workarounds to this are to regenerate supplies every day, or instantly regenerate when landing on specific spobs, or simply keep areas far enough apart.
For transparency, I have made it so you can see the invisible placeholder items in the player info box.
This post has been edited by Desprez : 30 August 2006 - 11:24 PM