Jump to content

[1.11.2][1.12.1+]Ore to Parts - Craft parts with ore / duplicate parts


Goufalite

Recommended Posts

Mine ore.

Receive parts!

ORE TO PARTS

Available on CKAN! (search OreToParts)

I5dEh7a.png

Introducing a minimalistic mod transforming all ore tanks into converters changing ore into vital parts such as repair kits, solar panels,...

This is my first mod so please be kind and use the issue tracker in the link below ;)

Craft parts

The oretotanks.cfg file contains a comma-separated list of parts that can be crafted. The ore price to craft them is the mass of the part (5kg = 5 units of ore). The part will be stored in the ore tank’s new inventory, so keep an eye on it!

The converter can only craft cargo-type parts which have a volume. You can list them in the VAB by pressing the cargo-like button near the action-groups button.

Duplicate parts

Place a part to duplicate in the first slot and press Duplicate! Same as above, the ore price is the mass of the part.

Scrap parts

Transform the part in the first slot into ore, or throw it through the sas

EVA Refuel

If you deactivated jetpack and cylinder refueling, you can use this refueler to transform Ore or Monoprop (or any custom resource) into EVA fuel. Just put the parts you want to refuel in the inventory of the part having the refueler.

Kerbals present in the part containing the refueler will have their jetpacks refueled too!

-----

CC-BY-SA 4.0

Github : https://github.com/Goufalite/OreToParts

Issues : https://github.com/Goufalite/OreToParts/issues

Latest releasehttps://github.com/Goufalite/OreToParts/releases/

Wiki and tipshttps://github.com/Goufalite/OreToParts/wiki (add parts, manage custom resources, scrap syntax,...) 

Dependencies

Instructions

Remove previous versions. Unzip into the GameData folder of your KSP's installation, your folder tree should look like GameData/OreToParts

Please provide a KSP.log file and tell me if you have the expansions in order for me to help you.

Localization (please help) : 

English, French

Tested on KSP 1.11.2 and 1.12.1 with and without both expansions. This is my first mod and I might not have been everywhere. Please open an issue.

Roadmap :

  • Whole ship converter => my headcannon was that kerbals would handcraft parts with ore manually… Using convertrons means grabbing resources from all the ship which I’m not familiar with in KSP’s API. But you are free to provide me with any example or mod doing this.
  • Processing (why not use electricity to convert the parts and even take time)  => too complex and covered by the Sandcastle mod
  • Adding a select part GUI => covered by the Sandcastle mod and designing UIs in mods look hard... Sorry.

Changelog

Spoiler

0.4.0.0

  • Remove energy from crafted electrical parts (thank to Github user MSchmoecker, more info)
  • Field non-persistance
  • Added a whitelist to the scrap module, leave "all" to scrap everything, or comma separated parts.
  • Added a "forceRefuel" for the EVA refueler module to roleplay resource drain if the EVA parts are somewhat already full

0.3.1.0

  • Kerbals in the part containing the EVA refueler will have their jetpacks refueled too!
  • Partial EVA parts refueling

0.3.0.0

  • Code refactoring
  • Better syntax for resources
  • Scrap parts into ore, or simply get rid of an inventory item
  • Refuel EVA jetpacks or cylinders

0.2.0.0

  • added Eva cylinders
  • multiple resources with ratios
  • new friendly slider to select a craft part

0.1.0.0

  • initial release
  • ore tanks can convert parts by either crafting them or duplicating them
  • ore tanks have different maximum volume
  • default parts to craft are repair kits, eva science kits, HG-5 antenna, 1x6 solar panel, eva jetpacks

 

Edited by Goufalite
0.4.0.0
Link to comment
Share on other sites

I kinda like the idea.

But somehow I feel, that a nice part, that does the manufacturing (a nice 3D-Printer in Kerbal style), would be much cooler, than doing the stuff in an relatively ugly dark-on-the-inside ore container. 

 

Just my two cents...

Link to comment
Share on other sites

I love that you have made this simple... no extra parts or anything.

I'd personally have put the converter in the MPL (lab),  or, the largest probe core, or, even as part of a cargo container but it looks like this would be a patch away.

I would love to support this with some additional complexity with Simplex Resources.  Would you allow for the specifying resource types for cost, even two resources for a craftpart?

Link to comment
Share on other sites

8 hours ago, Rakete said:

But somehow I feel, that a nice part, that does the manufacturing (a nice 3D-Printer in Kerbal style), would be much cooler, than doing the stuff in an relatively ugly dark-on-the-inside ore container. 

 

6 hours ago, theJesuit said:

I'd personally have put the converter in the MPL (lab),  or, the largest probe core, or, even as part of a cargo container but it looks like this would be a patch away.

It's actually in my roadmap ;)

On 7/8/2021 at 11:41 PM, Goufalite said:

Whole ship converter => my headcannon was that kerbals would handcraft parts with ore manually… Using convertrons means grabbing resources from all the ship which I’m not familiar with in KSP’s API. But you are free to provide me with any example or mod doing this.

At least I want to use the ISRU because, well, it processes ore. I'd like to avoid creating a new part because it scares players, also I tried designing parts using Sketchup it's quite hard! (no distance respect, one color/material,...).

But most importantly I don't know (yet) how to grab all resources from a ship, I'll need to do some digging on what other mods do, especially when I'll implement the scraping part which adds ore.

 

7 hours ago, theJesuit said:

I would love to support this with some additional complexity with Simplex Resources.  Would you allow for the specifying resource types for cost, even two resources for a craftpart?

I need to think about this. The purpose of this mod is to be a very simple ore to part converter, I know the Simple Construction mod exists which manages resources like metal...

Would stock ore and your resources management coexist in one assembly or a fork would do (or a MM patch)? I'm really beginning to mod but I have a good C# background... If I manage to fix the whole craft processing above it could be interesting yes.

Link to comment
Share on other sites

14 minutes ago, Goufalite said:

At least I want to use the ISRU because, well, it processes ore. I'd like to avoid creating a new part because it scares players, also I tried designing parts using Sketchup it's quite hard! (no distance respect, one color/material,...).

KISS is great.  Adding the functionality as a Module means other might create parts or add to other parts throught MM patching.

15 minutes ago, Goufalite said:

I need to think about this. The purpose of this mod is to be a very simple ore to part converter, I know the Simple Construction mod exists which manages resources like metal...

SimplexResources gets rid of Ore and replaces it with NaturalOre (aka MetalOre) and RareOre (more precious metal ore).  So with that mod this one would work if it is only Ore->Parts.

In saying that, I applaud the simplesty you have gone with and wonder why I didn't make my EPL patch go from Ore to rockets.  Maybe I'll change my mind and do that, I'llneed to think about it.  Full credit to you!

What I'm suggesting is having a settings somewhere to specifiy which resources could be used.  If someone decided they wanted say RocketParts (from CRP) or a combination of NaturalOre 90% and RareOre 10% they could.

Peace.

 

 

Link to comment
Share on other sites

12 hours ago, theJesuit said:

What I'm suggesting is having a settings somewhere to specifiy which resources could be used.  If someone decided they wanted say RocketParts (from CRP) or a combination of NaturalOre 90% and RareOre 10% they could.

I'll take a look, sounds easy (something like resource = NaturalOre,0.9|RareOre,0.1 in the mm patch).

On the other hand, I found another mod which does craft parts but with moar features (catalog, time processing,...)

 

Link to comment
Share on other sites

1 hour ago, Goufalite said:

I'll take a look, sounds easy (something like resource = NaturalOre,0.9|RareOre,0.1 in the mm patch).

On the other hand, I found another mod which does craft parts but with moar features (catalog, time processing,...)

 

Yes but yours seems to be very simplistic, which is nice too!

Link to comment
Share on other sites

@Goufalite, I have an idea for how to do several points on your list; the stock resource converter and a custom resource (say "Parts").  It would be easy to add a converter to say the ISRU that would consume Ore and EC to produce "Parts" which would take time to convert and then KSP would manage the resources for you.  When enough "Parts" has been made, the work is done and the item is then created.  The converter can be created with an MM patch.

I also think about creating a part for your converter.  It would be easy to create a copy of a part (say the SEQ-9) with an MM patch and then add your converter and the custom resource.  Then the converter would not need to search the vessel, but just the part.  This could limit its ability to create parts to the amount of "Parts" stored.  Then it may take multiple parts to create all possibilities.

As for the custom resource, it could be a phantom resource that cannot be added by the player similar to Intake Air, or it could be more like Depleted Fuel from CRP where it is visible in Flight but cannot be added in the Editor.  You could use a resource from CRP or make your own.

One example for this behavior through MM is "On Demand Fuel Cells" as it uses MM to add its own custom plugin to a copy of a stock part.  It can also add it to the stock Fuel cell.  I suggest these since I could whip up an example of these, but I would not be able to change what your converter uses.

On the GUI, B9 Part Switch does have the ability to bring up a list for the user select from multiple options.  This is limited to the Editor so I do not know if it can be done in flight, but what b9 changes should not be done in flight.  Blowfish could tell you more.  The current method reminds me of USI Kontainers which have over a dozen resources to be switched through and can be frustrating when trying to get a certain one.

I really like the simplicity of this mod and see it as a "Spare parts maker" or "Field Repair" and not a build-a-ship-from-parts mod like OSE Workshop or the upcoming USI Konfabricator.  This fills a niche I will use since it can make repair kits in a very simple manner.  Do you have any plans to add the EVA Fuel Canister or EVA Jetpack?  I haven't tried to duplicate them, but I notice they are not on the list.

Link to comment
Share on other sites

Thanks for the feeback!

6 hours ago, mikerl said:

Do you have any plans to add the EVA Fuel Canister or EVA Jetpack?  I haven't tried to duplicate them, but I notice they are not on the list.

Weird... EVA jetpacks are in the list. I'll add EVA Cylinders in the next one ;). You can add them yourself while waiting for my release, Eva Cylinders are called "evaCylinder"

6 hours ago, mikerl said:

I have an idea for how to do several points on your list; the stock resource converter and a custom resource (say "Parts").  It would be easy to add a converter to say the ISRU that would consume Ore and EC to produce "Parts" which would take time to convert and then KSP would manage the resources for you.  When enough "Parts" has been made, the work is done and the item is then created.  The converter can be created with an MM patch.

I also think about creating a part for your converter.  It would be easy to create a copy of a part (say the SEQ-9) with an MM patch and then add your converter and the custom resource.  Then the converter would not need to search the vessel, but just the part.  This could limit its ability to create parts to the amount of "Parts" stored.  Then it may take multiple parts to create all possibilities.

When I created this mod I tried to Google Ore to Parts to see if this was already done and found nothing. But by searching something else I've found the Sandcastle mod which is an enhanced version of my mod (made in March) but with all you list : electricity and time processing, a single part (the lab) which manages all, GUI,...).

As you said my mod is very simplistic and niche so I'll continue maintaining it, but not transforming it into that mod...

6 hours ago, mikerl said:

As for the custom resource, it could be a phantom resource that cannot be added by the player similar to Intake Air, or it could be more like Depleted Fuel from CRP where it is visible in Flight but cannot be added in the Editor.  You could use a resource from CRP or make your own.

I'll take a look in the next release, by allowing patching my MM file with a resource field.

6 hours ago, mikerl said:

On the GUI, B9 Part Switch does have the ability to bring up a list for the user select from multiple options.  This is limited to the Editor so I do not know if it can be done in flight, but what b9 changes should not be done in flight.  Blowfish could tell you more.  The current method reminds me of USI Kontainers which have over a dozen resources to be switched through and can be frustrating when trying to get a certain one.

Yeah I don't like my part switch button ;) I'll take another approach : a left/right selector like fireworks selectors or Bon Voyage's rotation selector. Apparently is possible to do it with the UI_ChooseOption

Link to comment
Share on other sites

2 hours ago, Goufalite said:

When I created this mod I tried to Google Ore to Parts to see if this was already done and found nothing. But by searching something else I've found the Sandcastle mod which is an enhanced version of my mod (made in March) but with all you list : electricity and time processing, a single part (the lab) which manages all, GUI,...).

As you said my mod is very simplistic and niche so I'll continue maintaining it, but not transforming it into that mod...

I hadn't seen that mod before either, still looks like another build a ship from parts mod though.  It takes too much time to do that, which is why I like this one better.  Forgot something, no problem.  Trying to build a ship, wrong mod.

I'm not looking for those other things, they were some things you mentioned in your roadmap.  I don't see this mod doing anything more than EVA stuff and a few spare parts, a niche that no other mod fills that I know of.

 

2 hours ago, Goufalite said:

I'll take a look in the next release, by allowing patching my MM file with a resource field.

Yeah I don't like my part switch button ;) I'll take another approach : a left/right selector like fireworks selectors or Bon Voyage's rotation selector. Apparently is possible to do it with the UI_ChooseOption

Since @theJesuit mentioned other resources, making it possible to modify the main resource would be useful even if you stick to Ore.  Any of those GUI options sounds better than the current implementation.  Although the list is currently rather short, it would be good to expect it to expand.  Especially if other mods add their parts.

I don't mind helping if I can, and it also depends on what your vision for this mod is.

Link to comment
Share on other sites

@theJesuit @mikerl

I have some good news ;) . Multiple resource work with CRP and Simplex Resources :D !!

And now starts the tidious task of balancing and choosing the appropriate resources... Simplex and CRP examples are provided, but are not balanced so use with caution! For Simplex I unfortunately cannot mix resources yet because I still don't know how to get the whole resources of a ship.

Oh and I might try to i18n the resources but it looks touchy...

New release v0.2.0.0

  • Added Eva cylinders
  • Multiple resources with ratios
  • New friendly slider to select a craft part

 

Link to comment
Share on other sites

Awesome. 

@MODULE[OreToParts] { @resources = Ore|0.5,Hydrogen|1 }

Looks straightfoward enough.  This way you can fiddle with efficiency type things.

I'll have a good play over the next couple of days.

Peace.

Link to comment
Share on other sites

New release : v0.3.0.0

  • Code refactoring
  • Better syntax for resources
  • Scrap parts into ore, or simply get rid of an inventory item
  • Refuel EVA jetpacks or cylinders

The syntax for resources is now

RESOURCESLIST
{
    RESOURCE_NEEDED
    {
        name = Ore
        ratio = 1
    }
    RESOURCE_NEEDED
    {
        name = Hydrogen
        ratio = 0.5
    }
}

The Scrap module and EVA refueler modules are independant (but still need OreToParts.dll), meaning you can put them anywhere having an inventory slot. More info in the wiki!

Unfortunately, the EVA refueler only works by putting the parts to refill in the inventory slots of the converter, and they need ore to be completely refueled. I'll look into the later in the next release.

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, theJesuit said:

Question:  is it possible to make parts that are not able to be stored in the inventory?  Like mk1pod?

This might work.........

  • first install the Part Volumes mod
  • add the Mk1pod to the part list (using the add part example cfg file)
  • then tweak the cfg files to change the volumes so they can fit these parts

You'll run into a special problem tho: KSP doesn't allow to store parts which have inventories because it will obviously lead to an inventory cascade (like chests in chests in minecraft) so I suppose your mk1pod won't have an inventory.

Link to comment
Share on other sites

1 hour ago, Goufalite said:

This might work.........

  • first install the Part Volumes mod
  • add the Mk1pod to the part list (using the add part example cfg file)
  • then tweak the cfg files to change the volumes so they can fit these parts

You'll run into a special problem tho: KSP doesn't allow to store parts which have inventories because it will obviously lead to an inventory cascade (like chests in chests in minecraft) so I suppose your mk1pod won't have an inventory.

Yea.  I've been having that discussion about inventories.  I'm looking at a Simplex Assembly mod that would work in with Part Volume potentially as well.  It may just remove the inventories from crewed parts. But making cargocontainers could be an issue.

Link to comment
Share on other sites

  • 1 month later...

Ore To Parts is now available on CKAN!

When testing the integration of the mod, there's a strange behavior with the MonoProp EVA refueler. An issue has been opened I'm looking into it.Fixed, you need to set the inventory to persistent in the difficulty settings.

Edited by Goufalite
fixed issue
Link to comment
Share on other sites

  • 1 month later...

I did everything as you said, but jetpacks are still getting refueled upon entering the ship, without reducing the ship's monopropellant.

I made a "CustomPatches" folder and then a file inside it called "evafix.cfg" and I put this in it:

//Disable EVA jetpack infinite fuel
@PART[evaJetpack]
{
    @MODULE[ModuleCargoPart]
    {
        %reinitResourcesOnStoreInVessel = false
    }
}

@PART[evaCylinder]
{
    @MODULE[ModuleCargoPart]
    {
        %reinitResourcesOnStoreInVessel = false
    }
}

and then I downloaded your mod and put the folder "OreToParts" into GameData. I also enabled "Persist kerbal inventory loadout" in difficulty settings.

Why is it not working properly?

Edited by Cannon
Link to comment
Share on other sites

5 hours ago, Cannon said:

Why is it not working properly?

Can you provide more informations for me to investigate : 

- where did you put the evafix.cfg file ? (it must be in the GameData folder)

- on which gamemode are you playing (sandbox,...) ?

- on which version are you playing and do you have the DLCs ?

- can you provide the KSP.log and a savefile (a quicksave is fine).

My mod doesn't refuel automatically, you need to click on "Refuel EVA fuel" in the command pod's PAW. Automatic refueling was made in the EVA Fuel mod (which is not up to date with 1.11)

Thanks.

Link to comment
Share on other sites

2 hours ago, Goufalite said:

Can you provide more informations for me to investigate : 

- where did you put the evafix.cfg file ? (it must be in the GameData folder)

- on which gamemode are you playing (sandbox,...) ?

- on which version are you playing and do you have the DLCs ?

- can you provide the KSP.log and a savefile (a quicksave is fine).

My mod doesn't refuel automatically, you need to click on "Refuel EVA fuel" in the command pod's PAW. Automatic refueling was made in the EVA Fuel mod (which is not up to date with 1.11)

Thanks.

-I put the evafix.cfg inside the CustomPatches which is in GameData folder

-I'm playing the career mode

-Version is 1.12.2.3167 and I do have breaking ground dlc (1.7.1)

-Sure thing, here's ksp.log and quicksave .

However, I've also tested with new save, I mean I started new career mode from scratch, just to try it out. In new save, the jetpack actually wasn't refilling automatically by itself (while it does in old save), so that part was working properly now. However, when I clicked on "refuel EVA fuel" it still wasn't taking/reducing the ship's monopropellant, but it did refuel the jetpack. So basically this still gives me infinite fuel because I can refuel in the ship infinite amount of times.

I decided to include the quicksave of the new game too, here it is .
I don't want to abandon my old save though, this was just to test it.

 

EDIT: fixed the link for new save

Edited by Cannon
Link to comment
Share on other sites

@Cannon

Hello, thanks for the info and the testbench! 

You have a lot of mods but I managed to reproduce the refueling behavior on the OLD save only with my mod  (and interestingly without Module Manager since I made a clean install to test :o).

This is due to the fact that the savefile persisted the "reinitResourcesOnStoreInVessel" field on existing parts. What's wierd is that it happens on a brand new ship in the old save (even after completely replacing the jetpack in the VAB). I'm looking into this...

I didn't have any problems pumping monoprop in the NEW save tho... Maybe it's a mod conflict (I see in the log you have KIS/KAS and your kerbals in the OLD save had electric charge). Can you put a readable mod list and eventually clone your KSP install and remove progressively "obvious" resource changing mods so we can find the culprit ? I'll test with KIS/KAS on my side.

Edited by Goufalite
Link to comment
Share on other sites

4 hours ago, Goufalite said:

@Cannon

Hello, thanks for the info and the testbench! 

You have a lot of mods but I managed to reproduce the refueling behavior on the OLD save only with my mod  (and interestingly without Module Manager since I made a clean install to test :o).

This is due to the fact that the savefile persisted the "reinitResourcesOnStoreInVessel" field on existing parts. What's wierd is that it happens on a brand new ship in the old save (even after completely replacing the jetpack in the VAB). I'm looking into this...

I didn't have any problems pumping monoprop in the NEW save tho... Maybe it's a mod conflict (I see in the log you have KIS/KAS and your kerbals in the OLD save had electric charge). Can you put a readable mod list and eventually clone your KSP install and remove progressively "obvious" resource changing mods so we can find the culprit ? I'll test with KIS/KAS on my side.

Alright, I'll try that.

The list of mods is:

-ClickThroughBlocker
-ToolbarControl
-Astronomers Visual Pack
-Chatterer
-Distant Object Enhancement
-Engine Light Relit
-Environmental Visual Enhancements
-KAS
-KIS
-Kopernicus
-Loading Screen Manager
-Modular Flight Integrator
-NASA Countdown Clock
-Docking Port Alignment Indicator
-Parallax
-Planetary Base Systems
-Planet Shine
-Scatterer
-SunflaresOfMaar
-TAC Life Support
-TUFX
-Vapor Vent

4 hours ago, Goufalite said:

I didn't have any problems pumping monoprop in the NEW save tho... 

I could also refuel the jetpacks in the new save BUT it still wasn't reducing the monopropellant of the ship, so I could refuel as many times as I want. I assume it should reduce the ship's monopropellant by an equal amount that the jetpack refueled with. And if ship has no monopropellant left, you should be unable to refuel.

EDIT: Even after removing all mods (except this one) on the new save, the refueling still doesn't reduce ship's monopropellant.

EDIT2: I managed to stop automatic refuel (upon entering the ship) in the old save without removing any mods, if I put a new jetpack in VAB. It still doesn't reduce ship's monopropellant when I click refuel though.

Edited by Cannon
Link to comment
Share on other sites

On 11/12/2021 at 12:47 AM, Cannon said:

EDIT2: I managed to stop automatic refuel (upon entering the ship) in the old save without removing any mods, if I put a new jetpack in VAB

Great! What you can do now is change in the savefile all the reinitResourcesOnStoreInVessel to False so you won't have to send "uncursed" jetpacks to your kerbals ;)

On 11/12/2021 at 12:47 AM, Cannon said:

EDIT: Even after removing all mods (except this one) on the new save, the refueling still doesn't reduce ship's monopropellant.

After looking at the KSP.log I find contradictory elements, sometimes it says the ModuleEvaRefueler doesn't have a RESOURCES_NEEDED node, sometimes it works... Can you put the content of the GameData/OreToParts/Patches/oretanks.cfg file here so I can see if there is something missing ?(I know there is a typo "}1" but it doesn't seem to block...)

I'm preparing a debug heavy update so we can see what's wrong...

EDIT : here it is : https://drive.google.com/file/d/1oJg6_IxxKCEUw6dphv-pnUeoLWYSjSmA/view?usp=sharing

  • replace the OreToParts.dll in the GameData/OreToParts/Plugins/ folder
  • pop the console (Alt-F12)
  • do the "refuel EVA fuel"
  • either put a screenshot of the console or a KSP.log after the refuel EVA action
Edited by Goufalite
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...