this.shipWillDockWithStation = function (station)
{
if (system.techLevel == 0 && (station.hasRole ("coriolis") || station.hasRole ("dodecahedron") || station.hasRole ("icosahedron") || station.hasRole ("sfep_station"))) player.addMessageToArrivalReport(expandDescription("[dockmessage_0]"));
else
if (system.techLevel == 1 && (station.hasRole ("coriolis") || station.hasRole ("dodecahedron") || station.hasRole ("icosahedron") || station.hasRole ("sfep_station"))) player.addMessageToArrivalReport(expandDescription("[dockmessage_1]"));
// continues through all tech levels and then moves on to individual stations
if (station.hasRole ("rockhermit") || station.hasRole ("rockhermit-chaotic") || station.hasRole ("rockhermit-pirate")) player.addMessageToArrivalReport(expandDescription("[dockmessage_rock]"));
else
if (station.hasRole ("constore")) player.addMessageToArrivalReport(expandDescription("[dockmessage_store]"));
//the individual stations also continue
}
There was some worry about the use of this.shipWillDockWithStation versus this.shipDockedWithStation but there is method to my madness. It stated somewhere in the Wiki (that can no longer be found) that the first one will put my additional Arrival Messages BEFORE Oolite's usual Arrival Messages which is the desired behavior.
The code posted by phkb was very close to one of my previous attempts but mine lacked a few brackets which he kindly provided. It always seems to come down to the brackets, or the lack thereof. The testing and revamping phase can now begin. Thanks Again to phkb for pointing me in the right direction.
Humor is the second most subjective thing on the planet
Brevity is the soul of wit and vulgarity is wit's downfall
There was some worry about the use of this.shipWillDockWithStation versus this.shipDockedWithStation but there is method to my madness. It stated somewhere in the Wiki (that can no longer be found) that the first one will put my additional Arrival Messages BEFORE Oolite's usual Arrival Messages which is the desired behavior.
You can always get back to earlier versions of any wiki page by just clicking the history tab at the top - and then clicking the date of the version you are after.
That of course presumes that you know which page it was!
I'm trying to convert pylons into more general equipment slots.
Pylons seem to expect either missile or mine designations however and so suit expendable (can be fired) items.
The provides option from equipment.plist would let me assign whatever other equipment I wished to the a theoretical 'missile' but I wouldn't wish it to otherwuise behave as a missile.
In the absence of shipWillLaunchMissile or similar, does anyone know a way I could fill the pylon slot without having the possibility of it being launched/expended?
I'm trying to convert pylons into more general equipment slots.
Pylons seem to expect either missile or mine designations however and so suit expendable (can be fired) items.
The provides option from equipment.plist would let me assign whatever other equipment I wished to the a theoretical 'missile' but I wouldn't wish it to otherwuise behave as a missile.
In the absence of shipWillLaunchMissile or similar, does anyone know a way I could fill the pylon slot without having the possibility of it being launched/expended?
shipFiredMissile()
awardEquipmentToCurrentPylon()
These are what one uses for an infinite missiles cheat, apparently. If you also added the original missile deleting its own existence as soon as awardEquipmentToCurrentPylon succeeded, firing the missile would appear to have no effect, I guess. Is that what you're trying to achieve, or have I misread you?
s that what you're trying to achieve, or have I misread you?
Imagine if I wanted fuel scoops, for example, to take up a pylon slot when installed.
I can use requires_empty_pylon but the game seems to expect an equipment item ending in either _missile or _mine (rejecting it if it doesn't).
Now I could create a pseudo 'missile' or 'mine' that incorporates provides = ("EQ_FUEL_SCOOPS"); but I really don't want that item to be fired, even if I could replace it as you illustrate above, the act of firing it would spoil the illusion somewhat. So if it must be a missile/mine then I dont want it to behave as one
I essentially want to create a 'jammed missile', blocking its occupied pylon but also providing the desired equipment. Why pylon slots? Because they're predetermined for all existing ships. Apologies for any confusion.
Is there a version of (or can I repurpose)... shipEnteredPlanetaryVicinity... to trigger when the player is near to the sun (and only the sun) instead of a planet?
...Worked it out:
this.shipEnteredPlanetaryVicinity = function(entity) {
if (entity.isSun)... etc.
How would one create a station or a ship allied with the local government as distinct from GalCop?
First off, allegiance only applies to stations, not ships.
I can't think of any examples, but you can put anything you like as the "allegiance", and the game will work. The AI, however, would treat it as "private", and thus probably ignore the station completely.
Why, when using mission.setInstructions, do I habitually use a second parameter, always set to this.name?
mission.setInstructions("Why do I do this?", this.name);
This second parameter appears to be non-functional. Is this correct, or is it a mistake I've copied from someone else 15 years ago, and never realized I'd always got it wrong? Should I be doing it like this:
Why, when using mission.setInstructions, do I habitually use a second parameter, always set to this.name?
The second parameter is optional *if* you always call setInstructions from the same worldscript. If you had, say, a ship script that needed to update the instructions you added via your worldscript, you would need the extra parameter so Oolite can know which instructions you are updating. Otherwise, you'd end up with two instructions on the manifest page.
Why, when using mission.setInstructions, do I habitually use a second parameter, always set to this.name?
The second parameter is optional *if* you always call setInstructions from the same worldscript. If you had, say, a ship script that needed to update the instructions you added via your worldscript, you would need the extra parameter so Oolite can know which instructions you are updating. Otherwise, you'd end up with two instructions on the manifest page.
That has previously been my understanding, but can anyone provide a working example? (Of world-script B altering an instruction left by world-script A.)
I have a vague memory of trying to do this, back in February or March, when I was messing with GalDrive Programmers, and it failing miserably. Thereupon I decided the Dokumentation might possibly be interpreted as aspirational.
That has previously been my understanding, but can anyone provide a working example? (Of world-script B altering an instruction left by world-script A.)
Contracts on Bulletin Board has to use other keys to update instructions for the "Escort Contracts" and "Random Hits" OXPs.