<Thomas>
Problem exists between keyboard and chair
<SigmaUK>
Yeah I sae
<SigmaUK>
Saw
<SigmaUK>
Interestinf
<SigmaUK>
Interesting
GregroxMun has joined #Kopernicus
<GregroxMun>
o/
Rokker has quit [Quit: Connection closed for inactivity]
egg|zzz|egg is now known as egg
Rokker has joined #Kopernicus
<Qboid>
4d 0h 0m 0s left to event #1: Falcon 9 • SpaceX CRS 12 [at 2017-08-17 16:31:00]. Say '!kountdown 1' for details
TheWhiteGuardian has joined #Kopernicus
<TheWhiteGuardian>
Good morning / evening / afternoon!
<TheWhiteGuardian>
Is anyone here by chance?
<GregroxMun>
yes
<TheWhiteGuardian>
Good afternoon Gregrox!
<TheWhiteGuardian>
I'm working on my part of the collab, but I'm making some custom PQSMods to make procedural terrain generation (rivers for example) a bit easier.
<GregroxMun>
very well
<TheWhiteGuardian>
Problem is, I think LibNoise changed massively, and thus the way a lot of things work on the C# coding side seem to have changed.
<TheWhiteGuardian>
For example, remember how mods like VertexHeightNoise have a 'mode' value, that can be either 'Low', 'High', or 'Medium'(1.2)/'Standard'(1.3)?
<TheWhiteGuardian>
It used to be called 'QualityMode', but now it's called 'NoiseQuality'.
<TheWhiteGuardian>
And I believe I could parse it with the Kopernicus ModLoader through the standard 'NumericParser', that deals with numbers
<TheWhiteGuardian>
Nowadays the method seems slightly more complex.
egg is now known as egg|nomz|egg
<TheWhiteGuardian>
I was hoping to find Thomas here, so that maybe he could shed some light on what has changed since 1.2
<Thomas>
TheWhiteGuardian: NoiseQuality is an enum, so you should use enum parser
<TheWhiteGuardian>
I currently have... let's see...
<TheWhiteGuardian>
public EnumParser<KopernicusNoiseQuality> mode
<TheWhiteGuardian>
Followed by the get accessor:
<TheWhiteGuardian>
get { return (KopernicusNoiseQuality)(int)mod.mode; }
<TheWhiteGuardian>
And set:
<TheWhiteGuardian>
set { mod.mode = (NoiseQuality)(int)value.value; }
<TheWhiteGuardian>
With how NoiseQuality is now a thing I looked up how it is parsed in VertexHeightNoise, and by lack of ideas entered the code to see how it would do.
szyzyg has joined #Kopernicus
<GregroxMun>
o/
<TheWhiteGuardian>
o/
szyzyg has quit [Ping timeout: 186 seconds]
szyzyg has joined #Kopernicus
<Thomas>
TheWhiteGuardian: KopernicusNoiseQuality is a workaround that merges QualityMode and NoiseQuality
<Thomas>
So "Medium" and "Standard" work both
<TheWhiteGuardian>
Ooooh, I see
<TheWhiteGuardian>
So that tackles the problem of having to update all planet packs using 'Medium'. Nifty!
<TheWhiteGuardian>
The thing I don't get though
<TheWhiteGuardian>
Why does it say (NoiseQuality)(int)value.value?
<TheWhiteGuardian>
Why is an integer involved in parsing an enum?
<Thomas>
An enum is just list of words aliased to integers
<Thomas>
In our case, Medium and Standard both have the int value 1
<Thomas>
So, it doesn't matter if you use Medium or Standard, you will end up with 1 in both cases
<Thomas>
which translated to NoiseQuality.Standard
<Thomas>
*translates
<TheWhiteGuardian>
Interesting!
<TheWhiteGuardian>
I have pasted the problematic PQSMod over at PasteBin if anyone wants to have a look.
<Thomas>
Yeah, you should just use an enum parser there
<Thomas>
Also, cache the noise object
<TheWhiteGuardian>
Cache the noise object?
<Thomas>
Currently you create a new Object in OnVertexBuildHeight()
<TheWhiteGuardian>
You mean move initializing the noises to the OnSetup() void?
<Thomas>
Yes
<TheWhiteGuardian>
Alright. Gonna do that right away.
<TheWhiteGuardian>
What do you mean by 'use an enum parser there' though?
<TheWhiteGuardian>
I thought I used an enum parser for both enumerators?
<Thomas>
Well, you could just make modMode a variable with the type NoiseMod, and use an EnumParser<PQSMod_VertexExtraNoise.NoiseMode> for parsing, instead of parsing an int and doing an if check for the type
<TheWhiteGuardian>
What I'm actually doing there is allowing for the enum value to be altered through the integer from inside KSP, as Kittopia cannot edit enums yet AFAIK
<Thomas>
Then do the conversion in the parser, so the user can still use the actual names?
szyzyg has quit [Quit: Leaving.]
<TheWhiteGuardian>
Conversion in the parser?
<Thomas>
Either through ifs, or casting and assigning fixed numbers to the enum
<TheWhiteGuardian>
So basically moving the if-statements from 'PQSMod_VertexExtraNoise : PQSMod' to 'VertexExtraNoise : ModLoader<PQSMod_VertexExtraNoise>'?
<TheWhiteGuardian>
What I've currently done is move the if-statements to the set-assigner of the [ParserTarget("noiseType")]
<Thomas>
Oh, you already have a noise type parser but you dont use it :D
<TheWhiteGuardian_>
Problem here is that it's my first time working with LandClasses.
<TheWhiteGuardian_>
So I'm not 100% sure about what I'm doing.
<TheWhiteGuardian_>
The main goal of this particuar mod is HeightColorMap merged with VertexSimplexNoiseColor, and instead of using decimal values, the start and end altitudes are in meters.
egg|nomz|egg is now known as egg
<TheWhiteGuardian_>
Speaking of that 'landclass PQSMod', PQSMod_HeightColorAbsolute, take a shot whenever it reads 'lerp'. :P
ferram4 has joined #Kopernicus
TheWhiteGuardian has joined #Kopernicus
TheWhiteGuardian_ has quit [Ping timeout: 180 seconds]