I want an unfriendly station, where dockside services are not available. How do I prevent or undo your OXP setting an interface on my station? Is there an array I can loop through and null them all? If not, why not? Is there a way to prevent them being set in the first place? Basically, the problem is this: you've installed the It's Not For Everyone OXP, when you dock at INFE Station, you should see only the interfaces set by the INFE OXP, and no others.
You can do station.setInterface("interface-name",null) to remove an interface.
The only core game interface which appears outside main stations is the "manage primable equipment" one - the logic being that it's not a station interface, it's a ship control, so it doesn't matter where you dock. Its key is "oolite-primable-equipment-manager" if you want to disable it anyway.
Wildeblood wrote:
Do interfaces have to be set from a world script [...] Are there any restrictions on the callback function of an interface?
No, and no.
Wildeblood wrote:
Lastly, if I have a reference to a station object, can I execute the callback function of an interface on that station while player.ship.docked === false or while docked at another station?
Yes, provided you retain a reference to the callback function somewhere you can reach.
Or the other option (depending on what you want to offer instead) could be to intercept opening the Interfaces screen for your station and then reroute it to a mission screen where you make your station-specific offers. It's perhaps not quite as elegant, but it works (see the Lave Academy station course offer screen for example, which intercepts the market screen).
I'm trying to write a js AI for a hoopy casino station that would make the ship do circles around the main station. I'm obviously not getting something, so maybe someone can help me here. This script just makes the ship zig-zag away from the main station.
The waypointsStationPatrol method picks the station to patrol around by:
1) if the ship is in a group, and the group has a leader, and the leader is a station, use that station
2) otherwise use the main station
The casino is a station, and likely the leader of its group by default. So it's probably trying to patrol in circles around itself.
The waypointsStationPatrol method picks the station to patrol around by:
1) if the ship is in a group, and the group has a leader, and the leader is a station, use that station
2) otherwise use the main station
The casino is a station, and likely the leader of its group by default. So it's probably trying to patrol in circles around itself.
produces "test1" too. It looks like running behaviourStationManageTraffic (or any other behaviour function?) does something that enables ai.conditionInCombat to be true. If I write my own finishing behaviour function, is there something that needs to be there for things to work? Something that initializes something?
It looks like running behaviourStationManageTraffic (or any other behaviour function?) does something that enables ai.conditionInCombat to be true. If I write my own finishing behaviour function, is there something that needs to be there for things to work? Something that initializes something?
Without these, the station won't have a "shipBeingAttacked" event handler, which means that it won't target its attacker, which means that conditionInCombat won't be true.
To begin with this will give you the standard station event handlers.
I've got things pretty much working the way I want, so it's up to finer details. This one gives me nothing but "null" to the log and I don't understand why.
The way I understand it, oolite_scanResultsSpecific should never be "null" in this case.
Found it. It's a typo in the wiki. It should be oolite_scanResultSpecific. Wiki fixed.
Another question about the "has_npc_traffic" in shipdata.plist. Wiki states that only rotating stations will launch traders. Is this correct and is there some simple reason for it? Is it also correct, if I assume that the moving casino cruiser will never get any NPC visitors by the populator?
Do oxps need an equipmentDestroyed handler, or is this event only triggered for core game scripts when the game is in strict mode ?
It shouldn't be necessary.
spara wrote:
Another question about the "has_npc_traffic" in shipdata.plist. Wiki states that only rotating stations will launch traders. Is this correct and is there some simple reason for it?
This is a leftover in the docs from 1.77's populator. In 1.80 the core populator determines whether to launch ships of any sort based just on the "has_npc_traffic" value, with the station's allegiance property used to determine which ships to launch. I'll update the docs.
spara wrote:
Is it also correct, if I assume that the moving casino cruiser will never get any NPC visitors by the populator?
This also depends on its allegiance. "private" is the correct value for a station which shouldn't get any normal NPCs docking (this doesn't stop you writing specific AIs which will dock with it anyway, though)
First question: can the player's ship be referenced in a shipdata.plist so that it would adjust to any ship the player is flying?
Second Question: Could someone point out a ship script to remove the ship after X seconds without affecting the AI?
Sidenote: While tweaking the OXP this will go towards, I did a little... combat testing, so to speak, at Ceesxe. G1. I undocked from the main station and swung around to point myself at the nearrby Super Hub to fire upon it. A single burst got me a sternly worded message to offline my weapons if I couldn't keep them from firing. Sustained fire... Well, Vipers launched from the main station, and along with the usual messages calling me out Vipers also started firing on the SuperHub! [shameless tease]I was simply flabbergasted and probably would've popped in a second if it weren't for my OXP![/shameless tease] As it was they got around to me in about ten seconds...
Got all turned around, lost my nav connection... Where am I now?