Coder Social home page Coder Social logo

Cargo/Commodity Transfer event about eddi HOT 5 CLOSED

Darkcyde13 avatar Darkcyde13 commented on August 16, 2024
Cargo/Commodity Transfer event

from eddi.

Comments (5)

Darkcyde13 avatar Darkcyde13 commented on August 16, 2024 1

..and I've realised I got some code wrong at the end. πŸ˜…

Update the last two code blocks to:

{if len(toCarrier) > 0:
    {if len(toShip) > 0: and}
    {List(toCarrier)} to {OneOf(carrier.name, "your carrier")}
    {_ Can you only transfer to your carrier? Or to others? _}
}

{if len(toSRV) > 0:
    {if len(toShip) > 0: and}
    {List(toSRV)} to your SRV
}.

You'll only be able to transfer between your ship and carrier, OR ship and SRV, not all three at the same time!

from eddi.

Tkael avatar Tkael commented on August 16, 2024 1

There was some internal discussion about implementing this event after it was introduced. The conclusion at the time was that the CargoTransfer event is followed by a Cargo event which is more complete. In particular, I believe the CargoTransfer event includes missionID information but seems to exclude information about whether the cargo was legally obtained (which is important information that the Cargo Monitor needs to be able to track).

In contrast, the Cargo event only captures the cargo for the current vehicle (ship or SRV) and doesn't tell us where cargo - just that it is no longer attached to the current vehicle. Neither event alone gives us quite everything we would want. :-)

It would introduce some additional complexity but one potential solution would be to capture and delay the CargoTransfer event until after we see the Cargo event then handle both events concurrently (though you can see that this adds some complexity). πŸ€”

from eddi.

Tkael avatar Tkael commented on August 16, 2024 1

from eddi.

Darkcyde13 avatar Darkcyde13 commented on August 16, 2024

Hmm, I've looked at some Cargo events this evening, but they have practically no information at all...

{ "timestamp":"2024-06-17T21:30:58Z", "event":"CargoTransfer", "Transfers":[ { "Type":"metaalloys", "Type_Localised":"Meta-Alloys", "Count":2, "Direction":"tocarrier" } ] }
{ "timestamp":"2024-06-17T21:31:01Z", "event":"Cargo", "Vessel":"Ship", "Count":0 }
{ "timestamp":"2024-06-17T21:26:23Z", "event":"CargoTransfer", "Transfers":[ { "Type":"metaalloys", "Type_Localised":"Meta-Alloys", "Count":2, "Direction":"toship" } ] }
{ "timestamp":"2024-06-17T21:26:25Z", "event":"Cargo", "Vessel":"Ship", "Count":2 }
{ "timestamp":"2024-06-16T16:33:25Z", "event":"CargoTransfer", "Transfers":[ { "Type":"ancientrelictg", "Type_Localised":"Unclassified Relic", "Count":1, "Direction":"toship" }, { "Type":"thargoidtissuesampletype5", "Type_Localised":"Thargoid Orthrus Tissue Sample", "Count":1, "Direction":"toship" }, { "Type":"thargoidtissuesampletype6", "Type_Localised":"Thargoid Glaive Tissue Sample", "Count":2, "Direction":"toship" }, { "Type":"thargoidheart", "Type_Localised":"Thargoid Heart", "Count":1, "Direction":"toship" }, { "Type":"unknownartifact", "Type_Localised":"Thargoid Sensor", "Count":1, "Direction":"toship" }, { "Type":"thargoidtissuesampletype9b", "Type_Localised":"Titan Tissue Sample", "Count":1, "Direction":"toship" } ] }
{ "timestamp":"2024-06-16T16:33:28Z", "event":"Cargo", "Vessel":"Ship", "Count":7 }

It seems that the CargoTransfer entry has much more information. Granted, it doesn't appear to give much more than the name of the commodity, the amount, and the direction it goes to, but the Cargo entry only gives the total amount, nothing else.

How about adding it, but have no default script, just leave it blank like several others in the default personality? That way, it won't be noticed by users who don't modify scripts, and those who know what they're doing, will understand its limitations.

from eddi.

Darkcyde13 avatar Darkcyde13 commented on August 16, 2024

The cargo event signals that cargo.json has been updated (written to the same location as your player journals). You need to read that file to get the full benefit from the cargo event. :-)

Doh! Of course! Sorry about that, I keep forgetting there are other files, other than the Journal.

Well, I mainly wanted it so I could use it as a trigger to run the new 'Corrosive Cargo' script that Yianniv and myself have been working on, but I thought it would be a nice addition for others too, especially when doing a 'transfer all' to get a readout of what was moved. In my case, it would seem to definitely benefit from being delayed until after the Cargo event, otherwise the cargo readout would probably be inaccurate.

For now, I'll just leave the trigger for our script to the Liftoff and Undocked events. Thinking about it, they will be just as good there, as it will still give a player time to re-dock to fix it, or carry on regardless.

Still, if it does get added at a later date, I'll be able to look again at this. Thanks anyway! πŸ™‚

from eddi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.