-
Posts
113 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by okbillybunnyface
-
Banana for Scale - Analyse bananas in space!
okbillybunnyface replied to JoePatrick1's topic in KSP1 Mod Releases
This is just what you need when the mun starts complaining of leg cramps. -
I just released version 1.2. I wrote a new, way better version of the part.RequestResource() method, which I also commented the hell out of and tried to make easy for other modders to appropriate. Additionally, as I no longer had to dance around the stock part.RequestResource() method, I rewrote pretty much all the code that does the actual resource conversion, and I believe it to be fairly robust now. Please feel free to poke holes in it if you find any. I bug tested it as much as I know how to (without finding anything noteworthy ), but it's hard to fox out everything.
-
Hold the phone--you said you had canOverflow set to false? That should actually stop it from working when it's full. I'll update the readme to specify that. If so, I suspect it's merely not making it to the step where it refunds the input resources for some reason. Them being at a lower final value is probably a rounding error somewhere.
-
Thanks. That looks a lot like something I was encountering, but I didn't notice it happening on resources other than electric charge. I'll try and see what's going on with it today. The converter keeps its own (hidden) stocks of input/output resources, and requests them independently of the conversion. I suspect it's requesting too fast for some reason.
-
I've been doing some testing myself with it. I've got a newer version that I need to give you. The one you have has a tendency to think it's full when it's empty (and deactivate if deactivateIfEmpty is true). I also added a few things, and hopefully improved any potential shenanigans with resource transfer (the part.RequestResource() method) by adding in a minimum transfer amount. For inputs, it only requests the minimum transfer if the rate is lower than that, and just waits until it runs out to call it again. If the rate is lower than the minimum, it'll show up on the GUI with occasional blips of 0.0001. With outputs, it stockpiles the resource until it gets more than the minimum, then transfers all of it to the vessel. I also added a canOverflow parameter, which if set to false will stop the converter from running (but won't deactivate it) if there's nowhere to put something. This should take some micromanaging out of it if you're using something at a slower rate than the converter is producing it. There's also a new "Status" field in the part's context menu which will read "Deactivated", "Nominal", "Overflowing!", or "Underflowing!" depending on its activation state, and whether there is a bottleneck somewhere. Edit: The new one works amazingly at anything below 10,000x warp. For some reason, it fails pretty bad after that. :\
-
[0.24.2] RESOURCECONVERTER v1.22 ---------------------------------------- This is a simple plugin to do resource conversion in a part that doesn't have some of the hang-ups that the stock generator module does. It's intended for use by modders. I made this to help out the guys making Universal Storage, but I thought I'd make a release thread in case someone else has a use for it. INSTALLATION: Simply copy the contents ResourceConverter1.22.zip into your KSP directory, and make the necessary additions to the part's part.cfg (detailed below). MODULE { name = ModuleResourceConverter canOverflow = false //--optional, defaults to false (If set to true, the converter will continue to operate, consuming input resources, even if one of the outputs is full.) deactivateIfFull = false //--optional, defaults to false (If set to true, the converter automatically deactivates if one of the output resources is full.) deactivateIfEmpty = false //--optional, defaults to false (If set to true, the converter automatically deactivates if there one of the input resources is missing. If false, it will continue to 'operate' at 0 speed) INPUT_RESOURCE { name = ElectricCharge rate = 1 } INPUT_RESOURCE { name = LiquidFuel rate = 1 } OUTPUT_RESOURCE { name = MonoPropellant rate = 1 } OUTPUT_RESOURCE { name = Oxidizer rate = 1 } } Download: https://bitbucket.org/okbillybunnyface/moduleresourceconverter/downloads/ResourceConverter1.22.zip Source Code: https://bitbucket.org/okbillybunnyface/moduleresourceconverter/src/ Changelog: v1.22 8/5/2014 -fixed a small bug with passing negative amounts to the RequestResource method (I forgot to add an absolute value....) v1.21 8/5/2014 -Changed the new RequestResource() method to be public (oops). This is a very minor change that won't affect anything unless you plan on making plugins that use the method in this .dll. v1.2 8/5/2014 -Wrote a (much) better version of the stock part.RequestResource() method. Like, there's no comparison. -Rewrote the entire Convert() method to be more robust and to make use of the new RequestResource() method. v1.1 8/2/2014 -Added a status field to converters. -Added canOverflow functionality -Fixed bug with resource flow modes (hopefully, seemed to work) Known Issues: -At large timewarps, the converter may be limited by the total amount of a resource on the vessel rather than (such as with electric charge) the income rate. I'm fairly certain this is due to the order in which resource calculations are performed from one part to the next, and I'm not sure how to fix it. For instance, the converter uses up all the electricity on its turn, but the electric generators don't actually get to replenish it until it's their turn. Solution: Add a bunch of batteries. More info here License: Feel free to use or edit this however you want to. You can credit me if you like, but it is not necessary.
-
Edit: I am using 64bit KSP on windows Yeah, it should be ModuleResourceConverter.dll I uploaded everything to a bitbucket repo. ModuleResourceConverter.dll Source Code example part.cfg: MODULE { name = ModuleResourceConverter deactivateIfFull = true //--optional, defaults to true (I recommend you leave it true. Otherwise, it'll continue to eat resources) deactivateIfEmpty = false //--optional, defaults to false (If true, it will deactivate if there isn't enough of something. If false, it will continue to operate, albeit at a slower rate set by the limiting reagent) INPUT_RESOURCE { name = ElectricCharge rate = 22 } INPUT_RESOURCE { name = LiquidFuel rate = 0.000036 } OUTPUT_RESOURCE { name = MonoPropellant rate = 0.0448 } OUTPUT_RESOURCE { name = Oxidizer rate = 0.0224 } }