Jump to content

[0.90] Regolith - an open ISRU and Resource framework [0.1.7 - 2015.02.26]


RoverDude

Recommended Posts

Thank you for explanation.

But again, about that Minmus ore example... will Variance of 40 and Dispersal say... 3 produce a map of rare deposit islands in zero/near_zero abundance ocean?

Link to comment
Share on other sites

You would need a variance of 100 to get something to drop down to zero.

- - - Updated - - -

Also, don't get too used to Ore as that's now a stock resource with 1.0 ;) We're changing the CRP definition to MetallicOre.

Link to comment
Share on other sites

Ore as a stock resource? They finally got to implementing some basic ISRU?

Then I want:

1) DETAILS! (Are they merging Regolith like they did with SPP? Will stock resource system be moddable? Etc.)

2) ETA!

3) Get my hands on 1.0 asap. =^_^= (You can't help me with that but I still want.)

Link to comment
Share on other sites

So I keep getting this error from my debug menu: [Exception]: TypeLoadException: Could not load type 'Regolith.Asteroids.BaseConverter' from assembly 'KolonyTools'. I'm using the latest version of Regolith and have tried several previous versions with no change. Any ideas on why this keeps happening?

Link to comment
Share on other sites

So I keep getting this error from my debug menu: [Exception]: TypeLoadException: Could not load type 'Regolith.Asteroids.BaseConverter' from assembly 'KolonyTools'. I'm using the latest version of Regolith and have tried several previous versions with no change. Any ideas on why this keeps happening?

MKS question actually... try reinstalling MKS 0.22.8

Link to comment
Share on other sites

When I (intentionally) crashed a ship into Minmus, which produced a debris cloud made of small parts and some wheel+truss bits, it started spamming an error about animation state the instant that I slammed into a slope and switched to the (now free-floating) mechjeb AR case. The thing is that at the same time, it lagged the game really badly. Although there was another exception error (with unknown source) that happened at the same time and Better Buoyancy was spamming an error as well, for some reason.

I think I forgot to turn off the resource converter on the minidrills before/after I retracted them, which might be a cause for this error.



IndexOutOfRangeException: Array index is out of range.
at Regolith.Common.REGO_ModuleAnimationGroup.get_ActiveAnimation () [0x00000] in <filename unknown>:0

at Regolith.Common.REGO_ModuleAnimationGroup.PlayDeployAnimation (Int32 speed) [0x00000] in <filename unknown>:0

at Regolith.Common.REGO_ModuleAnimationGroup.SetRetractedState (Int32 speed) [0x00000] in <filename unknown>:0

at Regolith.Common.REGO_ModuleAnimationGroup.CheckAnimationState () [0x00000] in <filename unknown>:0

at Regolith.Common.REGO_ModuleAnimationGroup.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

at PartModule.Load (.ConfigNode node) [0x00000] in <filename unknown>:0

at Part.LoadModule (.ConfigNode node, System.Int32& moduleIndex) [0x00000] in <filename unknown>:0

at ProtoPartModuleSnapshot.Load (.Part hostPart, System.Int32& moduleIndex) [0x00000] in <filename unknown>:0

at ProtoPartSnapshot.Load (.Vessel vesselRef, Boolean loadAsRootPart) [0x00000] in <filename unknown>:0

at ProtoVessel.LoadObjects () [0x00000] in <filename unknown>:0

at Vessel.Load () [0x00000] in <filename unknown>:0

at Vessel.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

output log: http://sta.sh/0dywsw6sg5p

Edit: Reproduced it again after another crash (into the Mun this time) and I was switching between objects in the debris cloud.

Edited by smjjames
Link to comment
Share on other sites

  • 2 weeks later...

Hello! This might be quite a newbie question, but I'm new to .cfg editing...

I use Interstellar Flight Inc. Life Support mod and I need to set a greenhouse to keep my kerbals fed while they work on a RemoteTech2 remote control center on planets like Duna (to avoid signal delay).

IFILS is simplistic life support mod with only one resource ("LifeSuport") and no waste resources. Each kerbal uses 1 unit of LifeSupport per day. I intend this greenhouse to support a crew of three indefinitely, 1.5 unit during the day (using photosynthesis) and another 1.5 unit during the night (using UV Lamps on battery).

I've chosen zzz's greenhouse mesh, but had problems with the .cfg file. At first, I tried with stock generator module using the following code:


RESOURCE_DEFINITION
{
name = NaturalLight
density = 0
unitCost = 0
flowMode = NO_FLOW
transfer = NONE
isTweakable = true
}


RESOURCE
{
name = NaturalLight
amount = 0
maxAmount = 1
isTweakable = false
hideFlow = true
}

RESOURCE
{
name = LifeSupport
amount = 0
maxAmount = 3
}


MODULE
{
name = ModuleDeployableSolarPanel
animationName = door
sunTracking = false
raycastTransformName = glass
pivotName = glass
isBreakable = false
resourceName = NaturalLight
chargeRate = 1
powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}

MODULE
{
name = ModuleGenerator
requiresAllInputs = true
isAlwaysActive = false
activateGUIName = UV Lights ON
shutdownGUIName = UV Lights OFF
INPUT_RESOURCE
{
name = ElectricCharge
rate = 1
}
OUTPUT_RESOURCE
{
name = NaturalLight
rate = 1
}
}

MODULE
{
name = ModuleGenerator
requiresAllInputs = true
isAlwaysActive = true
INPUT_RESOURCE
{
name = NaturalLight
rate = 1
}
OUTPUT_RESOURCE
{
name = LifeSupport
rate = 0.000139
}
}

The photosynthesis part (using greenhouse's embedded solar panels) works nicely, generating about 1.42 units during the day. When I activate the UV Generator, although it works correctly during the night, it does NOT stop when the solar panels are generating power. If I could conditionate stock generator's execution to the absense of solar power (due to darkness or to solar panels being retracted) or I could set (and test) a custom variable, I think it would work. But, alas, I think I won't succeed using stock generator... :(

After a lot of researching, I found about Regolith generator but can't find much documentation about it either. I think I'll utilize my existing code (the solar panel part) and insert Regolith converter's modules with some Module Manager rules.

Can someone help me, at least pointing me to the right direction?

EDIT: In time, where did Fel found this info? And how do we use resourceThreshold, generatorIsActive, isThrottleControlled and throttle?

ModuleGenerator


Boolean generatorIsActive P
Single efficiency P
String efficiencyGUIName P
String activateGUIName P
String shutdownGUIName P
Boolean isAlwaysActive P
Boolean requiresAllInputs P
Single resourceThreshold P
Boolean isThrottleControlled P
Single throttle P

Edited by jlcarneiro
Added additional question
Link to comment
Share on other sites

Hello! This might be quite a newbie question, but I'm new to .cfg editing...

I use Interstellar Flight Inc. Life Support mod and I need to set a greenhouse to keep my kerbals fed while they work on a RemoteTech2 remote control center on planets like Duna (to avoid signal delay).

IFILS is simplistic life support mod with only one resource ("LifeSuport") and no waste resources. Each kerbal uses 1 unit of LifeSupport per day. I intend this greenhouse to support a crew of three indefinitely, 1.5 unit during the day (using photosynthesis) and another 1.5 unit during the night (using UV Lamps on battery).

I've chosen zzz's greenhouse mesh, but had problems with the .cfg file. At first, I tried with stock generator module using the following code:


RESOURCE_DEFINITION
{
name = NaturalLight
density = 0
unitCost = 0
flowMode = NO_FLOW
transfer = NONE
isTweakable = true
}


RESOURCE
{
name = NaturalLight
amount = 0
maxAmount = 1
isTweakable = false
hideFlow = true
}

RESOURCE
{
name = LifeSupport
amount = 0
maxAmount = 3
}


MODULE
{
name = ModuleDeployableSolarPanel
animationName = door
sunTracking = false
raycastTransformName = glass
pivotName = glass
isBreakable = false
resourceName = NaturalLight
chargeRate = 1
powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}

MODULE
{
name = ModuleGenerator
requiresAllInputs = true
isAlwaysActive = false
activateGUIName = UV Lights ON
shutdownGUIName = UV Lights OFF
INPUT_RESOURCE
{
name = ElectricCharge
rate = 1
}
OUTPUT_RESOURCE
{
name = NaturalLight
rate = 1
}
}

MODULE
{
name = ModuleGenerator
requiresAllInputs = true
isAlwaysActive = true
INPUT_RESOURCE
{
name = NaturalLight
rate = 1
}
OUTPUT_RESOURCE
{
name = LifeSupport
rate = 0.000139
}
}

The photosynthesis part (using greenhouse's embedded solar panels) works nicely, generating about 1.42 units during the day. When I activate the UV Generator, although it works correctly during the night, it does NOT stop when the solar panels are generating power. If I could conditionate stock generator's execution to the absense of solar power (due to darkness or to solar panels being retracted) or I could set (and test) a custom variable, I think it would work. But, alas, I think I won't succeed using stock generator... :(

After a lot of researching, I found about Regolith generator but can't find much documentation about it either. I think I'll utilize my existing code (the solar panel part) and insert Regolith converter's modules with some Module Manager rules.

Can someone help me, at least pointing me to the right direction?

I would just have one generator making the LifeSupport using electricity all the time and then have built in solar panels that make just enough electricity to cover the electric cost. This way it produces a constant amount all the time but during the day it's not drawing power from other sources. So the game play is what you want it to be.

Also day/night only really apply when landed. Consider when you are interplanetary, you are always in sunlight except those freak periods you are briefly eclipsed by inner planets.

Link to comment
Share on other sites

I would just have one generator making the LifeSupport using electricity all the time and then have built in solar panels that make just enough electricity to cover the electric cost. This way it produces a constant amount all the time but during the day it's not drawing power from other sources. So the game play is what you want it to be.

Also day/night only really apply when landed. Consider when you are interplanetary, you are always in sunlight except those freak periods you are briefly eclipsed by inner planets.

Great idea, futrtrubl, thanks!

Unfortunately, this way the greenhouse won't work in a "natural" way: I won't be able to deactivate it to save energy, for example.

Any other idea?

Link to comment
Share on other sites

Great idea, futrtrubl, thanks!

Unfortunately, this way the greenhouse won't work in a "natural" way: I won't be able to deactivate it to save energy, for example.

Any other idea?

You mean allow it to still work when in sunlight but not during darkness?

Not without writing your own plugin no. It would have to use solar power when available and electricity when not.....

Hey RoverDude, this gives me an idea for a regolith feature request. A converter that uses one recipe when the inputs are available and automatically switches to another when they are not. This way jlcarneiro's solar panels produce eg "SolarPower" and the generator produces his life support from SolarPower when available and EC when not.

Edited by futrtrubl
Link to comment
Share on other sites

You mean allow it to still work when in sunlight but not during darkness?

Not without writing your own plugin no. It would have to use solar power when available and electricity when not.....

Hey RoverDude, this gives me an idea for a regolith feature request. A converter that uses one recipe when the inputs are available and automatically switches to another when they are not. This way jlcarneiro's solar panels produce eg "SolarPower" and the generator produces his life support from SolarPower when available and EC when not.

Exactly! This is exactly what I can't accomplish with stock generator!

What about Regolith's?

And what about these variables on stock's generator?

ModuleGenerator
Boolean generatorIsActive P
Single efficiency P
String efficiencyGUIName P
String activateGUIName P
String shutdownGUIName P
Boolean isAlwaysActive P
Boolean requiresAllInputs P
Single resourceThreshold P
Boolean isThrottleControlled P
Single throttle P

EDIT: I've just found some uses of the stock generator with zeroed and negative inputs and outputs. Could this be used as a kludge while RoverDude doesn't implement this?

You know, MacGyver style...

Zd001PT.png

:sticktongue:

Edited by jlcarneiro
Link to comment
Share on other sites

I really have no answer at all RE the stock generator. For the latter, just inherit from the base converter and you can do your own custom code for the creation of the recipe

Sorry, I don"t know how to do that... Isn't there a workaround with current situation?

Link to comment
Share on other sites

A question/suggestion regarding Regolith and CRP to avoid mod conflicts.

As I understand Regolith along with CRP should be a flexible base for mods to play nicely and avoid conflicts with resources distribution:

"So first and foremost on the list is how to deal cleanly with multiple mods who may have very different ideas on composition. etc. (i.e. is Jool a ball of Karbonite or a ball of Hydrogen?)"

However CRP adds ResourceConfigs folder which should IMHO be included in actual mod that defines it, not CRP itself. So karbonite REGOLITH_GLOBAL_RESOURCE etc. config should be in Karbonite mod etc.

For example I'm creating a fantasy mod in which there should be 1% chance for water on Kerbin. I'm creating regolith-based config for water on kerbin (1% chance). I want my mod to play nicely with i.e. NearFuture stuff so add I dependency for CRP and Regolith.

However CRP itself in ResourceConfigs folder holds definition of Water for Kerbin with presence chance of 100%. So my config of 1% is overriden by CRP's one since it is more optimistic (100%). The only way I can force 1% chance is to modify actual CRP config via MM which is regarded as not nice.

All in all I feel that in current form CRP/Regolith dictates distribution for certain resources. Thus my suggestion of moving ResourceConfigs from CRP to actual mods that use them.

edit: logged an issue on Github (in CRP repository)

Edited by riocrokite
Link to comment
Share on other sites

I know things are massively changing in a few days but I was wondering if someone who really IS a programmer would take a moment to help me understand something with the Regolith configs. What I wanted to do was put a resource in a very narrow band around Kerbin to test with. So I used Karborundum as a test resource to puzzle through it. Two things puzzled me while slogging through the RegolithResourceMap.cs file on Github.

1.) line 205 only seems to work at my desired altitude of 2.4M if I use MinAltitude =0 and MaxAltitude=8. Mathematically, a combination of 2/6 or 4/4 should give the same result. Yet after moving a ship out to the orbit and locating the band in question, the band is no longer there when I start playing with min/max numbers. I'm assuming that these values are used elsewhere (or part of the randomization) but I can't see it. I feel like I'm missing something easy ... but it isn't clicking in my head.[TABLE=class: highlight tab-size-8 js-file-line-container]

[TR]

[TD=class: blob-num js-line-number][/TD]

[TD=class: blob-code js-file-line, bgcolor: #F8EEC7]var ideal = ((rad*distro.MinAltitude) + (rad*distro.MaxAltitude))/2;[/TD]

[/TR]

[/TABLE]

Assume rad=100

ideal=((100*0)+(100*8))/2

ideal=((0)+(800))/2

ideal=(800)/2

ideal=400

ideal=((100*2)+(100*6))/2

ideal=((200)+(600))/2

ideal=(800)/2

ideal=400

ideal=((100*4)+(100*4))/2

ideal=((400)+(400))/2

ideal=(800)/2

ideal=400

2.) I'm not sure where request.altitude comes from in the line below. Is it just a Unity/KSP call? I looked up Math.Abs so I get the reason for that bit ... but I'm just trying to figure stuff out.

var diff = Math.Abs(ideal - request.Altitude);

None of this is important. I'm just trying to understand what is going on or what I'm missing (most likely) from the overall logic flow.

~M~

Link to comment
Share on other sites

2.) I'm not sure where request.altitude comes from in the line below. Is it just a Unity/KSP call? I looked up Math.Abs so I get the reason for that bit ... but I'm just trying to figure stuff out.

var diff = Math.Abs(ideal - request.Altitude);

 public static float GetAbundance(AbundanceRequest request)

request is an object instance of type AbundanceRequest that is passed to the function GetAbundance. If you take a look in the definition for Abundance request, you will find the variable named altitude (periods denote sub variables and functions that belong to the variable with the period in C#)

Edited by Crzyrndm
Link to comment
Share on other sites

 public static float GetAbundance(AbundanceRequest request)

request is an object instance of type AbundanceRequest that is passed to the function GetAbundance. If you take a look in the definition for Abundance request, you will find the variable named altitude (periods denote sub variables and functions that belong to the variable with the period in C#)

Thanks Crzyrndm for pointing me in the right direction. I totally missed that part ... which most likely ties into the fact I know nothing about C#. When did they start putting telephone symbols after letters?!!?! :) 10 Print "Hello World" 20 goto 10 is more my speed I guess. IF THEN ELSE Loops in Turbo Pascal 2.0 kinda killed my programming desire back in the day ... and hunting through 13K lines of code to find the one : that should have been a ; ...

I should probably abandon this until I get a better understanding of modern programming languages so I don't feel like a complete idiot all of the time. =)

~M~

Link to comment
Share on other sites

Thanks Crzyrndm for pointing me in the right direction. I totally missed that part ... which most likely ties into the fact I know nothing about C#. When did they start putting telephone symbols after letters?!!?! :) 10 Print "Hello World" 20 goto 10 is more my speed I guess. IF THEN ELSE Loops in Turbo Pascal 2.0 kinda killed my programming desire back in the day ... and hunting through 13K lines of code to find the one : that should have been a ; ...

I should probably abandon this until I get a better understanding of modern programming languages so I don't feel like a complete idiot all of the time. =)

~M~

Mynar, this might help:

http://forum.kerbalspaceprogram.com/threads/93054-0-90-Karbonite-Plus-%28K-%29-A-Karbonite-Expansion%21-0-3-0-2014-12-16?p=1687648&viewfull=1#post1687648

Link to comment
Share on other sites

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