Jump to content

Adding functinality to a part at tech level.


Recommended Posts

Is it possible to add additional functions / modules to a part when achieving a tech level.

As an example, I have part that acts as a MechJeb core, which is unlocked at tech flightControl.  I want to add kOS function at tech unmanndedTech.

 

Using module manager I can add functions based on other mods being installed with NEEDS:[mod name], is there a way to do something similar with a tech level?

Link to comment
Share on other sites

  • 2 weeks later...

So I've made some progress based on the posts above.

The starter code is something like this:

    // Kerbal Operating System (kOS)
        @PART[USGuidanceComputer]:NEEDS[kOS]
        {       
            MODULE
            {
                name = kOSProcessor
		diskSpace = 60000
		ECPerBytePerSecond = 0
		ECPerInstruction = 0.000004
            }
        }

I've got as far as adding the Upgrade code to this:
 

	// Kerbal Operating System (kOS)
		@PART[USGuidanceComputer]:NEEDS[kOS]
		{	
			// @cost = 2200
			
			// @TechRequired = unmannedTech
			// @entryCost = 4200
			
			MODULE
			{
				name = kOSProcessor
				diskSpace = 0
				ECPerBytePerSecond = 0
				ECPerInstruction = 0
			}
				
			MODULE
			{
				name = PartStatsUpgradeModule
				showUpgradesInModuleInfo = true
				UPGRADES
				{
					UPGRADE 
					{
						name__ = USGuidanceComputer_kOS
						techRequired__ = unmannedTech
						entryCost = 4200
						title = Kerbal Operating System upgrade
						manufacturer = Universal Storage
						description = Software patch adds kOS compatibility, allowing for programmed missions.
						basicInfo = Whatever
						
						IsAdditiveUpgrade__ = false				
						PartStats
						{
							name = kOSProcessor
							diskSpace = 60000
							ECPerBytePerSecond = 0
							ECPerInstruction = 0.000004
						}
					}	
				}
			}

			
			PARTUPGRADE
			{
				name = USGuidanceComputer_kOS
				partIcon = USGuidanceComputer
				techRequired = unmannedTech
				entryCost = 4200
				cost = 0 // for display only; all parts implementing this will need a PartStatsUpgradeModule with cost = this.
				
				title = Kerbal Operating System upgrade
				basicInfo = Whatever
				manufacturer = Universal Storage
				description = Software patch adds kOS compatibility, allowing for programmed missions.
			}
		}

No luck getting this to work though.

Reading the documentation, I'm not sure this is even possible with modded values.
 

 

 

Link to comment
Share on other sites

  • 2 months later...

@Paul Kingtiger I believe what you want is this: Have the modules in question always in the config but have them disabled and use the partupgrade to enable them.

MODULE
{
	name = ...
	moduleIsEnabled = false
	showUpgradesInModuleInfo = true
	UPGRADES
	{
		UPGRADE
		{
			name__ = ...
			description__ = ...
			techRequired__ = ...
			moduleIsEnabled = true
		}
	}
}

 

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