Jump to content

[1.8] Station Science continued (v2.6.0)


tomf

Recommended Posts

24 minutes ago, GrimT said:

Version 1.8 of the mod and the most 1.8 of KSP.  This career was actually started on 1.7 and I noticed all of the mods I use were updated to 1.8 so gave a mid-game upgrade a shot because of the performance upgrades the new update provided.

It could be the same problem as I had... at least your first description could suggest, not your P.S., so let us confirm things:

On 1/30/2020 at 6:08 AM, GrimT said:

... and recovered the craft with the science however the contract still states that the experiment wasn't completed...

edit: ...so long as the creature comforts experiment is attached to the station the criteria for the contract is met. As soon as I undock the experiment to dock with my return craft, it is no longer considered complete.

Does the contract have the "Complete in orbit..." checked (like on my picture - click the spoiler) when you have the ship with the experiment active?
I have seen it temporarily uncheck when undocking, but only because the station became active, it got the check again when I focused the return probe.

The real problem for me was that it would not complete the contract on recovery ... which I hopefuly fixed (wait for official release).

 

 

Edited by firda
Link to comment
Share on other sites

36 minutes ago, firda said:

It could be the same problem as I had... at least your first description could suggest, not your P.S., so let us confirm things:

Does the contract have the "Complete in orbit..." checked (like on my picture - click the spoiler) when you have the ship with the experiment active?
I have seen it temporarily uncheck when undocking, but only because the station became active, it got the check again when I focused the return probe.

The real problem for me was that it would not complete the contract on recovery ... which I hopefuly fixed (wait for official release).

 

 

Dont see your spoiler but yes, the criteria "complete in orbit..." was checked, when I undocked the science experiment the criteria would uncheck and the contract would no longer be available to complete, because the next criteria was to return that experiment to Kerbin.

Link to comment
Share on other sites

10 hours ago, GrimT said:

Dont see your spoiler but yes, the criteria "complete in orbit..." was checked, when I undocked the science experiment the criteria would uncheck and the contract would no longer be available to complete, because the next criteria was to return that experiment to Kerbin.

I specifically asked if you had the ship with the experiment active + I have seen it temporarily uncheck when undocking, but only because the station became active, it got the check again when I focused the return probe, (switched to)
because I know the exact line in the code that is doing this (and the spoiler-wrapped image is in my first post, doing that to keep the posts smaller).


StnSciParameters.cs: DoExperimentParameter.OnUpdate() last statement is SetIncomplete() (executed if not set complete inside the loop, which requires active vessel having the experiment)

Spoiler

https://github.com/tomforwood/StationScience/blob/master/StnSciParameters.cs#L311


        protected override void OnUpdate()
        {
            base.OnUpdate();
            if (lastUpdate > UnityEngine.Time.realtimeSinceStartup + .1)
                return;
            CelestialBody targetBody = StnSciParameter.getTargetBody(this);
            AvailablePart experimentType = StnSciParameter.getExperimentType(this);
            if (targetBody == null || experimentType == null)
            if (targetBody == null || experimentType == null)
            {
                return;
            }
            lastUpdate = UnityEngine.Time.realtimeSinceStartup;
            Vessel vessel = FlightGlobals.ActiveVessel;
            if (vessel != null)
                foreach (Part part in vessel.Parts)
                {
                    if (part.name == experimentType.name)
                    {
                        StationExperiment e = part.FindModuleImplementing<StationExperiment>();
                        if (e != null)
                        {
                            if (e.completed >= this.Root.DateAccepted && e.completed > e.launched)
                            {
                                ScienceData[] data = e.GetData();
                                foreach (ScienceData datum in data)
                                {
                                    if (datum.subjectID.ToLower().Contains("@" + targetBody.name.ToLower() + "inspace"))
                                    {
                                        SetComplete();
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            SetIncomplete();
        }

BTW: the ' if (targetBody == null || experimentType == null) ' is duplicit.

Could be the source of the problems you have (if it really does not check again when you switch to the proper ship), but I am not touching that part of the code, could break something.

Link to comment
Share on other sites

7 hours ago, firda said:

I specifically asked if you had the ship with the experiment active + I have seen it temporarily uncheck when undocking, but only because the station became active, it got the check again when I focused the return probe, (switched to)
because I know the exact line in the code that is doing this (and the spoiler-wrapped image is in my first post, doing that to keep the posts smaller).


StnSciParameters.cs: DoExperimentParameter.OnUpdate() last statement is SetIncomplete() (executed if not set complete inside the loop, which requires active vessel having the experiment)

  Reveal hidden contents

https://github.com/tomforwood/StationScience/blob/master/StnSciParameters.cs#L311



        protected override void OnUpdate()
        {
            base.OnUpdate();
            if (lastUpdate > UnityEngine.Time.realtimeSinceStartup + .1)
                return;
            CelestialBody targetBody = StnSciParameter.getTargetBody(this);
            AvailablePart experimentType = StnSciParameter.getExperimentType(this);
            if (targetBody == null || experimentType == null)
            if (targetBody == null || experimentType == null)
            {
                return;
            }
            lastUpdate = UnityEngine.Time.realtimeSinceStartup;
            Vessel vessel = FlightGlobals.ActiveVessel;
            if (vessel != null)
                foreach (Part part in vessel.Parts)
                {
                    if (part.name == experimentType.name)
                    {
                        StationExperiment e = part.FindModuleImplementing<StationExperiment>();
                        if (e != null)
                        {
                            if (e.completed >= this.Root.DateAccepted && e.completed > e.launched)
                            {
                                ScienceData[] data = e.GetData();
                                foreach (ScienceData datum in data)
                                {
                                    if (datum.subjectID.ToLower().Contains("@" + targetBody.name.ToLower() + "inspace"))
                                    {
                                        SetComplete();
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            SetIncomplete();
        }

BTW: the ' if (targetBody == null || experimentType == null) ' is duplicit.

Could be the source of the problems you have (if it really does not check again when you switch to the proper ship), but I am not touching that part of the code, could break something.

So yes, the vessel that contained the experiment was active, both while docked with the station and after undocking (transitioned to the active vessel) and I would observe it uncheck that criteria on the contract.  Switching between vehicles did not change whether the criteria was met via contract.  Either way, I cheat moded it completed after returning with the vehicle (performing the physical requirements of the contract).

I'll try your suggestion with the other experiment contract I have for the same station when I have a chance, if it reproduces, I'll give your dll a try and see if that resolves the issue for the sake of troubleshooting, and the effort you've put in to assist me.  Thanks again

Link to comment
Share on other sites

  • 4 weeks later...

@tomf Any update on this? I did fix the accept/finish-problem for myself (PR still pending), but I have different problem: looks like the contract is rarely generated,
StnSciContract.MeetRequirements is almost never even called by KSP and the SetExpiry inside Generate uses default 1-7 days which makes it even harder to spot any contract if it gets generated,
making the probability of getting any contract miniscule. I am new to all this stuff (contracts), any idea?

EDIT: Looks like my "hard" game is was somehow broken, it works in my "default" (and now in that "hard" as well - talking about my build).

Edited by firda
Link to comment
Share on other sites

On 2/4/2020 at 3:31 PM, GrimT said:

.. I'll give your dll a try and see if that resolves the issue for the sake of troubleshooting, and the effort you've put in to assist me.  Thanks again

 

On 2/26/2020 at 6:33 PM, Carquinyoli said:

I have the same problem, the objective unchecks after undocking, and does not come back after switching to the ship with the experiment. How did you fix it, GrimT?

Cannot help with the "does not come back after switching to the ship with the experiment" unless you use my debug version and provide more info (PM me),
but the release build works for me: https://github.com/firdacz/StationScience/tree/master/Kerbal Space Program/GameData/StationScience
(just finished one experiment and got two new .... not sure what was wrong with my "hard" game, had to edit the save to remove some tourists not connected to any contract)

P.S.: Debug dll here: https://github.com/firdacz/StationScience/raw/debug/GameData/StationScience/Plugins/StationScience.dll

Edited by firda
Link to comment
Share on other sites

I managed to get around the unchecking thing by selecting "control from here" for the capsule of the ship that carries the experiment, so after undocking it remains active. This way, the objective does not uncheck, but after returning the experiment to Kerbin, the contract does not complete. I recover the capsule and the part with the experiment, and the contract reverts to all objectives unchecked. I installed it from CKAN, I can try to remove it and install the github version, in case that they are not the same.

About the debug, I'm not sure how I should use it. Thank you for your help, by the way.

Link to comment
Share on other sites

22 hours ago, Carquinyoli said:

I managed to get around the unchecking thing by selecting "control from here" for the capsule of the ship that carries the experiment, so after undocking it remains active. This way, the objective does not uncheck, but after returning the experiment to Kerbin, the contract does not complete. I recover the capsule and the part with the experiment, and the contract reverts to all objectives unchecked. I installed it from CKAN, I can try to remove it and install the github version, in case that they are not the same.

About the debug, I'm not sure how I should use it. Thank you for your help, by the way.

To be clear: I am not the maintainer of this mod, just a programmer/modder that found a problem (recover not working) and fixed it for myself (and created PR in original repo).
I never had problems with switching ships (it just checks again), so my version may still not work for you, but you can give it a try (it works in my game).
As for the debug build - it prints something into KSP.log that could help identify problems. I can add some more printouts specifically for the problem of switching ships
(send me private message if you want help, I do not want to polute it here).

Link to comment
Share on other sites

I have a problem with this mod. I'm playing 1.9 at the moment.

I get the contract to perform the plant growth experiment around the mun and then recover it at Kerbin.

 

I finish the experiment, green tick, all good, then i fly back to Kerbin, not switching focus to any other craft on the way back, land on Kerbin, no green tick mark. I recover the vessel, and nothing, contract still open. I've also tried going back to the space center to recover the vessel but nothing is working.

Is this a mod error? Or have I missed something?

Link to comment
Share on other sites

2 hours ago, SpartanV said:

I have a problem with this mod. I'm playing 1.9 at the moment.

I get the contract to perform the plant growth experiment around the mun and then recover it at Kerbin.

 

I finish the experiment, green tick, all good, then i fly back to Kerbin, not switching focus to any other craft on the way back, land on Kerbin, no green tick mark. I recover the vessel, and nothing, contract still open. I've also tried going back to the space center to recover the vessel but nothing is working.

Is this a mod error? Or have I missed something?

Read about same issue and possible solution fixes just one page back. Most recent solution until it is merged to main mod repository is on this post:

 

Link to comment
Share on other sites

6 hours ago, SpartanV said:

I finish the experiment, green tick, all good, then i fly back to Kerbin, not switching focus to any other craft on the way back, land on Kerbin, no green tick mark. I recover the vessel, and nothing, contract still open. I've also tried going back to the space center to recover the vessel but nothing is working.

I am playing with this build: https://github.com/firdacz/StationScience/tree/firda/GameData/StationScience
navigate to branch "firda" (if the link does not already) and copy the content of the directory, or at least the dll inside "Plugins" into KSP (overwriting the old one) - this is the version I currently play with and it works for me.

The "master" branch is there for the PR in original repo (minimal, not built, I am not the creator or maintainer of this mod), "debug" branch prints some diagnostics into KSP.log
Note that I rewrote it a lot to even be able to build it and then understand how it works, so "master" is really minimal change to the original, but you would have to build it from source yourself (firda and debug are built - ready for use).

Link to comment
Share on other sites

22 hours ago, firda said:

Thanks a lot. Your .dll works.
In my middle-heavy modded 1.81 Career Game.

Ok, 40 Minutes later: Finalize dont work,
Stock Icons disabled, Quick-Go-to dont work,
Stock-Scene-switching only works once after restart,
Transmit Science from MPLs dont work,
Asparagus stops connecting,
Research Planets dont inizialize,
MechJeb Ike-Ore-Transporter-Landing fails crazy,
EPL throws massive Errors in Log..

Also in Backup-Soft-Modded Game.

So much Mods stops working,
or get irritated...
Too much to look into at late night.

DMP is completely broken,
had to restore a backup (first after 2 years) for 8 ppl.

Thanks for your work and participation.
In actual condition, it may work for some singular installations,
till further (and final) investigation and results, its better
to finish contracts Station Science Contracts with the debug console.

 

 

Edited by Jansn67
Link to comment
Share on other sites

On 3/19/2020 at 8:53 PM, Jansn67 said:

Thanks a lot. Your .dll works.
In my middle-heavy modded 1.81 Career Game.

Ok, 40 Minutes later: Finalize dont work,
Stock Icons disabled, ...

That sounds like exception in event handler to me, seen those from various mods lately (since 1.8), usually NRE (NullReferenceException).
I assume that such a thing stops the event-handler chain which has catastrophic consequences,
one of them being "InputLock" not released, which leads to no control, keys and buttons not working etc.

BTW: I built it against 1.9.1, but that should not be a problem.

EDIT: Doing another experiment (Prograde Kuarqs in my Mun Station)

Spoiler

prog-kuarqs.png

...you can see it is modded - ReStock, ReStock+, other Nerteas, ScanSat and other DMagic's, USI, K&K (ok, cannot see that, but I have a base down there)... no problem (well, KIS/KAS crashed it yesterday, but I have seen some NREs from USI prior to this and attaching EVA strut using KIS/KAS is no trivial task)

Sure it completed as expected:

Spoiler

stnsci.png

 

Edited by firda
image
Link to comment
Share on other sites

On 3/19/2020 at 5:52 AM, firda said:

I am playing with this build: https://github.com/firdacz/StationScience/tree/firda/GameData/StationScience
navigate to branch "firda" (if the link does not already) and copy the content of the directory, or at least the dll inside "Plugins" into KSP (overwriting the old one) - this is the version I currently play with and it works for me.

The "master" branch is there for the PR in original repo (minimal, not built, I am not the creator or maintainer of this mod), "debug" branch prints some diagnostics into KSP.log
Note that I rewrote it a lot to even be able to build it and then understand how it works, so "master" is really minimal change to the original, but you would have to build it from source yourself (firda and debug are built - ready for use).

That worked!!

Thank you so much for the help here with that.

Copied all of the files you had in there (though it may indeed just have been the .dll file that would have done it).

Went back to the save, finalized the results, green tick, flew back to kerbin and recovered, mission complete!

Please have one internet for your trouble.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I've been doing some tinkering with textures and have a couple of questions for anyone who can help:

I've been tinkering with the source code (firda) and have made some new experiments and parts.

The experiment pods and the resource parts have been set to use their own textures using this added line in the .cfg file for the parts:

  MODEL
  {
    model = StationScience/Parts/StnSciKib
    texture = NewPod, StationScience/Parts/NewPodEng
  }

The above line worked perfectly for the N-BBL Kibbal Jr cloned part and for all the experiment pods, but didn't show up on the S-NRF Kibbal part.

I scratched my head for a while, tried some stuff, and eventually (as shown in the image) I decided to draw a white test line which revealed that the S-NRF part doesn't appear to use the same texture file.

oEvZzoI.png

 

So.

My questions are these: Where on earth does the big storage part pull its texture from? Or is it part of the model that was exported when it was made?

If the latter is true, then how can I apply my own custom texture to it?

 

Thanks in advance if anyone is able to help!

EDIT: Well that's interesting. It's taking its texture from the orange rim of the Zoology Bay.

 

 

 

Edited by DirtyFace83
Problem Solved
Link to comment
Share on other sites

I'm having contract problems too.

I got a contract to perform the Retrograde Quarks experiment in Kerbin orbit (thankfully not further away). I first launched a whole new research station with an experiment probe connected. Deployed everything, generated quarks, generated Eurecas, finalized the experiment, all that yadda yadda. Got the T-shirt and everything. I disconnected the probe, checked that the green tick mark for "Complete in orbit around Kerbin" was still there (as I see others have had this problem before), and it was. The experiment probe was safely landed a few kilometers offshore from the KSC. As it was bobbing up and down in the water, I once again checked for the green tick mark. Still there, all good. Now click "Recover vessel" ...

... and the contract isn't fulfilled. I got the science points from performing the experiment, but the contract did not complete. I tried sending up a new experiment probe, did everything again, had the green tick all the way until landing, but upon recovery it doesn't register.

 

So far I've only tested this for Retrograde Quarks in Kerbin orbit. I see new contracts for performing the same experiment around the Mun and Minmus too. Come to think of it, I don't think I've seen contracts for any of the other Station Science experiments in this whole career. Is Retrograde Quarks bugged somehow?

EDIT: I went into CKAN to try to force-update the mod, which instead simply removed it entirely. Now the whole station is gone, along with three brave Kerbals. Perhaps I shouldn't have done that.

EDIT2: I re-installed the mod, and thankfully had a quicksave. Hadlan, Urke, and Kerlong are all safe!

Edited by Codraroll
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Is there a trick to getting the finish experiment option to appear?  for instance, the retrograde kuarqs experiment.. I have a cyclotron, and a science lab with a scientist on board.  I create all the kuarqs needed.. after that I should be able to click on the option to finish the experiment..   But for some reason, I do not get that option.  Are there requirements to get the finish experiment option to appear that I may not be fulfilling?  I have this issue with the creature comforts experiment as well.

 

EDIT:  I am going to ask this dumb question.. maybe this is my problem.  Is it because I am using the clamp-o-tron construction docking ports from the MKS mod?  Do I need to use normal docking ports just for this?

Edited by brohande
Link to comment
Share on other sites

16 hours ago, brohande said:

or instance, the retrograde kuarqs experiment..

I touched upon this in my post above, but I wonder if Retrograde Quarks in itself is broken. My career save doesn't seem to generate contracts for any other Station Science experiment, and I'm unable to get it registered as completed even when all the green boxes are ticked upon landing. Retrieving the spacecraft just resets the contract parameters.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...