OK, so here are my test results from pmw57's new java script translations.
The placement of entities generally seems to work as intended, as OoBay stations and hardpirates are placed as they should, and all other spawn scripts united here work according to the same scheme.
The hoopy casino script also works. I have been to one with the new java script version and it also does everything that it's supposed to do.
The player stations still don't work as intended, same trouble as with the old script.
I'll repeat here what the script is supposed to do, and what the new OSE.js does instead:
4) Out of the "station bought" screen, on your "missions" screen now a line should appear saying "You own an X station in system Y in galactic sector Z. Income per WJ: AAAAA Cr"
That doesn't work. It does in the XML version. The script new simply doesn't do this. As I don't understand java script well enough to repair it, no idea why not.
...
6) If you do a witchjump, the amount of credits it said in the equipment screen and says on your missions screen should be transferred to your account at arrival. (If you own multiple stations, the sum total of all their incomes should arrive) You will not get additional screen messages or somesuch. Your credits will simply rise the amount.
The new script doesn't do that. Also, your legal status should get raised or lowered for some stations. The script also doesn't do that.
So while the new script works for everything but the player stations, it actually doesn't work at all for the player stations.
What it should do should be the following:
Code: Select all
<key>Stations_owned_show_HAH</key>
<array>
<dict>
<key>conditions</key>
<array>
<string>mission_playerstation_HAH equal 1</string>
</array>
<key>do</key>
<array>
<string>setMissionDescription: Station_HAH_owned</string>
</array>
</dict>
<dict>
<key>conditions</key>
<array>
<string>mission_playerstation_HAH undefined</string>
</array>
<key>do</key>
<array>
<string>clearMissionDescription</string>
</array>
</dict>
</array>
... (write the mission description into the mission screen) and this ...
Code: Select all
<key>Stations_owned_income_HAH</key>
<array>
<dict>
<key>conditions</key>
<array>
<string>status_string equal STATUS_EXITING_WITCHSPACE</string>
<string>mission_playerstation_HAH equal 1</string>
</array>
<key>do</key>
<array>
<string>awardCredits: 75000</string>
</array>
</dict>
</array>
... (add, for each station owned, after each withjump the income per WJ, 75000 Cr in the example above) and this:
Code: Select all
<key>Stations_owned_legal_HAH</key>
<array>
<dict>
<key>conditions</key>
<array>
<string>status_string equal STATUS_EXITING_WITCHSPACE</string>
<string>mission_playerstation_HAH equal 1</string>
<string>legalStatus_number lessthan 70</string>
</array>
<key>do</key>
<array>
<string>setLegalStatus: 600</string>
</array>
</dict>
</array>
... though, the above is still cr*p as I don't want it to set a legal rating, I want it to raise or lower it similar to what the income part does with the player's credits:
A & B: Do nothing
C: Raise player bounty 5 points per jump if (see McLane's post) * the jump actually arrives in another system and not interstellar space
D: Raise player bounty 20 points per jump * (-> see above)
E: Lower player bounty 3 points per jump *
F: Raise player bounty 40 points per jump *
G: Lower player bounty 6 points per jump *
H: Raise player bounty 70 points per jump *
I: Do nothing
J: Lower player bounty 12 points per jump *
K & L: Lower player bounty 6 points per jump *
Oh, and the station codes:
First letter A to L: Type of station
Second letter A or B: There are two stations of every type each in every galactic sector, difference
Third letter A to H: Galactic Sector 1-8
pmw57's java script take at this looks like follows:
Code: Select all
this.processOwnedStations = function () {
var leftChars = 'ABCDEFGHIJKL',
midChars = 'AB',
rightChars = 'ABCDEFGH',
stationIncome = {
'A': 4000, 'B': 8000, 'C': 12000, 'D': 21000, 'E': 20000, 'F': 36000,
'G': 40000, 'H': 75000, 'I': 100000, 'J': 130000, 'K': 250000, 'L': 500000
},
stationBounty = {
'A': 0, 'B': 0, 'C': 5, 'D': 20, 'E': -3, 'F': 40,
'G': -6, 'H': 70, 'I': 0, 'J': -12, 'K': -6, 'L': -6
},
i, j, k,
playerStation,
income,
bounty,
totalBounty = 0;
for (i = 0; i < leftChars.length; i++) {
for (j = 0; j < midChars.length; j++) {
for (k = 0; k < rightChars.length; k++) {
playerStation = leftChars.charAt(i) + midChars.charAt(j) + rightChars.charAt(k);
income = stationIncome[leftChars[i]];
bounty = stationBounty[leftChars[i]];
if (missionVariables['playerstation_' + playerStation] == 1) {
player.credits += income;
totalBounty += bounty;
}
}
}
}
if (player.bounty + totalBounty < 0) {
player.bounty = 0;
} else {
player.bounty += bounty;
}
};
this.showOwnedStation = function (station) {
var leftChars = 'ABCDEFGHIJKL',
midChars = 'AB',
rightChars = 'ABCDEFGH',
i, j, k,
playerStation;
for (i = 0; i < leftChars.length; i++) {
for (j = 0; j < midChars.length; j++) {
for (k = 0; k < rightChars.length; k++) {
playerStation = leftChars.charAt(i) + midChars.charAt(j) + rightChars.charAt(k);
if (missionVariables['playerstation_' + playerStation] == 1) {
mission.runMissionScreen('Station_' + playerStation + '_owned');
}
}
}
}
};
I really hope I get capable help to solve this, I want to have the whole thing in java script - and the legal rating has to rise or fall instead of being set, otherwise a) I'm not happy with it and b) it's going to be incompatible with anarchies, which I also don't want.
Help?
L