Jump to content

Is it possible to add MODULEs through part upgrade?


sebi.zzr

Recommended Posts

I would like to add different science experiments to command pods when they are available in tech tree and would prefer the stock part upgrade function.
This'll add icon and notification in tech tree:

PARTUPGRADE
{
	name = comandscience
	partIcon = sensorThermometer
	techRequired = engineering101
	entryCost = 2500
	//cost = 0 
	
	title = thermometer upgrade
	//basicInfo = Whatever\nblah
	//manufacturer = 
	description = Adds thermometer to all command pods
}

no problem here,but nothing of the following is working
Upgrade through "PartStatsUpgradeModule":

Spoiler

MODULE
{
 name = PartStatsUpgradeModule
 showUpgradesInModuleInfo = true
 UPGRADES
 {
  UPGRADE
  {
  name__ = comandscience
  techRequired__ = engineering101
  IsAdditiveUpgrade__ = True
   PartStats
   {
    MODULE
    {
    name = ModuleEnviroSensor
    sensorType = TEMP
    }
    MODULE
    {
    name = ModuleScienceExperiment
    experimentID = temperatureScan
    experimentActionName = Log Temperature
    resetActionName = Delete Data
    useStaging = False
    useActionGroups = True
    hideUIwhenUnavailable = False
    xmitDataScalar = 0.5
    dataIsCollectable = True
    collectActionName = Take Data
    interactionRange = 1.5
    rerunnable = True
    usageReqMaskInternal = 1
    usageReqMaskExternal = 8
    }
   }
  }
 }
}

Spoiler

MODULE
{
 name = PartStatsUpgradeModule
 showUpgradesInModuleInfo = true
 UPGRADES
 {
  UPGRADE
  {
  name__ = comandscience
  techRequired__ = engineering101
  IsAdditiveUpgrade__ = True

    MODULE
    {
    name = ModuleEnviroSensor
    sensorType = TEMP
    }
    MODULE
    {
    name = ModuleScienceExperiment
    experimentID = temperatureScan
    experimentActionName = Log Temperature
    resetActionName = Delete Data
    useStaging = False
    useActionGroups = True
    hideUIwhenUnavailable = False
    xmitDataScalar = 0.5
    dataIsCollectable = True
    collectActionName = Take Data
    interactionRange = 1.5
    rerunnable = True
    usageReqMaskInternal = 1
    usageReqMaskExternal = 8
    }
  }
 }
}

direct upgrade:

Spoiler

UPGRADES
{
 UPGRADE
 {
 name__ = comandscience
 techRequired__ = engineering101

  MODULE
  {
  name = ModuleEnviroSensor
  sensorType = TEMP
  }
  MODULE
  {
  name = ModuleScienceExperiment
  experimentID = temperatureScan
  experimentActionName = Log Temperature
  resetActionName = Delete Data
  useStaging = False
  useActionGroups = True
  hideUIwhenUnavailable = False
  xmitDataScalar = 0.5
  dataIsCollectable = True
  collectActionName = Take Data
  interactionRange = 1.5
  rerunnable = True
  usageReqMaskInternal = 1
  usageReqMaskExternal = 8
  }
 }
}

so,is there any other method to achieve that?

thank you

Link to comment
Share on other sites

No it is not possible to add modules through part-upgrades.

The closest you can come is to add the module to the base part and set it to inactive with a 'moduleIsEnabled= false' in the modules config;  your part upgrade then switches the 'moduleIsEnabled' field in that module to 'true' when the upgrade is applied.

 

Edit:  Change field name from 'moduleIsActive' to 'moduleIsEnabled'  (never used it, had to look up the proper field name...)

Edited by Shadowmage
Link to comment
Share on other sites

18 hours ago, Shadowmage said:

No it is not possible to add modules through part-upgrades.

The closest you can come is to add the module to the base part and set it to inactive with a 'moduleIsActive = false' in the modules config;  your part upgrade then switches the 'moduleIsActive' field in that module to 'true' when the upgrade is applied.

this feature is clearly missing,

does the 'moduleIsActive = false' works for all modules? if not wich ones?

Link to comment
Share on other sites

1 hour ago, Skalou said:

this feature is clearly missing,

does the 'moduleIsActive = false' works for all modules? if not wich ones?

Sadly no, the 'moduleIsEnabled' only works for some of the stock PartModules.  I do not have a complete list, but I know at least

  • ModuleGimbal
  • ModuleRCS and ModuleRCSFX
  • ModuleAblator
  • ModuleAlternator
  • ModuleDataTransmitter
  • ModuleGenerator
  • ModuleReactionWheel
  • ModuleResourceIntake
  • ModuleSAS
  • ModuleToggleCrossfeed


Notably missing from the list is 'ModuleEngines' and derivatives, 'MultiModeEngine', ModuleParachute, BaseConverter and derivatives, and many many others.

Even on the modules that support the feature, the transforms/etc for it must be in place or they will crash/NER; so you can't easily use them for dynamic/modular part setups without major plugin support.

Link to comment
Share on other sites

@Shadowmage,thank you for response,it was my original idea to add all the modules and enable them with upgrades,but i never found how to disable MODULE[ModuleScienceExperiment].
I was trying:

SetInoperable = true
//and
Inoperable = true

with no avail.
Do you know how this could be achieved?

Link to comment
Share on other sites

13 minutes ago, Skalou said:

thank you very much :), do you think it works with "moduleanimatedgeneric"?

No prob :)

Does not look like ModuleAnimateGeneric has any support for 'moduleIsEnabled'.  I've tried to do stuff like that with animations in the past and it has never ended well.

 

4 minutes ago, sebi.zzr said:

@Shadowmage,thank you for response,it was my original idea to add all the modules and enable them with upgrades,but i never found how to disable MODULE[ModuleScienceExperiment].
I was trying:


SetInoperable = true
//and
Inoperable = true

with no avail.
Do you know how this could be achieved?

Sorry, I'm not sure how to make it work for science experiements, they do not use the 'moduleIsEnabled' field as far as I can tell.

Link to comment
Share on other sites

I had to use some "tricks",but i finally made it.:0.0:

Spoiler

@PART[*]:HAS[@MODULE[ModuleCommand]]:Final
{
 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = deltemp
 experimentActionName = Temperature Data
 resetActionName = Delete temperature Data
 reviewActionName = Validate Temperature Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.5
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adtemperatureScan
  experimentID = temperatureScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = engineering101
  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delbaro
 experimentActionName = Pressure Data
 resetActionName = Delete Presure Data
 reviewActionName = Validate Presure Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.5
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorBarometer
  experimentID = barometerScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = survivability

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delsezmic
 experimentActionName = Seismic Data
 resetActionName = Delete Sesmic Data
 reviewActionName = Validate Sesmic Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.45
 dataIsCollectable = True
 collectActionName = Take Data
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorAccelerometer
  experimentID = seismicScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = electronics

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delgrav
 experimentActionName = Gravity Data
 resetActionName = Delete Gravity Data
 reviewActionName = Validate Gravity Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.4
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorGravimeter
  experimentID = gravityScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = advScienceTech

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delatmo
 experimentActionName = Atmosphere Analysis
 resetActionName = Discard Atmosphere Analysis Data
 reviewActionName = Review Atmosphere Analysis Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.6
 rerunnable = True
 usageReqMaskInternal = 1

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorAtmosphere
  experimentID = atmosphereAnalysis
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = scienceTech

  }
 }
 }
}

//--uprades techtree
PARTUPGRADE
{
 name = adtemperatureScan
 partIcon = sensorThermometer
 techRequired = engineering101
 entryCost = 2500
 title = pod Upgrade
 description = add termometer to pod
}
PARTUPGRADE
{
 name = adsensorBarometer
 partIcon = sensorBarometer
 techRequired = survivability
 entryCost = 2200
 title = pod Upgrade
 description = add barometer to pod
}
PARTUPGRADE
{
 name = adsensorAccelerometer
 partIcon = sensorAccelerometer
 techRequired = electronics
 entryCost = 8200
 title = pod Upgrade
 description = add accelerometer to pod
}
PARTUPGRADE
{
 name = adsensorGravimeter
 partIcon = sensorGravimeter
 techRequired = advScienceTech
 entryCost = 12200
 title = pod Upgrade
 description = add gravimeter to pod
}
PARTUPGRADE
{
 name = adsensorAtmosphere
 partIcon = sensorAtmosphere
 techRequired = scienceTech
 entryCost = 12200
 title = pod Upgrade
 description = add atmosensor to pod
}

//--experiment def.//fix NRE
EXPERIMENT_DEFINITION
{
 id = deltemp
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delbaro
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delsezmic
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delgrav
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delatmo
 baseValue = 0
 scienceCap = 0 

 

Link to comment
Share on other sites

  • 4 months later...
On 28.1.2017 at 0:15 PM, sebi.zzr said:

I had to use some "tricks",but i finally made it.:0.0:

  Hide contents

@PART[*]:HAS[@MODULE[ModuleCommand]]:Final
{
 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = deltemp
 experimentActionName = Temperature Data
 resetActionName = Delete temperature Data
 reviewActionName = Validate Temperature Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.5
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adtemperatureScan
  experimentID = temperatureScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = engineering101
  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delbaro
 experimentActionName = Pressure Data
 resetActionName = Delete Presure Data
 reviewActionName = Validate Presure Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.5
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorBarometer
  experimentID = barometerScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = survivability

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delsezmic
 experimentActionName = Seismic Data
 resetActionName = Delete Sesmic Data
 reviewActionName = Validate Sesmic Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.45
 dataIsCollectable = True
 collectActionName = Take Data
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorAccelerometer
  experimentID = seismicScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = electronics

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delgrav
 experimentActionName = Gravity Data
 resetActionName = Delete Gravity Data
 reviewActionName = Validate Gravity Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.4
 rerunnable = True
 usageReqMaskInternal = 1
 //usageReqMaskExternal = 8

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorGravimeter
  experimentID = gravityScan
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = advScienceTech

  }
 }
 }

 MODULE
 {
 name = ModuleScienceExperiment
 showUpgradesInModuleInfo = true
 experimentID = delatmo
 experimentActionName = Atmosphere Analysis
 resetActionName = Discard Atmosphere Analysis Data
 reviewActionName = Review Atmosphere Analysis Data
 useStaging = False
 useActionGroups = false
 hideUIwhenUnavailable = true
 xmitDataScalar = 0.6
 rerunnable = True
 usageReqMaskInternal = 1

 UPGRADES
 {
  UPGRADE
  {
  name__ = adsensorAtmosphere
  experimentID = atmosphereAnalysis
  useActionGroups = true
  hideUIwhenUnavailable = false
  techRequired__ = scienceTech

  }
 }
 }
}

//--uprades techtree
PARTUPGRADE
{
 name = adtemperatureScan
 partIcon = sensorThermometer
 techRequired = engineering101
 entryCost = 2500
 title = pod Upgrade
 description = add termometer to pod
}
PARTUPGRADE
{
 name = adsensorBarometer
 partIcon = sensorBarometer
 techRequired = survivability
 entryCost = 2200
 title = pod Upgrade
 description = add barometer to pod
}
PARTUPGRADE
{
 name = adsensorAccelerometer
 partIcon = sensorAccelerometer
 techRequired = electronics
 entryCost = 8200
 title = pod Upgrade
 description = add accelerometer to pod
}
PARTUPGRADE
{
 name = adsensorGravimeter
 partIcon = sensorGravimeter
 techRequired = advScienceTech
 entryCost = 12200
 title = pod Upgrade
 description = add gravimeter to pod
}
PARTUPGRADE
{
 name = adsensorAtmosphere
 partIcon = sensorAtmosphere
 techRequired = scienceTech
 entryCost = 12200
 title = pod Upgrade
 description = add atmosensor to pod
}

//--experiment def.//fix NRE
EXPERIMENT_DEFINITION
{
 id = deltemp
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delbaro
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delsezmic
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delgrav
 baseValue = 0
 scienceCap = 0 
}
EXPERIMENT_DEFINITION
{
 id = delatmo
 baseValue = 0
 scienceCap = 0 

 

I guess the button still showed up in the GUI, but the experiments just did not five any results?

Link to comment
Share on other sites

8 hours ago, KerbMav said:

I guess the button still showed up in the GUI, but the experiments just did not five any results?

You mean in the right click menu?
The button stays hidden and get visible after you have researched/buy the right node.

Link to comment
Share on other sites

4 minutes ago, sebi.zzr said:

You mean in the right click menu?
The button stays hidden and get visible after you have researched/buy the right node.

Oh, because the Definition has no situation-/biomeMask, therefor the experiment is unavailable all the time and the hideUIwhenUnavailable ... nifty!!

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