EDDI icon indicating copy to clipboard operation
EDDI copied to clipboard

Implement a CarrierDetails() function

Open Darkcyde13 opened this issue 2 years ago • 3 comments

What happens now

There doesn't appear to be any way to obtain details on your fleet carrier.

What I'd like to happen

Have a CarrierDetails() function to provide these details.

How it can happen

Parse the CarrierStats Journal entry to create the CarrierDetails() function, that would allow all carrier information to be available to EDDI scripting.

Example of the CarrierStats Journal entry:

{ "timestamp":"2022-06-26T11:58:01Z", "event":"CarrierStats", "CarrierID":3705241088, "Callsign":"XZX-84Z", "Name":"MCRN SUSTENTUS FEREBAT", "DockingAccess":"all", "AllowNotorious":true, "FuelLevel":376, "JumpRangeCurr":500.000000, "JumpRangeMax":500.000000, "PendingDecommission":false, "SpaceUsage":{ "TotalCapacity":25000, "Crew":930, "Cargo":0, "CargoSpaceReserved":0, "ShipPacks":0, "ModulePacks":0, "FreeSpace":24070 }, "Finance":{ "CarrierBalance":1027000141, "ReserveBalance":10090001, "AvailableBalance":1016910140, "ReservePercent":1, "TaxRate_rearm":5, "TaxRate_refuel":5, "TaxRate_repair":5 }, "Crew":[ { "CrewRole":"BlackMarket", "Activated":false }, { "CrewRole":"Captain", "Activated":true, "Enabled":true, "CrewName":"Brant Dyer" }, { "CrewRole":"Refuel", "Activated":true, "Enabled":true, "CrewName":"Linnea Travis" }, { "CrewRole":"Repair", "Activated":true, "Enabled":true, "CrewName":"Hugh Morris" }, { "CrewRole":"Rearm", "Activated":true, "Enabled":true, "CrewName":"Mauricio Wise" }, { "CrewRole":"Commodities", "Activated":true, "Enabled":true, "CrewName":"Viola Sexton" }, { "CrewRole":"VoucherRedemption", "Activated":false }, { "CrewRole":"Exploration", "Activated":false }, { "CrewRole":"Shipyard", "Activated":false }, { "CrewRole":"Outfitting", "Activated":false }, { "CrewRole":"CarrierFuel", "Activated":true, "Enabled":true, "CrewName":"Kimberly Evans" }, { "CrewRole":"VistaGenomics", "Activated":false }, { "CrewRole":"PioneerSupplies", "Activated":false }, { "CrewRole":"Bartender", "Activated":false } ], "ShipPacks":[  ], "ModulePacks":[  ] }

At the moment, I only have the default services, plus rearm, refuel, and repair installed, so the above example doesn't show what the other services data would look like (Vista Genomics, Redemption Office, Bar, etc).

I notice that the 'Crew' variable under SpaceUsage, is the total space used by the services I have installed.

If you need additional info, I can always go add all services, and get some cargo too, to hopefully fill out the event with complete details.

EDDI Version

v4.0.1

Darkcyde13 avatar Jun 26 '22 12:06 Darkcyde13

There's a queryable Frontier API endpoint (which I believe would contain somewhat similar information). A CarrierDetails() function would probably pull from that. For CarrierStats, we'd probably just do a Carrier stats event.

I'm honestly not sure how much use I'd get out of the information if the data were available. How would you use it? Are there any secondary events that we could generate (by monitoring changes in carrier stats) which might be worthwhile?

Tkael avatar Jun 26 '22 22:06 Tkael

Related: #1828

Tkael avatar Jun 26 '22 22:06 Tkael

Hmm, well I was thinking recently about getting EDDI to tell me how much Tritium would be used when a jump was requested. However, for that to be calculated, I'd need to know the jump mass of the carrier, and I can only find that in the Journal event (although I've not thought about the API call, as it's not the kind of thing I'd know about).

Now that you've asked, it occurs to me that you could possibly do something similar to existing scripts, like informing of carrier cargo that can be sold in the arrival system, or getting EDDI to say when services have been installed or uninstalled, paused or resumed. I know that last part is pretty obvious when you're doing them in game, but then so are many of EDDI's scripts (buying cargo, repairing, redeeming vouchers, etc). Naming the actual crew member assigned when purchasing services, would be nice too.

It would certainly be useful for obtaining your carrier's name, and enabling to use that instead of it's registration code all the time. A report that you've changed the name, as you get for your normal ships, would be another thing too.

I'm sure I could come up with some other things, in time. :)

Darkcyde13 avatar Jun 27 '22 18:06 Darkcyde13

I've added a top-level carrier object for the next release. Carrier cargo / material inventories are not yet supported but I've added another ticket (#2418) to allow us to circle back and add that functionality later.

Tkael avatar Nov 25 '22 08:11 Tkael