Jump to content

[0.24][WIP] Extra Contracts


Arsonide

Recommended Posts

As people have begun to notice, the distance calculations are not exact, which has to do with how they are calculated. I had to do it a certain way to prevent people from being able to complete them with a rocket. Your wheels have to be on the ground each frame to count the distance you travel that frame. They are pretty damn close though, so if it isn't completing, give it another kilometer or two just to make sure.

Also, despite there being code to specifically prevent it, Kerbals are giving out contracts to drive rovers on the sun. I will look at that immediately.

Link to comment
Share on other sites

As people have begun to notice, the distance calculations are not exact, which has to do with how they are calculated. I had to do it a certain way to prevent people from being able to complete them with a rocket. Your wheels have to be on the ground each frame to count the distance you travel that frame. They are pretty damn close though, so if it isn't completing, give it another kilometer or two just to make sure.

Also, despite there being code to specifically prevent it, Kerbals are giving out contracts to drive rovers on the sun. I will look at that immediately.

In the list of possible targets, just remove Planetarium.fetch.Sun from the list before selecting the target.

Edit: I noticed you don't have any source code included in the download, its required (look at 5.2 in http://forum.kerbalspaceprogram.com/threads/30064-Community-Rules-October-27th-2013)

Edited by MrHappyFace
formatting
Link to comment
Share on other sites

Alright. I updated the rover contract plugin: https://dl.dropboxusercontent.com/u/1032313/ExtraContracts.zip

v0.2a Changelog:

Rover contracts will no longer ask you to drive on the sun.

If a rover contract was slated to be on Jool, it will choose a random Joolian moon instead.

Unmanned rover contracts will not appear unless you have probe technology.

For 0.3a I think I'm going to add random requests to have certain parts on the rover, like an antenna, or a sensor. I did not know source code was required. I will get it on GitHub later tonight, have to be at work in half an hour.

Edited by Arsonide
Link to comment
Share on other sites

I noticed you don't have any source code included in the download, its required (look at 5.2 in this post)

First: your link doesn't work (fixed in the quote).

Second: No, it's not required. It is required if it's applicable due to the license (which is required, but he has one). His license does NOT require him to provide the source code. Any version of the GPL would be an example of a license that requires providing the source code. The rules basically say that you have to follow the rules of your own license, which isn't exactly a surprise :)

That being said, the license makes very little sense when not providing source code (and it's actually not intended for software, but can be used for it), but he also said (or added) that he'll be adding it soon (in about an hour or two, if he's true to his word :D ).

I personally would also be interested in the source, as I wanted to look into providing a contracts module for RemoteTech. This would save me a lot of fumbling about, so I'm really looking forward to checking the code out! So I'd very much appreciate it, if you really could upload the source code, even if you're not forced to do so!

Link to comment
Share on other sites

wonder if we can get test messions for mod parts also insted of just stock?

and so u know all ksp mods are required to have souce and license. i mod probaly when he checks will remind him

Link to comment
Share on other sites

wonder if we can get test messions for mod parts also insted of just stock?

and so u know all ksp mods are required to have souce and license. i mod probaly when he checks will remind him

This debate is irrelevant. I am releasing the source, however bad it may be, because it will help the community. The more contracts, the better, right? However, I did receive a few fantastic requests for a 0.3a patch that I will be implementing first.

Link to comment
Share on other sites

2/3 of the feature requests are implemented. Now the contract still requires you to drive 6 kilometers, but after 3 kilometers, you will receive a message from the agency that says you are half way. At that point, the mod stops keeping track of where you are in relation to the landing site, but continues to record how far you are driving. Essentially what this means is that the path of the rover can be a round trip circle that ends back where you started, at the ship, and the contract will still succeed. The message also serves the purpose of keeping you updated with feedback so you know you are accomplishing the objective properly.

The third request is something I'm working on now. There will be a rare side objective that is attached sometimes that will ask you to ramp the rover off of something to stress test the rover's structural integrity (and get sick air). This will serve to add some interactivity to the mission. Rather than simply driving around, you're looking for hills to jump off of.

I'm just about ready to call this contract type feature complete and move on to another type of contract addition, but before I do that I will post the source.

Edited by Arsonide
Link to comment
Share on other sites

Second: No, it's not required. It is required if it's applicable due to the license (which is required, but he has one). His license does NOT require him to provide the source code. Any version of the GPL would be an example of a license that requires providing the source code. The rules basically say that you have to follow the rules of your own license, which isn't exactly a surprise :)

Just to be clear on this, and I know Arsonide is releasing the source code, it is absolutely required to make the source available if you release a plugin on the KSP forums, license requirements aside.

It is the first rule on plugin posting: http://forum.kerbalspaceprogram.com/threads/7529

Link to comment
Share on other sites

Please take a look at RoverScience, I had to take care of calculating distance traveled. Source code is linked on the page for GitHub. With the condition that at least one wheel was in contact with the ground (among others), I multiplied deltaTime with the rover's current surface velocity and was very accurate. Let me know if it helps at all :)

Link to comment
Share on other sites

A great extension of this would be for contracts calling for use of airplanes. Longer distance needed and maybe altitude range but it would create a very useful purpose to making aircraft as well as rovers. :)

Link to comment
Share on other sites

A great extension of this would be for contracts calling for use of airplanes. Longer distance needed and maybe altitude range but it would create a very useful purpose to making aircraft as well as rovers. :)

I can get on that. Tell me, what are all the planets that you can technically fly on? Eve, Kerbin, Laythe, Duna?

With the condition that at least one wheel was in contact with the ground (among others), I multiplied deltaTime with the rover's current surface velocity and was very accurate. Let me know if it helps at all :)

I'll check it out, that's actually the method I use, with the possible exception of how you check that contact with the ground.

EDIT: Looked at the code, I like your methods better, right now I use the LANDED situation, you use ground contact of wheels, which seems much more ideal. You also take the curvature of a planet into account in distance calculations, and have what looks like a more stable way of keeping track of the landing site. It's actually very similar to what I have here, with some slight variations. I am going to integrate those variations with my contract, and credit you, if you don't mind.

Edited by Arsonide
Link to comment
Share on other sites

I found a bug with your mod, with the Kerbal Rescue Mission, when you try to board a Kerbal onto a vessel he stays on EVA and he boards the vessel at the same time, resulting in a duplicate kerbal inside the vessel, which you can then EVA, and you have 2 Kerbals with the same name.

Images:

Fp3RAPp.jpg

fencdKu.jpg

You also cannot recover anything, I don't know if it's caused since the EVA bug or if it's like that the whole time.

I uploaded my save file for you to test this bug. In the save file you have to go to the Rescue Sattelite Lander and then you can reproduce the bug from there.

I've managed to reproduce the bug constantly with the mod, but not at all without it.

EDIT: Only the 64bit KSP version reproduces this bug, 32 bit has no such problem.

Edited by keenguitar
Added info.
Link to comment
Share on other sites

At the time of this bug, did you have a rover contract active? Was that contract active for Kerbin? If not, then this bug is unrelated to the contract mod. There is no code that runs in those circumstances, and that vessel would fail any checks that would run code, as it doesn't have wheels on it.

Link to comment
Share on other sites

At the time of this bug, did you have a rover contract active? Was that contract active for Kerbin? If not, then this bug is unrelated to the contract mod. There is no code that runs in those circumstances, and that vessel would fail any checks that would run code, as it doesn't have wheels on it.

I didn't have a rover contract active, but I did have one available to accept. I tried this save file with and without your mod, 4 times out of 4 with the mod installed I had the bug, 0 times out of 2 without the mod I had the bug. If you just don't want to look at it that's fine by me, it's your mod.

Edited by keenguitar
Logic error...
Link to comment
Share on other sites

Can you also get ride of some of the stupid contracts, like using massive engines around mun, or using SRBs in space. Maybe little more stuff that you have to achieve for mun, stages of testing before actually going etc.

Link to comment
Share on other sites

While you're at it, why not make a contract where you must take a walk with a kerbal as well? So it won't be just a report-sample routine, but you have to walk (or run, if the gravity permits) for a certain distance to fulfill a contract.

Also, can you modify the advances and rewards of a contract? If so, maybe you could make a separate mod which greatly reduces the advances and rewards so people will actually have to think about the rocket designs :)

Link to comment
Share on other sites

https://dl.dropboxusercontent.com/u/1032313/ExtraContracts-03a.zip

New version available, has the source in it - be gentle :(

Changelog: A lot has changed in this version, so keep an eye out for bugs please. This one is rough. The main things you will notice are that you now have a progress tracker in the upper left when you are doing these things, and you will occasionally get a side objective that asks you to get some sick air on a jump.

I've solidified what I will be adding tomorrow. Requests to build stations and bases. They're similar so both should be pretty simple to add. Of course I'll keep tweaking rover missions as well. Glad that these things finally have a purpose in the game, albeit a minor one for now.

I didn't have a rover contract active, but I did have one available to accept. I tried this save file with and without your mod, 4 times out of 4 with the mod installed I had the bug, 0 times out of 2 without the mod I had no trouble. If you just don't want to look at it that's fine by me, it's your mod.

I have no problem looking, but there's not much to go on. Contract code does not run unless you have the contract, and you didn't. You also weren't anywhere near where the code would run if you did have it, doing something completely unrelated. It is possible that the loading of the mod might have passed some threshold, or perhaps your GameData folder is configured improperly, how many mods are you running? Also, are you running 64 bit?

Edited by Arsonide
Link to comment
Share on other sites

I'm taking a look at the code. As it's a nice example on how to make new contracts. And I'm wondering something.

With the DriveParameter, what happens if you put 2 rovers on the planet and switch between them? Won't the parameters get messed up?

Link to comment
Share on other sites

Suggestion about rover contract, add biome requirement along with distance requirement. Maybe requirement to visit two biomes during one ride (check how rover handle on different terrain).

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...