-
Notifications
You must be signed in to change notification settings - Fork 31
API and Modules Documentation
Note: This document only applies to versions 0.6 and later.
Mods can define resources for the Kethane plugin to manage. Mods can use a selection of Kethane-defined part modules on custom parts, so every function of finding and extracting a custom resource can be accomplished without Kethane parts. Additionally, no modifications to the original Kethane package are necessary, and multiple mods can interact with Kethane simultaneously.
All use of Kethane is subject to the license.
Resources are exposed to Kethane with KethaneResource
config nodes. (Note: These do not replace the KSP RESOURCE_DEFINITION
nodes.) These nodes define the parameters for deposit generation and map configuration.
KethaneResource
nodes may be placed in any configuration file. Since any mod exposing a resource to Kethane is likely to be defining its own resource types, a good convention is to place KethaneResource
nodes in the KSP resource configuration files alongside RESOURCE_DEFINITION
nodes. However, any configuration file will work. The node for Kethane can be found here.
-
Resource
: This is the name of the resource for Kethane to generate. -
MinRadius
: Minimum radius of a deposit. For each deposit, the generator picks a random number between this and the maximum radius; that number becomes the radius of the farthest vertex from the center, so this is the "minimum maximum radius", not the radius of the minimum vertex. -
MaxRadius
: Maximum possible radius of a deposit. -
MinQuantity
: Minimum quantity of the resource a deposit begins with. The physical size of a deposit has no bearing on its starting quantity. -
MaxQuantity
: Maximum quantity of the resource. -
MinVertices
: Minimum number of vertices in a deposit's shape. Vertices are distributed uniformly in a circle around the center of the deposit. -
MaxVertices
: Maximum number of vertices. -
RadiusVariance
: Random multiplier for each vertex distance. Each deposit gets a radius (random number betweenMinRadius
andMaxRadius
) and then each vertex is placed at a distance of that radius multiplied by a random number between 1 andRadiusVariance
. In other words, this property determines how jagged a deposit will be. Numbers both higher and lower than 1 are acceptable. Negative numbers might break things. -
DepositCount
: Number of deposits the generator will attempt to place. -
NumberOfTries
: Number of times the generator will attempt to place each deposit. A deposit location and shape is randomly selected for each attempt, and an attempt is considered successful if no vertex is inside a deposit that's already been placed. If all tries are exhausted and a suitable location was not found, that deposit is skipped. You can set this to a low number to create some variance in the total number of deposits. -
SeedModifier
: Overrides the seed modifier for deposit generation. This is a legacy support feature that you shouldn't need to use in most cases; definitely remove theSeedModifier = 0
line if you copy and paste the Kethane configuration. By default, the seed used for generation is XOR'd with a hashcode of the resource name. This ensures different resources with the same parameters are still distributed differently and consistently. Kethane has an override of 0 to ensure compatibility with previous versions. You will only need to use this if you change the name of your resource and want to keep deposit locations, or if you want your deposits to line up with another resource. -
ColorFull
: Scan map coloring for a deposit with a quantity equal toMaxQuantity
. For deposits at some level in between, this is interpolated withColorEmpty
. -
ColorEmpty
: Scan map coloring for a deposit with a quantity equal toMinQuantity
.