Jump to content

B9PartSwitch and SAS Levels


Recommended Posts

I was wondering if anyone has had success at getting SAS to switch within B9PartSwitch.  Ideally, I would like all probes to have all levels of SAS available (the timing via upgrades).  The code "works" insofar as it doesn't have any errors, but the SAS level does not change from the baseline of level 0 (stability control) that I set.  

// Strip out SAS functionality of all probes except for stability control and add back in via upgrades
@PART[*]:HAS[@MODULE[ModuleCommand],#vesselType[Probe]]:NEEDS[CommunityTechTree]:FOR[zKiwiAerospace]
{
	@description = #$description$ \n\n<color=#ff0000>This part has upgrades!</color> 
	!MODULE[ModuleSAS] {} // Remove original SAS Module
	MODULE // Default to a basic level of stability
	{
		name = ModuleSAS
		SASServiceLevel = 0
	}
	
	%costAdjust1 = #$cost$
	@costAdjust1 *= 0.50
	%costAdjust2 = #$cost$
	%costAdjust3 = #$cost$
	@costAdjust3 *= 2
	
	MODULE
	{
		name = ModuleB9PartSwitch
		moduleID = sasSwitch
		switcherDescription = SAS Switch
		affectDragCubes = False
		affectFARVoxels = False
		
		SUBTYPE
	    {
			name = SAS-Level0
			title = Stability Augmentation System (Level 0)
			descriptionSummary = Baseline Stability 
			descriptionDetail = This level provides basic stability control.
			addedCost = 0
			defaultSubtypePriority = 1
			primaryColor = #99c0ff
			secondaryColor = #99c0ff
	    }
		
		SUBTYPE
	    {
			name = SAS-Level1
			title = Stability Augmentation System (Level 1)
			descriptionSummary = Improved Stability
			descriptionDetail = Probes are now capable of holding the vessel in Prograde/Retrograde orientation.
			//upgradeRequired = sas1Upgrade
			addedCost = #$../../costAdjust1$
			defaultSubtypePriority = 0
			primaryColor = #5c9aff
			secondaryColor = #5c9aff
			
			MODULE
			{
			    IDENTIFIER
			    {
					name = ModuleSAS
			    }

			    DATA
			    {
					SASServiceLevel = 1
				}			    
			}
	    }		
		
		SUBTYPE
	    {
			name = SAS-Level2
			title = Stability Augmentation System (Level 2)
			descriptionSummary = Advanced Stability
			descriptionDetail = Probes are now capable of holding the vessel in Normal/Radial orientation.
			//upgradeRequired = sas2Upgrade
			addedCost = #$../../costAdjust2$
			defaultSubtypePriority = 0
			primaryColor = #1f75ff
			secondaryColor = #1f75ff
			
			MODULE
			{
			    IDENTIFIER
			    {
					name = ModuleSAS
			    }

			    DATA
			    {
					SASServiceLevel = 2
				}			    
			}
	    }
		
		SUBTYPE
	    {
			name = SAS-Level3
			title = Stability Augmentation System (Level 3)
			descriptionSummary = Extreme Stability
			descriptionDetail = Probes are now capable of tracking targets and aligning with maneuvers.
			//upgradeRequired = sas3Upgrade
			addedCost = #$../../costAdjust3$
			defaultSubtypePriority = 0
			primaryColor = #0056e0
			secondaryColor = #0056e0
			
			MODULE
			{
			    IDENTIFIER
			    {
					name = ModuleSAS
			    }

			    DATA
			    {
					SASServiceLevel = 3
				}			    
			}
	    }
	}
}

 

Link to comment
Share on other sites

1 hour ago, Nertea said:

It's likely that @blowfish would need to work on support for that particular module. Not all modules are supported by b9PS out of the box as they load and set up data quite differently from each other. 

Thanks, the stock upgrade system does about 90% of what I want, so probably not a critical component for my long-term survival :-)

Link to comment
Share on other sites

B9PartSwitch shoves data into each module pretty generically.  Some models handle it better than others.  The system allows creating custom handlers for different modules, probably what's needed here.  If you do end up needing it, create an issue at Github and I can look.

Link to comment
Share on other sites

2 hours ago, blowfish said:

B9PartSwitch shoves data into each module pretty generically.  Some models handle it better than others.  The system allows creating custom handlers for different modules, probably what's needed here.  If you do end up needing it, create an issue at Github and I can look.

@blowfish, Thanks. Will think about it some more and if I can put a case forward for the benefits, will add to issues, but understand that I don't have a good sense for the time it would take to add it as a feature.

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