Jump to content

[SOLVED] How to replace model of a part without messing with .cfg files?


Recommended Posts

So, I'm getting a build addict lately, where I'm very enthusiastic about doing aesthetic work on my craft. I used a lot of parts mod to add more parts that I can use. But some parts are just... not really fit for the stuff I build

Recently I'm also editing some parts in a mod to suit better in aesthetic look of my craft. But I wonder is there any way to swap the model of the parts without changing it's config file (utility of the part)?

Example: I'm building an unmanned orbital bomber plane on another planet. I need an antenna that's quite powerful to control it from kerbin, but there's no way those radar dish antenna (which meant for space probes) looks good on streamlined aircraft. Meanwhile, those radome in BDArmory looks good, but I have no need for it's radar capability. Would it be possible to make the radar dish antenna on stock game have a model of radome from BDArmory? I just need the antenna capability, but with radome model

This is for self-enjoyment, I wouldn't use a model of a mod to create a mod without author's permission

Edited by ARS
Link to comment
Share on other sites

The simplest way to do this is by creating a ModuleManager patch.

You'll need to have BDArmory installed (and ModuleManager of course), although if you don't use any other BDArmory parts you could delete everything from BDArmory except the GameData\BDArmory\Parts\radome125 folder and it will work just fine.

Here's the patch:

// Change model of RA-100 Antenna to BDArmory Snub-Radome
// Author: JAFO

+PART[RelayAntenna100]
{
    @name = SnubRadomeRA100
	// Change the model path to the radome we want.
	@MODEL
	{
		@model = BDArmory/Parts/radome125/radome1snub
	}
    @title = Radome Antenna
    @description = An RA-100 Antenna, somehow shoehorned into a radome enclosure.
	// Relocate the attachment node using the values from radome1snub.cfg
	@node_stack_bottom = 0.0, -0.4816, 0.0, 0.0, -1.0, 0.0, 1
	// Borrow the following values from radome1snub.cfg because it just makes sense to do so.
	@maximum_drag = 0.1
	@minimum_drag = 0.1
	@crashTolerance = 40
}

Using a good text editor such as Notepad++, save this patch as "Snub Radome Antenna.cfg" and place it in your KSP GameData folder.

 

If you haven't played with MM patches before, here's a brief overview of what it does.

  • Anything after // is a comment, and will be ignored by MM.
  • "+PART[RelayAntenna100]" tells MM to create a duplicate part - in this case to copy the most powerful stock antenna in KSP, the RA-100. This also copies all the values and behaviours of the original part to the new one. Some of these, we'll need to tweak further to suit our evil plans.
  • The '@' symbol tells MM to edit whatever property comes next. The first use of this command gives our new part a unique name (very important).
  • Next we tell MM that we want to edit the MODEL module, after which we supply the path to the model we want to use - in this case, the short, snub-nosed radome.
  • Next we edit the title. This is what will appear as the name in the VAB parts menu.
  • After this, we give it a custom description.
  • If we didn't edit the location of the attachment node, the dome would use the default RA-100 node, and wouldn't position itself correctly, so we borrow the correct node placement from the .cfg file for the radome.
  • Since the radome is obviously less "draggy" than the RA-100, we'll borrow the drag values as well
  • While we're at it, we can assume the dome provides more crash tolerance than an uncovered antenna, so we'll borrow the radome's crash tolerance as well

If you wish to use a different antenna, or a different radome model, I'm pretty sure that using the above as a guide, you'll be able to do so quite easily. You could even do all three radomes. If you get stuck, give me a yell.

 

 

And here it is.. a Radome that thinks it's an RA-100 Antenna!

screenshot0.png

Edited by JAFO
Link to comment
Share on other sites

18 hours ago, tomf said:

You would probably be better of using module manager to create a copy of the BDArmoury dome that has the antenna module on it and has the radar module removed.

That's considerably more work than doing it the other way around.

Edited by JAFO
Thread merge borked part of post
Link to comment
Share on other sites

  • 4 weeks later...
34 minutes ago, USB4 said:

Is it just the utility youre after?

 

You could always just turn off radio distance in the settings.

You're kind of missing the point.

@ARS wants to use the antenna network as-is, but they also wanted an antenna that matches the aesthetics of their craft's design.

Thankfully, with a little ModuleManager magic, that's easy to arrange.

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