For Science!

For Science!

160k Downloads

ActiveContainer picking only command module

DaffyDuck501 opened this issue ยท 0 comments

commented

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?