Thargoid Carrier NPC launching weirdness in 1.77

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Thargoid Carrier NPC launching weirdness in 1.77

Post by Commander McLane »

While I was looking for rock hermits, I just followed a Thargoid Carrier into a system and towards a secondary station, which was then attacked and eliminated.

However, a couple of times on the way, ordinary traders were launched from the carrier. That shouldn't happen. The carrier's shipdata have

Code: Select all

		<key>has_npc_traffic</key>
		<false/>
declared, and also the inquiry in the JS-console returned hasNPCTraffic as false.

This makes me ask whether something might be broken with has_npc_traffic in 1.77?
Last edited by Commander McLane on Tue Sep 10, 2013 2:25 pm, edited 1 time in total.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: has_npc_traffic not working in 1.77?

Post by cim »

Commander McLane wrote:
This makes me ask whether something might be broken with has_npc_traffic in 1.77?
It all looks correct in the current nightly build, and I don't think that code has changed since 1.77 was released. has_npc_traffic only prevents the default station update routines launching ships, though. Other possible sources:
- an OXP calling station.launchShipWithRole("trader") and selecting the carrier
- the carrier's AI has "launchIndependentShip:trader" in it (presumably not this one)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: has_npc_traffic not working in 1.77?

Post by Commander McLane »

Is it possible to distinguish the different possibilities by either examining the launched ships or the carrier during either stationLaunchedShip or acceptLaunchingRequestFrom?
Last edited by Commander McLane on Wed Sep 04, 2013 9:41 am, edited 1 time in total.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: has_npc_traffic not working in 1.77?

Post by cim »

Commander McLane wrote:
Is it possible to distinguish the different possibilities by either examining the launched ships or the carrier during either stationLaunchedShip or acceptDockingRequestFrom?
Not really - they all end up calling the same "launchIndependentShip" function in StationEntity.m - it's just that the "normal" route checks hasNPCTraffic first and the others (by necessity) don't.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: has_npc_traffic not working in 1.77?

Post by Eric Walch »

I also see no way the carrier could have launched them on its own, without an oxp script somewhere. Every automated launch, checks for hasNPCTraffic being true.

I did notice a wrong comment on settig up the initial trader count:

Code: Select all

docked_traders = 3 + (ranrot_rand() & 7);   // 1..3;
I assume, somewhere in the past, the number was increased. :)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: has_npc_traffic not working in 1.77?

Post by Commander McLane »

It's getting weirder.

On closer inspection, the traders are not launched from the carrier, but appear to be spawned right next to it. They all have exitingTraderAI.

I have now watched a carrier closely, and suddenly three traders popped into existence at about its current position, heading away from it as if they'd been launched, only that none of them originated from its docking bay. (Neither the carrier's stationLaunchedShip nor the dock's acceptLaunchingRequestFrom has fired.) Also, all three of them have the exact same spawnTime, so they were spawned as a triple.

Is there any OXP that would do that? Spawn traders randomly right next to a station, so that it appears as if they'd been launched, but they aren't? It certainly doesn't sound familiar to me.

Also, I've got a bunch of these in the log:

Code: Select all

11:35:14.096 [station.launchShip.failed]: Cancelled launch for a Python with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.252 [station.launchShip.failed]: Cancelled launch for a Caduceus Omega with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.253 [station.launchShip.failed]: Cancelled launch for a Cobra Courier with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.281 [station.launchShip.failed]: Cancelled launch for a Cobra Mark I with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.282 [station.launchShip.failed]: Cancelled launch for a Cobra Courier with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.284 [station.launchShip.failed]: Cancelled launch for a Cobra Mark III with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.320 [station.launchShip.failed]: Cancelled launch for a Cobra Mark III with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.414 [station.launchShip.failed]: Cancelled launch for a Armoured Transport Type1 with role trader, as it is too large for the docking port of the Thargoid Carrier.
11:35:14.415 [station.launchShip.failed]: Cancelled launch for a Cobra Courier SE with role trader, as it is too large for the docking port of the Thargoid Carrier.
None of these ships actually is to large for the carrier dock, which is quite a bit larger than a standard dock. So I guess hasNPCTraffic is indeed working, but the code returns the wrong reason.

Now another ship has appeared, this time visibly coming out of the carrier's dock. It's a Sidewinder escort, and it has another Sidewinder escort in its group, which is still docked, however I can investigate it via firstShip.group.ships[0]. The launched escort is in BEGIN_BUSINESS, the docked one still in GLOBAL. They don't have an owner, which I think is unusual for launching escorts. Both escorts' spawnTime is the same as for the traders. Additionally, the carrier dock's launchingQueueLength is 0, although the second escort hasn't launched yet. And still, neither the carrier's stationLaunchedShip nor the dock's acceptLaunchingRequestFrom has fired.

This begins to look like there is an invisible extra dock around (and sometimes inside) the carrier, or something like that.

Is there an equivalent to dockedStation for NPCs, or another way I could find out where the docked escort thinks it's docked? dockedStation isn't defined and returns nothing, owner returns null.

I'm still mystified.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Commander McLane »

As suggested by cim I'm now testing with the latest Mac-nightly (1.77.1-130908).

I have also removed all OXPs except the thargoid_carrier2.1.oxp, my own ship (impcourier2.oxp) and Hud.oxp, bioSphere.oxp, Superhubv1.0.oxp, Debug.oxp, and my custom keyconfig.plist.

Still, traders and escort groups without mothers launch from (or appear to be launching from) the carrier. Here's a screen shot showing what it looks like:
Image
The Sidewinder Scout Ship currently targeted is the last one of four escorts without a mother, still being in STATUS_LAUNCHED.

Meanwhile, I have this in the log:

Code: Select all

12:14:20.452 [station.launchShip.failed]: Cancelled launch for a Anaconda with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.453 [station.launchShip.failed]: Cancelled launch for a Python with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.456 [station.launchShip.failed]: Cancelled launch for a Python with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.459 [station.launchShip.failed]: Cancelled launch for a Cobra Mark III with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.460 [station.launchShip.failed]: Cancelled launch for a Python with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.463 [station.launchShip.failed]: Cancelled launch for a Python with role trader, as it is too large for the docking port of the Thargoid Carrier.
12:14:20.464 [station.launchShip.failed]: Cancelled launch for a Cobra Mark III with role trader, as it is too large for the docking port of the Thargoid Carrier.
It is possible that all the escorts that have launched are in fact escorts of the Anaconda and the Pythons whose launch had failed, and this would explain the escorts' lack of owners.

Why are the traders considered too large for the carrier's docking bay, especially as it's considerably larger than the standard docking bay? I have no idea.

Why is the game even trying to launch them in the first place? I have no idea, because

Code: Select all

> S.shipsWithRole("thargoid_carrier")[0].hasNPCTraffic
false
It gets weirder, though. Because I have put some logging into the carrier's scripts. This is in the carrier's ship script:

Code: Select all

this.stationLaunchedShip = function(ship)
{
    // some of the thargoids launched as defense ships can have escorts, which launch with a non-thargoid scanClass
    // in order to avoid this and the subsequent fighting amongst the thargoids, those are removed upon launch
    log("thargoidcarrier", "Thargoid Carrier launched " + ship);
    if(!ship.isThargoid && !ship.isPlayer)
    {
        ship.remove(true);
    }
}
(Note that this code should also remove any trader or escort upon launch, but only after they've been logged as launching.)

And this is in the carrier dock's ship script:

Code: Select all

this.acceptLaunchingRequestFrom = function(ship)
{
    log("thargoidcarrier", "Thargoid Carrier Dock got launching request from " + ship);
}
And here comes the weird part: there is nothing in the log. The excerpt from above is all there is. The carrier dock has not logged a launching request, and the carrier itself has not logged a launch event, even though the vicinity is filled with just-launched-escorts.

It is as if there is an invisible and undetectable entity right on top of the carrier that launches all these ships, except that the carrier itself illegally tries to launch traders. However, if there is a ghost entity involved, it is truly a ghost, because

Code: Select all

> S.allShips
[[PlayerShip "Imperial Courier" position: (-17288.6, -61382.6, 439549) scanClass: CLASS_PLAYER status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-19854.6, -59088.8, 438003) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-20670.1, -59606.4, 437257) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-19884.2, -57654.4, 439378) scanClass: CLASS_NEUTRAL status: STATUS_LAUNCHING], [Station "Thargoid Carrier" "Thargoid Carrier" position: (-20149.6, -57031.5, 439719) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-20167, -57087.3, 440252) scanClass: CLASS_NEUTRAL status: STATUS_LAUNCHING], [Ship "Sidewinder Scout Ship" position: (-20169.8, -57088.5, 440250) scanClass: CLASS_NEUTRAL status: STATUS_LAUNCHING], [Ship "Mamba Escort" position: (-20098.9, -56914.4, 440384) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-20114.9, -56920.9, 440372) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-20524.1, -57276.9, 440684) scanClass: CLASS_NEUTRAL status: STATUS_LAUNCHING], [Ship "Sidewinder Scout Ship" position: (-18846.9, -56204.9, 439878) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-20319.7, -57043.6, 440776) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-19438.5, -56273.3, 440329) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-19372, -55942.5, 439744) scanClass: CLASS_NEUTRAL status: STATUS_LAUNCHING], [Ship "Sidewinder Scout Ship" position: (-20022.8, -56399.5, 440945) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-22149.6, -61976.9, 436177) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-18619.8, -54735.4, 440776) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Boa Class Cruiser" position: (-16163.5, -56247.1, 434791) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Mamba Escort" position: (-19071.1, -54404.9, 438236) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-22547.7, -56166.4, 441516) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Thargoid Warship" position: (-15899, -55616.4, 444454) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT], [Ship "Thargoid Warship" position: (-15494.7, -54416.4, 434842) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT], [Ship "Thargoid Warship" position: (-24759.5, -59517.6, 443580) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-17511.7, -53706.3, 435267) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Sidewinder Scout Ship" position: (-16901.3, -53626.6, 435174) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Moray Medical Boat" position: (-16843.3, -54979.6, 433083) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Boa" position: (-16161.7, -53469.8, 435026) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], [Ship "Thargoid Warship" position: (-24354.1, -58315.7, 433956) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT], [Ship "Python" position: (-12147.8, -783.65, 461629) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT], ...
The final Python is the first ship that's not part of this constellation, and there is nothing in the immediate vicinity of the carrier that would also have a dock. I note, by the way, that there are some Boas and BCCs. These seem not too big for the carrier dock, but they still haven't triggered the carrier's stationLaunchedShip event.

I cannot but conclude that the bug lies either somewhere in thargoid_carrier2.1.oxp itself, or in Oolite. Other OXPs can be ruled out as culprits at this point, I believe.

One final piece of information: my Oolite has currently hiccups because of too many browser windows open. I was first flying alongside the carrier and everything seemed to be in order. Then I looked away for a second (or fraction thereof), and suddenly all the yellow blips had appeared. It didn't look as if all these ships had actually launched one after the other, which would have taken quite some time. So, there is the possibility that some mechanism spawned all those ships and made them appear as if being launched, without actually sending them to a launch queue. (Yet, the targeted escort does appear to be launching straight out of the docking bay. And yet, the log says that ships wanted to launch and were taken out of the queue.) I can't make sense of it.

Also, note this:

Code: Select all

> S.allShips[1].spawnTime
109.50740814208984
> S.allShips[2].spawnTime
109.50740814208984
> S.allShips[3].spawnTime
109.50740814208984
> S.allShips[4].spawnTime
49.50062561035156
> S.allShips[5].spawnTime
109.50740814208984
> S.allShips[6].spawnTime
109.50740814208984
> S.allShips[7].spawnTime
109.50740814208984
> S.allShips[8].spawnTime
109.50740814208984
> S.allShips[9].spawnTime
109.50740814208984
> S.allShips[10].spawnTime
109.50740814208984
(S.allShips[4] is the carrier.) All the mysterious traders and escorts have the exact same spawn time. They were created and spawned all at once, even though the log shows slightly different time stamps for the failed launches.

Is there any other useful information I can gather? I have the game still paused at the same point.



EDIT: One system reboot later (just in case there was a memory corruption involved), the problem persists. New symptom: the carrier can't launch Thargoids as defense ships anymore. At least the dock logging works:

Code: Select all

13:49:45.825 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
13:49:45.829 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
13:49:47.164 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
13:49:47.167 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
13:50:38.676 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
13:50:38.679 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
13:50:39.356 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
13:50:39.360 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
13:50:39.866 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
13:50:39.875 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
Launching of defense ships definitely worked in Oolite 1.76.1, and there were no code changes to the OXP since (except for the insertion of the log line).

Maybe something with the docking bay, or the way the docking bay is handled, broke between 1.76.1 and 1.77?

Also, I have now visually witnessed that traders + escorts don't actually launch from the carrier, but appear out of thin air around (and some maybe within) the carrier, each time as a complete group. Like they were the result of a spawn() command performed on the carrier. Except that spawn() wouldn't set up escorts, and Anacondas, Pythons, and Cobby IIIs are still reported as being removed from the launch queue by Oolite.

Hypothesis: Can the problem be related to the code for multiple docks that's new in 1.77?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by cim »

Ah. Oh. Right.

So.... all stations must have at least one dock subentity. If they do not have one, they get a virtual dock subentity created for them (for backward compatibility with the very old way of doing docks). Fine. The Thargoid Carrier has a dock subentity anyway.

Any entity without an explicit isCarrier set, again for backward compatibility, gets the decision as to whether it is a station or not decided by whether its shipdata key contains the string "carrier" or "station".

The Thargoid Carrier subentities are all called "thargoid-carrier-something". So each of them is a StationEntity in its own right (a long-standing bug). But now, in 1.77, that means they get their own virtual dock entity, which can launch its own ships (and none of the subentities have has_npc_traffic = false, so they will just launch traders randomly)

So it's - with varying degrees of success - launching ships out of its turrets and lasers.

Workaround for 1.77: stick an explicit "isCarrier = false" in the subent definitions. I'll put a fix together for 1.77.1
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Commander McLane »

cim wrote:
Any entity without an explicit isCarrier set, again for backward compatibility, gets the decision as to whether it is a station or not decided by whether its shipdata key contains the string "carrier" or "station".
It's funny. I vaguely remember that was wondering back at the time whether having "carrier" in the shipdata keys could be harmful, but I knew only about a special treatment of "station", so I decided it would be safe (and it was up until 1.76).

So I have currently inserted the explicit isCarrier = no to the subentities (there are only three of them, anyway). Alternatively (or additionally), I could also rename the shipdata keys for the subents, replacing the string "carrier" with something else. An abbreviation like "carr" should suffice.

EDIT: so far no more launching of civilian ships. :D However, I still get this, which has me still puzzled, when the carrier tries to launch its defenses:
23:49:40.032 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
23:49:40.033 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
23:49:40.142 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
23:49:40.143 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
23:49:40.252 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
23:49:40.255 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
23:49:40.362 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
23:49:40.365 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
23:49:40.472 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
23:49:40.475 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Diziet Sma »

cim wrote:
So it's - with varying degrees of success - launching ships out of its turrets and lasers.
That's quite funny, actually.. :lol:
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Commander McLane »

Any idea why the carrier can't launch warships anymore through its actual dock? The odd thing is that I have watched it launch an attack on a station in 1.77 already. Now it can't anymore, at least with trunk. I'll return to trying it with 1.77-test.

Aaaaaaaand, it doesn't work in 1.77-test either. No launching anything. It appears that the docking bay has effectively size 0, as I'm trying to launch smaller and smaller things from the console:

Code: Select all

12:44:03.597 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Warship" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
12:44:03.598 [station.launchShip.failed]: Cancelled launch for a Thargoid Warship with role thargoid, as it is too large for the docking port of the Thargoid Carrier.
12:46:01.155 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Thargoid Robot Fighter" position: (0, 0, 0) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT]
12:46:01.157 [station.launchShip.failed]: Cancelled launch for a Thargoid Robot Fighter with role tharglet, as it is too large for the docking port of the Thargoid Carrier.
12:46:22.977 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Orbital Shuttle" position: (0, 0, 0) scanClass: CLASS_NOT_SET status: STATUS_IN_FLIGHT]
12:46:22.985 [station.launchShip.failed]: Cancelled launch for a Shuttle with role shuttle, as it is too large for the docking port of the Thargoid Carrier.
12:46:52.422 [thargoidcarrier]: Thargoid Carrier Dock got launching request from [Ship "Metal fragment" position: (0, 0, 0) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT]
12:46:52.424 [station.launchShip.failed]: Cancelled launch for a Metallfragment with role alloy, as it is too large for the docking port of the Thargoid Carrier.
Here's a snapshot of the current shipdata, in case I've made a really dumb mistake in there:

Code: Select all

	<key>thargoid-carr-dock</key>
	<dict>
		<key>ai_type</key>
		<string>nullAI.plist</string>
		<key>isCarrier</key>
		<false/>
		<key>is_Dock</key>
		<true/>
		<key>model</key>
		<string>thargoid-carrier-dock.dat</string>
		<key>name</key>
		<string>Thargoid Carrier Dock</string>
		<key>roles</key>
		<string>thargoid_carrier_dock</string>
		<key>script</key>
		<string>thargoid-carrier-dock-script.js</string>
	</dict>
	<key>thargoid-carrier</key>
	<dict>
		<key>ai_type</key>
		<string>thargoidCarrierAI.plist</string>
		<key>bounty</key>
		<integer>2000</integer>
		<key>cargo_type</key>
		<string>CARGO_NOT_CARGO</string>
		<key>defense_ship_role</key>
		<string>thargoid</string>
		<key>energy_recharge_rate</key>
		<integer>15</integer>
		<key>equipment_price_factor</key>
		<integer>5</integer>
		<key>equivalent_tech_level</key>
		<integer>14</integer>
		<key>escort_role</key>
		<string>thargoid</string>
		<key>escorts</key>
		<integer>4</integer>
		<key>exhaust</key>
		<array/>
		<key>frangible</key>
		<false/>
		<key>has_ecm</key>
		<true/>
		<key>has_npc_traffic</key>
		<false/>
		<key>has_shield_enhancer</key>
		<true/>
		<key>isCarrier</key>
		<true/>
		<key>laser_color</key>
		<string>greenColor</string>
		<key>likely_cargo</key>
		<integer>5</integer>
		<key>max_cargo</key>
		<integer>10</integer>
		<key>max_defense_ships</key>
		<integer>10</integer>
		<key>max_energy</key>
		<integer>2244</integer>
		<key>max_flight_pitch</key>
		<real>0.20000000000000001</real>
		<key>max_flight_roll</key>
		<real>0.29999999999999999</real>
		<key>max_flight_speed</key>
		<integer>280</integer>
		<key>max_police</key>
		<integer>0</integer>
		<key>max_scavengers</key>
		<integer>0</integer>
		<key>missiles</key>
		<integer>0</integer>
		<key>model</key>
		<string>thargoid-carrier.dat</string>
		<key>name</key>
		<string>Thargoid Carrier</string>
		<key>roles</key>
		<string>thargoid_carrier thargoid-mothership</string>
		<key>scanClass</key>
		<string>CLASS_THARGOID</string>
		<key>scanner_range</key>
		<string>60000</string>
		<key>script</key>
		<string>thargoid-carrier-script.js</string>
		<key>subentities</key>
		<array>
			<string>thargoid-carr-dock 0 61.2 333.8 1 0 0 0</string>
			<string>thargoid-carr-turret 1189.90615 -121.885307 -145.432953 0.707 -0.707 0 0</string>
			<string>thargoid-carr-turret -1189.944519 -121.885307 -145.625755 0.707 -0.707 0 0</string>
			<string>thargoid-carr-turret -0.019142 -120.755669 -225.021721 0.707 -0.707 0 0</string>
			<string>thargoid-carr-turret 0.019135 230.619476 -76.419571 0.707 0.707 0 0</string>
			<string>thargoid-carr-turret 1065.524559 104.392685 -76.419571 0.706 0.706 -0.030 0.030</string>
			<string>thargoid-carr-turret -1065.562858 104.392685 -76.419571 0.706 0.706 0.030 -0.030</string>
			<string>thargoid-carr-turret 360.060069 15.689352 480.764536 1 0 0 0</string>
			<string>thargoid-carr-turret -360.03894 15.689352 480.764536 1 0 0 0</string>
			<string>thargoid-carr-turret 519.663330 -21.834106 -831.576843 0 0 1 0</string>
			<string>thargoid-carr-turret -519.701599 -21.834106 -831.576843 0 0 1 0</string>
			<string>thargoid-carr-laser 0 1 0 1 0 0 0</string>
			<string>thargoid-carr-laser -1 -1 0 1 0 0 0</string>
			<string>thargoid-carr-laser 1 -1 0 1 0 0 0</string>
		</array>
		<key>thrust</key>
		<integer>70</integer>
		<key>weapon_energy</key>
		<integer>40</integer>
	</dict>
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by cim »

Commander McLane wrote:

Code: Select all

	<key>thargoid-carr-dock</key>
	<dict>
		<key>is_Dock</key>
		<true/>
	</dict>
The only obvious mistake is that there's no such property. The property is called is_dock and it goes in the new-style subentity definition for the main entity, not in the entity definition for the subentity.

However that shouldn't make any difference - with the old-style subentity definition, "dock" in the name is what makes it a dock. I've just spawned a Thargoid carrier from your OXP in the latest 1.77.1 trunk build, and after shooting it a bit it launched five warships without errors, and then rammed the main station.

What does thargoidcarrier.subEntities report in the debug console?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Commander McLane »

I had only put in the false is_dock right now to make absolutely sure that this would be the dock.

Anyway, I have just reverted to v2.0 of the OXP, and that carrier launches thargoids (but the launched traders/escorts are back as well). So, I'm now going to revisit every change I've made to the OXP since the release version. One of them (or some combination) must be responsible for the weird behaviour.

Okay, that was quick. I've got the culprit: it's the docking bay's ship script. When I remove the script key from thargoid-carr-dock, everything is in order. When I add it back, I get the above mentioned logging, but the docking bay becomes unable to launch anything.

I think that's not an intended side-effect of a subentity ship script. :roll:

And just for completeness' sake, here's the carriers subentities as seen from the console:

Code: Select all

[[Dock "Thargoid Carrier Dock" position: (0, 61.2, 333.8) (subentity)], [Ship "Thargoid Carrier Turret" position: (1189.91, -121.885, -145.433) (turret)], [Ship "Thargoid Carrier Turret" position: (-1189.94, -121.885, -145.626) (turret)], [Ship "Thargoid Carrier Turret" position: (-0.019142, -120.756, -225.022) (turret)], [Ship "Thargoid Carrier Turret" position: (0.019135, 230.619, -76.4196) (turret)], [Ship "Thargoid Carrier Turret" position: (1065.52, 104.393, -76.4196) (turret)], [Ship "Thargoid Carrier Turret" position: (-1065.56, 104.393, -76.4196) (turret)], [Ship "Thargoid Carrier Turret" position: (360.06, 15.6894, 480.765) (turret)], [Ship "Thargoid Carrier Turret" position: (-360.039, 15.6894, 480.765) (turret)], [Ship "Thargoid Carrier Turret" position: (519.663, -21.8341, -831.577) (turret)], [Ship "Thargoid Carrier Turret" position: (-519.702, -21.8341, -831.577) (turret)], [Ship "Thargoid Carrier Laser" position: (0, 1, 0) (subentity)], [Ship "Thargoid Carrier Laser" position: (-1, -1, 0) (subentity)], [Ship "Thargoid Carrier Laser" position: (1, -1, 0) (subentity)]]
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Mauiby de Fug »

cim wrote:
Ah. Oh. Right.

So.... all stations must have at least one dock subentity. If they do not have one, they get a virtual dock subentity created for them (for backward compatibility with the very old way of doing docks). Fine. The Thargoid Carrier has a dock subentity anyway.

Any entity without an explicit isCarrier set, again for backward compatibility, gets the decision as to whether it is a station or not decided by whether its shipdata key contains the string "carrier" or "station".

The Thargoid Carrier subentities are all called "thargoid-carrier-something". So each of them is a StationEntity in its own right (a long-standing bug). But now, in 1.77, that means they get their own virtual dock entity, which can launch its own ships (and none of the subentities have has_npc_traffic = false, so they will just launch traders randomly)

So it's - with varying degrees of success - launching ships out of its turrets and lasers.

Workaround for 1.77: stick an explicit "isCarrier = false" in the subent definitions. I'll put a fix together for 1.77.1
Ah! This potentially explains this then!

Code: Select all

20:07:27.192 [station.launchShip.failed]: Cancelled launch for a Cobra Clipper with role trader, as it is too large for the docking port of the Globe Shell.
20:14:08.858 [station.launchShip.failed]: Cancelled launch for a Fugu Tanker with role trader, as it is too large for the docking port of the Globe Shell.
The "Globe Shell" is actually a dock-less sub-entity of the Globe Station, with shipdata key globestation_ball...
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Thargoid Carrier NPC launching weirdness in 1.77

Post by Svengali »

Mauiby de Fug wrote:
Ah! This potentially explains this then!

Code: Select all

20:07:27.192 [station.launchShip.failed]: Cancelled launch for a Cobra Clipper with role trader, as it is too large for the docking port of the Globe Shell.
20:14:08.858 [station.launchShip.failed]: Cancelled launch for a Fugu Tanker with role trader, as it is too large for the docking port of the Globe Shell.
The "Globe Shell" is actually a dock-less sub-entity of the Globe Station, with shipdata key globestation_ball...
Probably. Although the globestation uses the new declaration (at least v2.x)
Post Reply