Skip to content
This repository has been archived by the owner on Oct 26, 2020. It is now read-only.

Attempting to use KCT_Preset_Part_Variables #163

Open
ppboyle opened this issue Jul 11, 2017 · 5 comments
Open

Attempting to use KCT_Preset_Part_Variables #163

ppboyle opened this issue Jul 11, 2017 · 5 comments

Comments

@ppboyle
Copy link

ppboyle commented Jul 11, 2017

I have an avionics unit that has the tag ModuleTagAvionics, and my KCT presets file is as follows..

KCT_Preset
{
name = KCT Settings for RP-0
shortName = RP0
description = The recommended config for using KCT with RP-0
author = RP-0 Devs
allowDeletion = False
career = True
science = True
sandbox = True
KCT_Preset_General
{
Enabled = True
BuildTimes = True
ReconditioningTimes = True
TechUnlockTimes = True
KSCUpgradeTimes = True
Simulations = True
SimulationCosts = True
RequireVisitsForSimulations = True
TechUpgrades = True
StartingPoints = 15,50,5000
SharedUpgradePool = True
}
KCT_Preset_Time
{
OverallMultiplier = 25
BuildEffect = 1
InventoryEffect = 100
ReconditioningEffect = 576
MaxReconditioning = 13500000
RolloutReconSplit = 0.5
}
KCT_Preset_Formula
{
UpgradeFundsFormula = 10000
NodeFormula = (((5+((min([N],30)*min([N],30)*0.025))+(min([N],30)0.025)+(max(0,([N]-30))1.5)) / 86400 / 365) * sign(-[I]) * (1+([R] * 0.25))) // 5 science/year, + 0.05 to 1.5 sci per upgrade (levels at 30), only one rate, and 1/1.25/1.5x etc from R&D upgrades.
EffectivePartFormula = min([C]/([I] + ([B]
(max([U]0.125,1)+1))), [C])
ProceduralPartFormula = (([C]-[A]) + ([A]10/max([I],1))) / max([B](max([U]0.125,1)+1),1)
BPFormula = (10000 + ([E]60))[O]
KSCUpgradeFormula = ([C]^(3/4))200[O]
ReconditioningFormula = (min(7200+((([M]
[O]
[E]
[C]0.001)^(1/2))60), [X])abs([RE]-[S]))([L]+4)([L]+4)/25
BuildRateFormula = (1+([L]0.25))(([I]+1)0.05[N] + max(0.1-[I], 0))sign([L]-[I])
SimCostFormula = max([C]/50 * ([PM]/[KM]) * ([S]/10 + 1) * ([A] + 1) * ([L]^0.5), 100)
KerbinSimCostFormula = max([C]/500 * ([L]^0.5), 5) // at ^.5, 15min = 30x
InventorySaleFormula = 0
ResearchFormula = -1
UpgradeResetFormula = -1
UpgradeScienceFormula = -1
NewLaunchPadCostFormula = 25000
(0.75 + ([N]^1.25)
.25)
}
KCT_Preset_Part_Variables
{
Module_Variables
{
ModuleTagAvionics = 10000000000
}
}

}

However, nothing changed about my avionics unit's BP cost. Is there a variable I'm missing here? I don't see any documented variables in the wiki for adding the Preset part variables multiplier to the effectivepartformula

@magico13
Copy link
Owner

magico13 commented Jul 11, 2017

In the future you'll want to drop that in a code block, otherwise stuff will get lost, like so

code

(use 4 backticks, this character `, before and after the code )

It's not doing anything because you aren't using the ModuleVariable anywhere in the formula. The Module Variable uses the "MV" variable and you can insert it wherever you want. Test it by altering the EffectivePartFormula so that it's multiplying by [MV]. I still need to edit the wiki to include some updated information.

@ppboyle
Copy link
Author

ppboyle commented Jul 11, 2017

Gotcha, will do. Thanks, I've not used github much. And ok, will try that out, thanks

@NathanKell
Copy link
Contributor

@magico13 one other issue we've run into. Is there any way at all to have runtime variation in module (or part) variables? That is, we have an RCS part that, when configured for something like cold-gas Nitrogen or HTP should not have the 'toxic' tag, but when configured for NTO/UDMH, it should. Or, for example, a proc tank can be set to type 'normal' or type 'balloon' and it should only have the balloon tag in the later case, and the toxic tag depending on what resources are in it.

(I've set up a system of partmodules that act as tags, to get around MM not working on the KCT presets--we set modulevariables based on the tags, and then MM-apply the tag modules to parts en masse. But that still doesn't support doing anything ingame.)

Does KCT look at the actual part, or the part prefab, when checking what modulevariables are present? If necessary I could add and remove tag modules on the fly in the VAB/SPH using a master tagger module....

@magico13
Copy link
Owner

magico13 commented Jul 20, 2017

Right now, no there's nothing runtime. The way they're implemented right now is kind of quick and dirty. It's using the modules on the actual part, not just the prefab, but it's entirely based on name for the module/part. I could maybe implement something like ScrapYard's module templates, but I wonder if there's a simpler way of handling this where you all can set whatever you want. Something like a module on the part where you can set values and KCT just reads those values off. Then people could use MM to handle everything (or if they have a plugin just handle it with that) and it wouldn't have to be part of the Presets.

I could just make a module that looks something like this and just read off the appropriate value. And KCT wouldn't care how/when it gets set.

MODULE
{
  name = ModuleKCTModifier
  buildModifier = 1.0
  rolloutModifier = 2.5
}

@NathanKell
Copy link
Contributor

Yes that would be ideal!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants