Jump to content

How to add modulecommand to a part through MM?


jlcarneiro

Recommended Posts

I'm not sure this is the right place to ask this (I think it isn't gameplay...) so moderators feel free to move it... :wink:

I use KER, but I always set it to "partless" mode. Since those two beautiful parts are not used, I want to use them as poor's man probe core, installing one of them on manned vehicles to put on the brakes, turn lights, etc.

I used some MM code to change some properties and add modulecommand and the internal antenna. My code seems right (I can see the changes), but I can't control the rover... Right-click menu keeps saying its command state is "no telemetry"...

Whatam I missing? Can someone please help me?

P.S.: I'm currently on my phone, I'll add the snippet I used ASAP...

P.S.2: As promised, here is the code I used (I'll probably change it according to your tips):

//Add basic command capacity to KER unused parts
//Author: jlcarneiro

@PART[EngineerChip]:HAS[!MODULE[ModuleCommand|ModuleDataTransmitter]]:FINAL
{
	@cost = 200
	@category = Pods
	@TechRequired = engineering101
	@mass = 0.005		// It's just a circuitry board, same weight as the thermometer
	@crashTolerance = 8	// low crash tolerance
	@maxTemp = 800		// same to heat tolerance
	vesselType = Probe
	
	MODULE
	{
		name = ModuleCommand
		minimumCrew = 0
		RESOURCE
		{
			name = ElectricCharge
			rate = 0.01333333	// low consumption, just a board, remember?
		}
		hasHibernation = False
	}

	RESOURCE
	{
		name = ElectricCharge
		amount = 5			// small electric reserve, just a board!
		maxAmount = 5
	}

	MODULE	// small range, low cost control unit
	{
		name = ModuleDataTransmitter
		antennaType = INTERNAL
		packetInterval = 1.0
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		antennaPower = 2500
		optimumRange = 1250
		packetFloor = .1
		packetCeiling = 5
	}

}

@PART[Engineer7500]:HAS[!MODULE[ModuleCommand|ModuleDataTransmitter]]:FINAL
{
	@cost = 250
	@category = Pods
	@TechRequired = engineering101
	@mass = 0.010		// same weight as the smallest battery
	@crashTolerance = 10	// has low cost casing, low crash tolerance
	@maxTemp = 1200		// same to heat tolerance
	vesselType = Probe

	MODULE
	{
		name = ModuleCommand
		minimumCrew = 0
		RESOURCE
		{
			name = ElectricCharge
			rate = 0.01666667	// low consumption
		}
		hasHibernation = False
	}

	RESOURCE
	{
		name = ElectricCharge
		amount = 10			// small electric reserve, just a board!
		maxAmount = 10
	}

	MODULE	// small range, low cost control unit
	{
		name = ModuleDataTransmitter
		antennaType = INTERNAL
		packetInterval = 1.0
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		antennaPower = 2500
		optimumRange = 1250
		packetFloor = .1
		packetCeiling = 5
	}	
}

 

Edited by jlcarneiro
Added MM snippet
Link to comment
Share on other sites

Well, since you're asking about the proper use of an add-on, the correct subforum would probably be Add-On Discussions. :wink:

You'll definitely have to show us what you have made so far. It's not a very difficult patch, so you probably made a typo or syntax error somewhere. And sometimes, that simply takes a second pair of eyes to spot.

Link to comment
Share on other sites

It should be pretty straight forward.  The following patch turns the chip into a rover body (except for mass and drag and stuff).  I feel like if you really want it to be balanced you may want to take away a lot of that though.  Maybe it shouldn't have an internal electric charge, antenna, or SAS to account for it's smaller mass and drag.

@PART[EngineerChip] 
{
    -MODULE,* { }
	%vesselType = Probe
	MODULE
	{
		name = ModuleCommand
		minimumCrew = 0
		RESOURCE
		{
			name = ElectricCharge
			rate = 0.04
		}
		hasHibernation = True
		hibernationMultiplier = 0.25
	}
	RESOURCE
	{
		name = ElectricCharge
		amount = 120
		maxAmount = 120
	}
	MODULE
	{
		name = ModuleSAS
	}
	MODULE
	{
		name = ModuleKerbNetAccess
		EnhancedSituationMask = 7
		EnhancedMinimumFoV = 160
		EnhancedMaximumFoV = 179.5
		MinimumFoV = 5
		MaximumFoV = 10
		AnomalyDetection = 1
		DISPLAY_MODES
		{
			Mode = Biome
			Mode = Terrain
		}
	}

	MODULE
	{
		name = ModuleDataTransmitter
		antennaType = INTERNAL
		packetInterval = 1.0
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		antennaPower = 5000
		optimumRange = 2500
		packetFloor = .1
		packetCeiling = 5
	}	
}

 

Edited by Alshain
Link to comment
Share on other sites

Alshin's method is a bit excessive.

It pretty much replaces the whole part's config.
It will also erase the current functions of the part.

I think the person just wants to add the key functions.

However the necessary modules to add are:
ModuleCommand
ModuleDataTransmit

If you want SAS functionality you will need to add:
ModuleSAS

For a reserve power amount you will want the resource section with ElectricCharge, but I recommend setting it to a more accurate 100 or 50 for a tiny probe.

If you want kerbnet access from the part you need to add that too.

You do not need to remove the kerbal engineer modules from it unless you aren't installing kerbal engineer.
You can also reuse the old weight section (unless you want to add more weight for balance.)

Edited by Ruedii
moar info
Link to comment
Share on other sites

Thanks for your tips, folks!

@Streetwind, I forgot MM is an add-on (duh!), I'll take that in consideration, next time! Thanks for your help! I've put my current snippet to the OP. :wink:

@Alshain, this is very instructive, thank you! @Ruedii, I agree with you, I won't delete KER modules.

I've added both ModuleCommand and ModuleDataTransmit (with reduced range), I won't add ModuleSAS nor ModuleKerbNetAccess, because this should be just for basic control and telemetry... About EC reserves, the parts are VERY small, if I need more power, I must include a battery.

I noticed I did not include VesselType. I'll try including it... :wink:

Link to comment
Share on other sites

The VesselType did it, it worked, thanks! :D

Here is the snippet now:

//Add basic command capacity to KER unused parts
//Author: jlcarneiro

@PART[EngineerChip]:HAS[!MODULE[ModuleCommand|ModuleDataTransmitter]]:FINAL
{
	@cost = 200
	@category = Pods
	@TechRequired = engineering101
	@mass = 0.001		// just a circuitry board, same weight as the Cubic Strut
	@crashTolerance = 8	// low crash tolerance
	@maxTemp = 800		// same to heat tolerance
	vesselType = Probe
	
	MODULE
	{
		name = ModuleCommand
		minimumCrew = 0
		RESOURCE
		{
			name = ElectricCharge
			rate = 0.005	// low consumption, less than a lamp
		}
		hasHibernation = False	// doesn't hibernate
	}

	RESOURCE
	{
		name = ElectricCharge
		amount = 5		// small electric reserve, just a board, remember?
		maxAmount = 5
	}

	MODULE	// cheapest control unit, smallest range
	{
		name = ModuleDataTransmitter
		antennaType = INTERNAL
		packetInterval = 1.0
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		antennaPower = 1250
		optimumRange = 625
		packetFloor = .1
		packetCeiling = 5
	}

}

@PART[Engineer7500]:HAS[!MODULE[ModuleCommand|ModuleDataTransmitter]]:FINAL
{
	@cost = 250
	@category = Pods
	@TechRequired = engineering101
	@mass = 0.005		// same as thermometer, heavier than real life notebook
	@crashTolerance = 10	// has low cost casing, low crash tolerance
	@maxTemp = 1000		// same to heat tolerance
	vesselType = Probe

	MODULE
	{
		name = ModuleCommand
		minimumCrew = 0
		RESOURCE
		{
			name = ElectricCharge
			rate = 0.01	// low consumption
		}
		hasHibernation = True
		hibernationMultiplier = 0.375	// when hibernating, uses 3/4 of chip's EC
	}

	RESOURCE
	{
		name = ElectricCharge
		amount = 10			// small electric reserve
		maxAmount = 10
	}

	MODULE	// small range, low cost control unit
	{
		name = ModuleDataTransmitter
		antennaType = INTERNAL
		packetInterval = 1.0
		packetSize = 2
		packetResourceCost = 12.0
		requiredResource = ElectricCharge
		antennaPower = 2500
		optimumRange = 1250
		packetFloor = .1
		packetCeiling = 5
	}	
}

How does this hibernation thing work? I mean, what is that "hibernationMultiplier"? Got it!

What do you think of the balance I propose?

Edited by jlcarneiro
Link to comment
Share on other sites

10 hours ago, Ruedii said:

Alshin's method is a bit excessive.

It pretty much replaces the whole part's config.
It will also erase the current functions of the part.

I think the person just wants to add the key functions.

Well, he said he was using partless mode, so there was no other function of the part.  It doesn't replace the whole parts config either, it just removes the Engineer module.  Removing the module avoids conflicts which are theoretically possible (though unlikely).

Edited by Alshain
Link to comment
Share on other sites

5 hours ago, Alshain said:

Well, he said he was using partless mode, so there was no other function of the part.  It doesn't replace the whole parts config either, it just removes the Engineer module.  Removing the module avoids conflicts which are theoretically possible (though unlikely).

Didn't think of this! It makes sense, I think I'll do something like this...

I'll specifically delete KER module by adding this line:

	-MODULE[FlightEngineerModule] {}

 

Edited by jlcarneiro
Link to comment
Share on other sites

  • 2 weeks later...
On 4/27/2017 at 10:23 AM, jlcarneiro said:

The VesselType did it, it worked, thanks!

 

I KNEW I was forgetting something.   Yes, if you don't replace the vessel type and (sometimes) the parttype KSP gets a tad confused. 

It works, but it treats it the same as any craft you marked as debris, and complains in the engineer's report to add insult to injury.

p.s.  I'd put the heat tolerance a little higher at 1000 to put it along the lines of poorly shielded parts stock.  (Similarly, crash tolerance of 6-7 for the same reason).
I might also add an SAS-hold function on an upgrade stage to the one that has flight engineer, with additional upgrades later, at the cost of more power consumption, but the benefit of hyphenate down to the low power consumption of it's lesser equipped peer.

Edited by Ruedii
Feedback on balance.
Link to comment
Share on other sites

8 hours ago, Ruedii said:

I KNEW I was forgetting something.   Yes, if you don't replace the vessel type and (sometimes) the parttype KSP gets a tad confused. 

It works, but it treats it the same as any craft you marked as debris, and complains in the engineer's report to add insult to injury.

p.s.  I'd put the heat tolerance a little higher at 1000 to put it along the lines of poorly shielded parts stock.  (Similarly, crash tolerance of 6-7 for the same reason).
I might also add an SAS-hold function on an upgrade stage to the one that has flight engineer, with additional upgrades later, at the cost of more power consumption, but the benefit of hyphenate down to the low power consumption of it's lesser equipped peer.

Thanks!

Don't know how to code upgrades (specially through MM). Do you know any tutorial?

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