Jump to content

Temperature Curves


Recommended Posts

Hi, I first have to say that KSP is such an awesome game and the community and its mods is equally awesome. In the past year or so I have been playing around with the sources of various mods and the .cfgs of parts in hopes of creating new and interesting ways to approach playing the game. However, I have developed ideas which are outside of the scope of just tweaking other people's mods and part .cfg files. Although I have a ton of scientific programming experience and am fairly good with C, I don't fully understand C# yet and am not sure of the structure of the game. That said, I am a fast learner and so I figured I would ask the community if this project of mine is even feasible.

So here is my proposal : ). Currently there is an atmosphere curve component in the ModuleEngines module, and there is a heat production component there as well. I feel an extension of heat production and a component for the efficiency of engines at certain temperatures would be very useful features for the game. They could be interpolated curves like the atmosphere and velocity curves already present in the game.

So, can this even be implemented in the engine? Am I in over my head?

Link to comment
Share on other sites

Shouldn't be too hard.

One way to do it

1) Class inheriting from Module Engines (FX) that has one public Float Curve tagged as a KSP Field (so it can be loaded from the part cfg)

2) Override OnFixedUpdate, set heat production (inherited from the engine module) = originalHeatProduction * curve.Evaluate(parameter)

3) Use a MM patch to rename the engine module you inherited from to your new module name and add the interpolation data

Alternatively, you can add a separate module that inherits from partModule to affected parts, and use (part.Modules["ModuleEngines"] as ModuleEngines).heatVariable to set the heat production value. If all you're doing is altering the heat value, this way is probably better for mod compatibility

Link to comment
Share on other sites

Wow, thank you for the information, Crzyrndm. Now that I have a way to go about doing this I can focus and learn how to do them : ). Its a good thing that I didn't pick something that is too difficult, hah. If and when I have something to show for my work I will try to share it on the forums. Thank you again.

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...