Skip to content

[Logspam] Error messages in KSP.log when performing arithmetic on keys initialized to well-formed numbers #34

@Monniasza

Description

@Monniasza

Hi. When you run the Ultimate Part Converter, you'll get error messages like in the attached KSP.log.
Here's the excerpt that causes this issue, taken from https://github.com/Monniasza/SSTO-Project/blob/master/SSTOLPG/ConverterLPG.cfg:

//Data collection - tanks
@PART[*]:FOR[1LPG]{
	lpgLF = 0
	lpg = false
}
@PART[*]:HAS[@RESOURCE[LiquidFuel]]:FOR[1LPG]{
	@lpg = true
	%lpgTank = true
	@lpgLF += #$RESOURCE[LiquidFuel]/maxAmount$
}
@PART[*]:HAS[@RESOURCE[LiquidFuel],@RESOURCE[Oxidizer]]:FOR[1LPG]{
	@lpg = true
	%lpgRocket = true
	@lpgLF += #$RESOURCE[Oxidizer]/maxAmount$
}

Solution

To solve this, check if incoming values to arithmetic are string, if yes then convert them to numbers first.
It sems that calculations work fine, but errors are reported wrongly and don't contribute to error count on the loading screen.

Attachments

KSP.log

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions