Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include 'missing?' Loadout event properties in 'state' #2347

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

colsw
Copy link

@colsw colsw commented Dec 27, 2024

Description

Adds the following stats which are present in the 'Loadout' event to the 'state' for journal_update:

"UnladenMass": float,
"CargoCapacity": int,
"MaxJumpRange": float,
"FuelCapacity": {
	"Main": float, //could probably be int?
	"Reserve": float
}

Also updates the Plugins Readme to match the changes.

Type of Change

Enhancement to existing 'state' tracking feature.

How Tested

First submission so no serious regression testing, thanks in advance for the review.

Tested that any permanent changes to these properties should be accompanied by another 'Loadout' event, meaning adding them should never result in odd desyncs with the actual game state, please correct me if I'm wrong.

Compiled EDMC with changes and verified state properly contains the new values when I dump state:

{
    "ShipID": 17,
    "ShipIdent": "--x5--",
    "ShipName": "purposeless",
    "ShipType": "krait_light",
    "HullValue": 31422965,
    "ModulesValue": 62399627,
    "UnladenMass": 511.5,
    "CargoCapacity": 32,
    "MaxJumpRange": 52.789223,
    "FuelCapacity": {
        "Main": 32.0,
        "Reserve": 0.63
    }
}

Notes

briefly discussed in EDCD Discord's edmc-plugins channel, couldn't find any open issues referencing this.
This PR may be completely unnecessary, but I couldn't find any other way of accessing these in a tracked state within EDMC, and they are very useful to have for a variety of funcitons, the cargo-manifest plugin is a good example of something that could be greatly simplified and future-proofed with this.
If these stats are otherwise accessible or should not be tracked in this manner for some reason please let me know and I'll update the plugins readme instead, as it currently claims:

In this case you won't receive initial events such as "LoadGame", "Rank", "Location", etc. However, the state dictionary will reflect the cumulative effect of these missed events.

And already tracks the majority of stats within Loadout, with this only the 'HullHealth' and 'Hot' values would inaccessible from state, and both are probably better sourced from other events, and are more prone to desync.

TIA for the response!

Added properties of the loadout event which are missing from state: UnladenMass, CargoCapacity, MaxJumpRange, and FuelCapacity
update state table to match newly added values from loadout events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant