Jump to content

Advice for developing a Ground-Based Station Mod


Recommended Posts

I've recently got really into playing Kerbal with the USI Modular Kolonization Systems mod, and had an idea for a small-scale add-on for that suite of mods.  I have some background coding in Unity (although my grasp of C# is still a bit hesitant), and thought this would make a fun project to build my coding skills.  I've been reading through a lot of the "how to get started" guides and have a rough idea of how to... well, get started, but before I start barking up the wrong tree, I thought I'd ask here for opinions on how best to approach designing and building the mod.

The core idea is to add structural parts that are affixed to the ground, like the ground pylon in the MKS mod (the one that is basically a launch clamp without the decoupler, rather than the KIS ones that are fixed to the ground on EVA), but using an "in-line" model rather than the radial surface-attached model.  I know this needs three parts (the surface attachment, the vessel attachment, and a stretchy bit in between) and I think I can probably figure it out by pulling apart the stock models and the cfg file, I just wondered if there was any subtlety to it that I should be aware of before I start noodling with them?  For example, would it need any custom .dll files?

The other arm of the project was that the structures should be initially deployed (using MKS Ground Construction, i.e. you establish a small workshop, ship out a DIY kit and build the structure in situ) as a part-built superstructure (i.e., all the metal bits), and in order to "finish" the structure, you import a large amount of local raw materials(e.g. ore, silicates, gypsum) and hit deploy.  Basically, you're making the large amount of concrete needed to build the structure on site rather than abstracting it as "material kits" or the special parts int the DIY kit).  

I don't really envision this being extremely complicated, but I might be missing something subtle.  The idea would be to have two meshes for the part; when you're designing your base in the VAB you see the "complete" model (with, I expect, a button to preview the "incomplete" model), but when it is "launched" (either via Ground Construction or if for some bizarre reason you rolled it out of the VAB on Kerbin) it defaults to the "incomplete" model.  Then, when you've accumulated the materials and hit "deploy", you get a puff of smoke and the model switches to the "complete" model (preferably without any way of toggling back to the incomplete version).

So my core question is, what's the best way to implement that kind of behaviour?  Does any of that get baked into the .mu file, or should I be building a .dll that gets tied to the part?

Thoughts, comments and suggestions appreciated (including "this idea sucks" :P) 

Link to comment
Share on other sites

39 minutes ago, Benjamin Kerman said:

So this is not "deployed" until you gather even more resources in addition to the initial cost to build onsite? 

If so, you need a small plugin that references and requires GroundConstruction or similar mod. 

If not, config trickery should do the trick(ery)! :P 

So the procedure for deploying on a planet would be:
1. Land the DIY kit for a vessel with modded parts near a GC assembly plant
2. Bring the Material Kits to assembly plant and build the DIY kit as normal
3. Deploy the vessel, with the modded parts using a "superstructure" mesh
4. Transfer resources to the vessel
5. Click "Go" on the modded parts, swapping them to a "finished" mesh

So roughly analagous to using material kits to deploy the inflatable modules in MKS, except a) using different resources and b) not being reversible.

Link to comment
Share on other sites

Okay, that makes it (kinda) simpler... 

The thing to do now is to look at thw Ground Construction API and figure out how you are going to do the texture swiitching. 

You are going to need the calls for vesselDeployed or something like it, and then resourcetransfercomplete or something like it. 

Edited by Benjamin Kerman
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...