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

ActiveContainer picking only command module #13

Open
DaffyDuck501 opened this issue Dec 4, 2021 · 0 comments
Open

ActiveContainer picking only command module #13

DaffyDuck501 opened this issue Dec 4, 2021 · 0 comments

Comments

@DaffyDuck501
Copy link

Trying to make ActiveContainer() to pick other experiment storage containers on the Vessel:

ModuleScienceContainer ActiveContainer() // set the container to gather all science data inside, usualy this is the root command pod of the oldest vessel
        {
            //foreach (ModuleScienceContainer experimentContainer in GetContainerList())
            ModuleScienceContainer container = FlightGlobals.ActiveVessel.FindPartModulesImplementing<ModuleScienceContainer>().FirstOrDefault();
            Debug.Log(String.Join("; ", FlightGlobals.ActiveVessel.FindPartModulesImplementing<ModuleScienceContainer>()));
            Debug.Log("capacity: " + container.capacity);
            Debug.Log("status: " + container.status);
            Debug.Log("storageRange: " + container.storageRange);
            return container;
        }

But have no idea how to tell if container is full on storage with experiments. For default command module The Attribute 'storageRange' is a float with 1.3 and 'status' is considered as 'string' and shows how many experiments actually stored there ( for example '5').

The default command module in KSP has in fact 20 limit in storage. I don't get how this 20 is described in 1.3 float number. Can you please help on this one?

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

No branches or pull requests

1 participant