Jump to content

How do I make a mod rescource that can be mined?


KSP Bro AE

Recommended Posts

That goes in four steps.

First, you need to define the resource itself. That is the easy part. You just need a .cfg file somewhere in your gamedata folder in which you put a RESOURCE_DEFINITION node with the appropriate data filled in. You can find out how exactly this needs to look by checking out how Squad defined the stock resources. You can find them somewhere under Gamedata/Squad/Resources.

Second, you need a part that can mine the resource. The simplest way to do this is to add the capability to the stock drills. I have never dabbled with this, so I can't advise you here. I can only tell you that you will need ModuleManager and knowledge of how drills work and are configured. Potentially the documentation link at the bottom of my signature can help. Failing that, look up the drill's part config file under Gamedata/Squad/Parts/Resources and try to work it out yourself.

Third, you need a part that can hold the resource that you mine. This is again an easy step, if you are happy with cloning an existing part. If you want your part to look unique, you will need to invest the effort of building a 3D model and painting a texture for it. But assuming cloning is fine, all you need to do is use ModuleManager's +PART call to duplicate one of the stock ore tanks, and then modify the RESOURCE node to hold your resource instead of ore. Don't forget to change the part name into something unique, and perhaps adjust the description etc.

Fourth, you need to tell the game to generate the resource on planets or asteroids or both. I don't know how that works, but I know both is possible; in fact, KSP is specifically built to allow it. You just need to find someone who can tell you how to hook into that system. You'll probably have more success if you ask that question in the modding subforum and not the gameplay help subforum, though :wink:

Link to comment
Share on other sites

Hi, if you are serious about this project you need to take a look at the Kethane and Carbonite source code, there are likely more but those are the two mods that add a minable resource that I'm familiar with. Those two contain all the info you would need on adding and mapping the resource, not forgetting that you also have to be able to detect it.

Link to comment
Share on other sites

On 7/21/2016 at 10:14 AM, SpannerMonkey(smce) said:

Hi, if you are serious about this project you need to take a look at the Kethane and Carbonite source code, there are likely more but those are the two mods that add a minable resource that I'm familiar with. Those two contain all the info you would need on adding and mapping the resource, not forgetting that you also have to be able to detect it.

Quoting for reference, but directed at KSP bro

Kethane uses a plugin based approach to add resources (which won't help) whereas Karbonite...actually doesn't use anything. Community Resource Pack, which is bundled with Karbonite, does the leg work, and uses the same methods as stock. Look at CRP.

Link to comment
Share on other sites

Jeez, so much writing for this...@Streetwind

Go into GameData>Squad>Parts>Resources and look into the drill or mini-drill cfg, specifically the MODULE_DRILL.

On July 20, 2016 at 7:35 AM, Streetwind said:

Third, you need a part that can hold the resource that you mine.

 

That should be easy for you...I hope.

On July 20, 2016 at 7:35 AM, Streetwind said:

KSP is specifically built to allow it. 

 

If that's the case, it shouldn't even be a step.

If that isn't the case, stop playing, get on Duckduckgo (my preference, at least:wink:.) and look up a way to learn C#.

Edited by KSP Bros KS
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...