Maybe I should mention that there is something like this in Anarchies.oxp. It was not yet included in the 0.1-release on Oosat2, but it will be there in the 1.0-release.
The story is like this: In some of the most dangerous, pirate-infested anarchies GalCop has set up a military station, called a Sentinel Station, close to the witchpoint. This station does not only monitor the inbound traffic, but also gives a helping hand to traders who are attacked by pirates. This has become necessary, as in these systems the overwhelming piracy brought trade almost to a halt.
In some of these systems, however, the pirates were
so strong, that they were able to take over the Sentinel Station and convert it into a Renegade Station (you won't recognize the difference from the distance, but it will show up in your scanner as such). Don't dare to get close to it or even dock, unless you're a criminal with a fair record yourself!
If you are one, however, there will be some nice trading opportunities on that station.
I'm not yet done with the fiddling with the prices, but it will be more or less along the lines Disembodied has in mind as well.
******
@ Disembodied:
Disembodied wrote:Oh well: we all have to start somewhere. I suppose didling around with a few variables on someone else's work is, technically, "somewhere". Maybe not somewhere good, but somewhere.
No, that's somewhere very good, because it's exactly where
all of us (more or less) have started.
So, welcome to the club!
And just to take another excuse away, here's some additional how-to: Yes, you're right with commodities.plist (well, that's what this topic is about, isn't it?). All you have to do is to copy and paste the default list from Oolite itself into a file named commodities.plist in the Config-folder of your OXP.
The original file contains three arrays, the first entry is their respective name. The first one is called "default", the second one "rockhermit" and the third one "none". You only need one of them, in your own commodities.plist you can simply erase the other two. Delete "rockhermit" and "none".
Now you have to rename the remaining "default"-array. If you don't do that, your plist will set the new default for
all stations in the Ooniverse, overriding the normal price-definition. You don't want to do that. An array of commodities is applied via the
role of a ship.
That means you now have to create a new shipdata.entry, which means another file in your Config-folder, named shipdata.plist. Copy and paste the original rockhermit-entry into it (don't forget the plist-header!). You then have to give your custom rockhermit a new unique entity-name. That's the very first entry in the shipdata.plist, the one that's reading
<key>rock-hermit</key>. Change it to something unique like
<key>free-trading-zone</key> or whatever you like. If two entities bear the same name, things get messed up.
Then you have to find the lines
<key>roles</key> <string>rockhermit station oolite-rock-hermit</string> and attach a new custom role to your new hermit. Exchange the second line with something like
<string>free_trading_zone station(0.00001)</string> (there is something like a convention to use hyphens in entity-names and underscores in roles, but that's not a must at all). The role
station has to be there as well, in order to make it dockable. But with the value in brackets you give it a very low probability to be spawned when the engine calls for a main station.
Now finally you have to put this exact unique role-string (not the
station) in the beginning of your commodities.plist. So exchange
<key>default</key> <key>free_trading_zone</key>. This means that the price- and quantity-definitions of your custom commodities.plist will be applied to
all entities in the Ooniverse that have the role
free_trading_zone, and to these
only.
And then you calculate the prices and quantities along the lines I have explained in my long post above.
As far as testing is concerned, you have two ways: (1) do your maths! That means calculate your prices and quantities through with all possible values of the variables you have set, and look if the results match your vision. (2) fire up the game, find some of your custom hermits, dock with them and look if the prices and quantities offered there match your expectation. If not, it's back to step (1).
In order to make step (2) work, there's one thing more you need: Another plist, called script.plist in the same place, containing the code LittleBear posted. You have of course to exchange the line
<string>addShipsWithinRadius: test 1 wpm 0 0 4000 10000</string> with
<string>addShipsWithinRadius: free_trading_zone 1 wpm 0 0 4000 10000</string>. I don't know, however, why he uses the
addShipsWithinRadius-method. A
<string>addShipsAt: free_trading_zone 1 wpm 0 0 4000</string> would do the same trick.
And one last thing: Have fun with OXPing!
*******
EDIT: when I wrote this post I hadn't realized that you already had a name for your modified rock hermits (oh, this reading lazyness
). Anyway, to make things clearer I have changed all my
trade_occasions_hermits to
free_trading_zones.