Jump to content

[1.2.1] RoverScience Revisted (2.2.0) - Better, interactive science for rovers!


theSpeare

Recommended Posts

This is an absolute awesome mod. I tried it in 23.5 and it enhanced the game quite a lot.

Something like that should be stock. Finally there is a reason to send (unmanned) probes and rovers.

Having said that ;) I sadly have to report, that in 25. the "analyse sience" window won't pop up when a science spot is reached and I click on the button.

But at least my update menu is not broken. :sticktongue:

Thank you for your great work.

Link to comment
Share on other sites

  • 6 months later...

To anyone who might be looking at this, could anyone with a capability at modding take a look at this mod? I've been wanting to use it again but it just doesn't work and I'm dumb :(

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...
  • 4 months later...

Tentative compatibility update for KSP 1.1.3. Not thoroughly tested - use at your own risk! Please back up your save files. I am now in the process of revising/adding features to this lil old plugin.

Hi guys! I'm back. Sort of. I've done some digging around and managed to fix some of the problems (I think). I haven't had much time to test but decided to just publish the pre-release. If anyone's still interested.

Link to comment
Share on other sites

I just started fiddling with this, and I seem to be having some trouble getting the rover to register as landed.

The trick is that I'm using allista's Hangar mod - so I never actually "landed". With that said, I've got enough SAS to bounce myself into the air and land again... and it still doesn't register. :(

Using HyperEdit to land from 70m up doesn't work.

Quicksave/Quickload does work. Of note is that it turned the window off when I loaded - I didn't try that when I was fiddling around and trying to get it to work.

It also blew away my upgrades after the quickload. :(

Link to comment
Share on other sites

Strange! I'm currently trying to track landed vessels by verifying that the vessel has the module "ModuleWheelBase". Some follow-up questions:

1. Does your rover use stock wheels? If not, can you post the .cfg of the wheels you are using?

2. Quicksave/Quickload is a bit off and from my shaky memory it shouldn't work. This is because I save the upgrades stuff on a separate file, not on the persistent/quicksave file. Once I figure out how to use KSPScenario I will swap it over so that the upgrades should remain persistent. Apologies for that.

3. I don't think the Hangar mod would conflict with this, as long as the vessel you are spawning comes out normal like just another vessel on Kerbin's launchpad. My plugin just searches for wheels on your vessel, and checks if they have modules called "ModuleWheelBase" and then checks for a landed state.

Link to comment
Share on other sites

44 minutes ago, theSpeare said:

Strange! I'm currently trying to track landed vessels by verifying that the vessel has the module "ModuleWheelBase". Some follow-up questions:

1. Does your rover use stock wheels? If not, can you post the .cfg of the wheels you are using?

2. Quicksave/Quickload is a bit off and from my shaky memory it shouldn't work. This is because I save the upgrades stuff on a separate file, not on the persistent/quicksave file. Once I figure out how to use KSPScenario I will swap it over so that the upgrades should remain persistent. Apologies for that.

3. I don't think the Hangar mod would conflict with this, as long as the vessel you are spawning comes out normal like just another vessel on Kerbin's launchpad. My plugin just searches for wheels on your vessel, and checks if they have modules called "ModuleWheelBase" and then checks for a landed state.

1: Yes, sadly. I was really hoping that Kerbal Foundries would be updated, but it looks like they're having trouble with dodgy wheels. This brings up an idea: a list in a config file that lists wheel types/modules that should be valid to be considered "wheels." I just know this is going to come up once they update (the KF wheels are -so- much better than stock, and have a lot more variety.)

2: Good to know this is expected behavior, even if it isn't "good" ^_^ I'll just re-add the science in the configs, or find the file and edit that.

3: It -seems- like it spawns the vessel in place based on a saved craft file, but I'm sure there's something going on somewhere. Interestingly enough, it was registering that 4 wheels were landed when I was having that problem - it just wasn't swapping over to the scanning text. I was kind of guessing that's what it was detecting, which is why I was surprised that either "popping" the vessel into the air or using Hyperedit to re-land wasn't working.

Thanks for the reply. :D

Link to comment
Share on other sites

1. Ah! I've spotted the issue. Kerbal Foundries uses their own module name "KFWheels" or something along those lines. The list will be unnecessary; after all I'm just checking if contact is made by wheels, whatever the wheels may be. It's done by string comparison; all I'll need to really change is to just check for partial matches. Anything with "wheel" in the module name should suffice, and will be far less work for me.

3. Strange. Can you please try building a stock rover and using HyperEdit and see if the same result occurs? I use HyperEdit repeatedly to test my plugin and it seems to work fine.

No problem! thanks for the feedback :)

Link to comment
Share on other sites

Okay, results:

Launching the "Mun Rover I" from the SPH: Rover science window works.

Building a simple hangar with the "Mun Rover I" in it: FAIL

After driving around until I had all four wheels "landed:" FAIL

(edit: Really? You're going to eat my carefully pasted pictures? Have a link of one of them instead: RoverScienceTest.PNG)

(Double edit: and of COURSE it just embeds it when I give a link. Grrrr.)

After doing the "close and shutdown" action, then opening it back up, still getting the same thing.

I already established that a quicksave/quickload fixes the issue. It also appears that just going to the space center and then reopening the vessel also works. I would guess that switching to/from a vessel outside of the physics range would also work to reset it, but I don't have a simple test scenario for that one. ^_^

 

 

Edited by etmoonshade
Forum software SUCKS.
Link to comment
Share on other sites

13 hours ago, theSpeare said:

1. Ah! I've spotted the issue. Kerbal Foundries uses their own module name "KFWheels" or something along those lines. The list will be unnecessary; after all I'm just checking if contact is made by wheels, whatever the wheels may be. It's done by string comparison; all I'll need to really change is to just check for partial matches. Anything with "wheel" in the module name should suffice, and will be far less work for me.

I just re-read this, and think I might have been unclear - I was using stock wheels the whole time. KF hasn't updated for 1.1.3 and AFAIK, it doesn't work at all. It was just a random feature request while I was thinking of it, since I know I'd be complaining about that as soon as KF does update. :wink:

Also, a counterpoint:

MODULE
{
    name = ModuleReactionWheel
    PitchTorque = 5
    YawTorque = 5
    RollTorque = 5
    RESOURCE
    {
        name = ElectricCharge
        rate = 0.25
    }
}

Although now I have this wonderful idea for a rover with "reaction" wheels...

Link to comment
Share on other sites

@etmoonshade

Just did some minor testing and everything is working fine vanilla for me. I think there's definitely something fishy going on with the Hangar mod that will probably take me a lot of time to investigate. If you are indeed able to quicksave/quickload or change focus and have it working, I hope you don't mind that I push this issue back a bit to take some more priority over main features. Thanks a bunch though for reporting this.

New update though:

https://github.com/theSpeare/RoverScience-Revisit/releases

I've added the fix for searching for the generic name "wheels" in part module names (should help with compatibility with other mods now, thanks!). Furthermore, I've updated the saving mechanism to now work with KSPScenario, so now RoverScience should use persistent.sfs and quicksave.sfs for preserving upgrade values. Let me know if quicksave/quickloading works for you now!

Edited by theSpeare
Link to comment
Share on other sites

Maybe I'll just ping @allista to take a look at the last couple of posts and see if they've got any input (I hope this is okay - allista, I'll happily open a bug report in your thread as well and provide any necessary logs if you'd like.)

I swear, two new (to me) mods that I'm breaking in a row! :wink:

I'll give the quicksave/quickload a shot when I get my next rover up and see if it keeps the settings. And I am -totally- testing the reaction wheel wheels, just for laughs. >:3

As for pushing the bug priority back, it's certainly not a huge fuss for me since I can consistently get the rover science itself working with the vessel reload. Thanks for taking a look!

Link to comment
Share on other sites

Well, I've briefly looked at RS code and your logs and what I see is that RS PartModule somehow fails to initialize properly when a rover is launched from a hangar:

[FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ---------------------- 
RoverScienceGUI started
[FLIGHT GLOBALS]: Switching To Vessel Mun Rover I ---------------------- 
RoverScience 2 initiated!
RoverScience version: 2.0
RS Instance set - roverBrain (RoverScience.RoverScience)
[FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ---------------------- 
RoverScience OnDestroy()
RoverScienceGUI started
ONSTART - Not primary
[FLIGHT GLOBALS]: Switching To Vessel Mun Rover I ---------------------- 

NullReferenceException: Object reference not set to an instance of an object
  at RoverScience.RoverScience.OnUpdate () [0x00000] in <filename unknown>:0 
  at Part.ModulesOnUpdate () [0x00000] in <filename unknown>:0 
  at Part.Update () [0x00000] in <filename unknown>:0 

I don't know why there's two vessel switches to "Mun Rover I" (did you switched back and forth after the launch?), but the second switch breaks things as, obviously, the OnStart code under if(IsPrimary) is not run the second time, resulting in null reference to rover instance, I guess.

Edited by allista
Link to comment
Share on other sites

Thanks @allista! You are clearly better at spotting these things than me. OnUpdate is clearly throwing a null since there is no instance of "Rover" as it's not declared in OnStart(); My confusion however lies with the code I took from KER a long long time ago:

// TAKEN FROM KERBAL ENGINEERING REDUX SOURCE by cybutek
		// http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB
		// This is to hopefully prevent multiple instances of this PartModule from running simultaneously
		public bool IsPrimary {
			get {
				if (this.vessel != null) {
					foreach (Part part in this.vessel.parts) {
						if (part.Modules.Contains (this.ClassID)) {
							if (this.part == part) {
								return true;
							} else {
								break;
							}
						}
					}
				}
				return false;
			}
		}

I never really fully understood how it worked; I can't quite piece together logically how it would avoid multiple instances. If I did, I would probably know how to fix the IsPrimary check and make sure that the instance is actually declared. If you have any ideas/advice I'd really appreciate it.

For the time being I'm tentatively attempting this fix:

if (Instance = null)
  {
    Instance = this;
    Debug.Log("Instance was null; workaround fix by declaring Instance anyway");
  }

outside of the IsPrimary check. I'll be marking this down on the source as "dangerous" since it might actually just overwrite whatever the IsPrimary check was trying to do in the first place. This fix has now been pushed and released on 2.0.3. @etmoonshade I'd appreciate any feedback on whether this has fixed the issue for you.

In other news, I've completed 2.0.3 which includes a new feature I've been wanting to do for awhile. Science spot locations are now shown in-flight as a transparent red capsule. See gfy for example: 

New releases per usual are on github. As before, any feedback is greatly appreciated. :) Special mention to @udk_lethal_d0se for his help with this feature.

https://github.com/theSpeare/RoverScience-Revisit/releases

 

 

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...