Okay, never mind.
Let's try step by step. (Sorry, this is very short, I'm a bit in a hurry. Hope you understand it nevertheless.)
The first thing you need for your new station (apart from the model and texture, of course, but those are already there) is a shipdata-entry. I think you already know how that looks like. For a start just take the one from the original SIRFYard.oxp. Copy and paste it to your own shipdata.plist.
Now rename it. (That's the whole entry,
not the <key>name</key>-thing.) Give it a unique name, which has to be particularly different from its original name. Let's say "realistic-shipyards-sirfyard-0".
Insert the techlevel-key (if it isn't already there), give it a value of "3". This will be your station for all techlevel 0-systems (hence the name). Finally you have to give it a unique
role. It should be something like "realistic_shipyards_sirfyard_0" (there is sort of a convention that entry-names have dashes and roles have underscores, but it's not necessary).
Now copy and paste the whole thing again. This time you name it "realistic-shipyards-sirfyard-1", give it a techlevel of "4" and the role "realistic_shipyards_sirfyard_1". This will be for all techlevel 1-systems.
Copy and paste again, name it "realistic-shipyards-sirfyard-2", give it a techlevel of "5" and the role "realistic_shipyards_sirfyard_2"...
And so on, until you have 15 copies of that same entry in your shipdata.plist, each one with its own number at the end of its name and role, and its corresponding equivalent_tech_level, which should always be 3 more than the number in the name and role.
This is what we call "clones" of a station. They look the same, for the player they are indistinguishable, except that at different places he will meet a different clone.
Now you want to put them in systems. One quarter of all systems. For this we need some random. Complete random, however, means that the player will come to a certain system, let's say Diso, once and meet a SIRFYard there. The next time he returns the SIRFYard may be gone, because this time it doesn't get a random chance. Not satisfactory.
But this is what pseudo-random is for. "pseudoFixedD100_number" creates a random number between 0 and 99 for each system, and every time it creates the same number for the same system. This is what you need.
So now you can write your script.plist. First you need the condition STATUS_EXITING_WITCHSPACE. This is when you create your station. Then you need the condition pseudoFixedD100_number lessthen 25. This will create it in 25% of all systems. Finally a couple of conditions to figure out which of the clones has to be created.
Here is the script:
Code: Select all
{
conditions = ("status_string equal STATUS_EXITING_WITCHSPACE");
do = (
{
conditions = ("pseudoFixedD100_number lessthan 25");
do = (
{
conditions = ("systemTechLevel_number equal 0");
do = ("addSystemShips: realistic_shipyards_sirfyard_0 1 0.99");
},
{
conditions = ("systemTechLevel_number equal 1");
do = ("addSystemShips: realistic_shipyards_sirfyard_1 1 0.99");
},
{
conditions = ("systemTechLevel_number equal 2");
do = ("addSystemShips: realistic_shipyards_sirfyard_2 1 0.99");
},
.
.
.
);
}
);
}