Closed VexyCats closed 2 years ago
@Lisias any help would be greatly appreciated.
Also it takes me 30 mins to load the game, so for simple changes in syntax .cfg files its superrrrrrrrrr painful. Even alt-f11 takes 20 minutes. Any suggestion to test live changes for reward values without the long waiting times for loading many mods?
Hi, @VexyCats . Module Manager doesn't really do any math, other than basic operations (and in a somewhat convoluted way).
What's happening is that DBD is setting a value called Kerbucks with the String "((( HomeWorld().Radius() / 1000 ) * 10) * 100)"
. DBD then reads this string and interprets it internally somehow, neither KSP neither ModuleManager knows squat about what really means "((( HomeWorld().Radius() / 1000 ) * 10) * 100)"
.
So, if you try to tell ModuleManager to use the value Kerbucks
on some math operation, it will bork because for all effects, the value of Kerbucks
is a mere string.
There's no way to use the Kerbucks evaluated value at all, this value is calculated by DBD at runtime only - way after the patching phase.
((( HomeWorld().Radius() / 1000 ) * 10) * 100)"
This is simply kerbucks = (600km (kerbin radius)) /100 *100
So the code:
@CONTRACT_TYPE[*]:HAS[#Kerbucks[*]]:FINAL
%addedCost = 100
@addedCost *= #$Kerbucks$
@rewardFunds= #$addedCost$
Would find all contract types with any kerbucks* wildcard (ie: kerbucks5, kerbucks75) and then I can use that to multiply by 100?
Is this right?
Otherwise I'll just have to go replace all kerbucks = ""
with a numerical value but thats a pain....
@VexyCats
This is simply kerbucks = (600km (kerbin radius)) /100 *100
Nope. This is valid only for Stock - different planet packs will have different values for HomeWorld().Radius()
and this is the reason the Contract Configurator maintainer choose to do things this way!
Would find all contract types with any kerbucks* wildcard (ie: kerbucks5, kerbucks75) and then I can use that to multiply by 100?
No, because you are still trying to multiply a number to a String!
Otherwise I'll just have to go replace all
kerbucks = ""
with a numerical value but thats a pain....
Or you can make the Contract Configurator to work for you! By reading the Contract Configurator manual you will find that it understands these expressions on many values, so perhaps you can just write:
@rewardFunds= 100 * ( #$Kerbucks$ )
This will make rewardFunds to 100 * ( ((( HomeWorld().Radius() / 1000 ) * 10) * 100) )
and at runtime CC will compute the right value for you!
@VexyCats it worked? Can I close this issue?
Closing this as I assumed the problem was solved.
I get this error
[ERR 21:21:40.782] Error - Failed to do a maths replacement: @CONTRACT_TYPE[*]:HAS[#rewardFunds&#advanceFunds]:FINAL : original value="50" operator=Multiply mod value="Random(@BluedogDB:Kerbucks05,@BluedogDB:Kerbucks075)
It seems to be a typing issue, where "50" is either a string or double, yet "Random()" is..... i dont know what? A function that returns a int or a string?
The code for BludDogDB:Kerbucks is here:
So my question is, why does my code here, fail to work to multiply whatever value the kerbucks is set to, by 100?
Note I have multiple statements for multiple mods and structures. But ultimately the main errors are:
and this for non-kerbucks
Any help on why this is? Been working on it for a week now and I'm stuck.