Avorion Script API Documentation

PlanGenerationStage

This is a single generation stage of a PlanStyle.
Volume weight: A stage has a certain volume weight, which is based on the total volume available for the generation of the plan.
Repeating: A stage can define repetition counters (decided randomly for each part: from, to), which is, say, X. Parts with VisualFeature.Repeating enabled will then have a higher chance (repetitionFavorChance) of being chosen over other parts and placed X times in a row, if possible.
Upscaling: A stage can decide to scale parts up instead of placing many parts.

function PlanGenerationStage()

Returns

A new instance of PlanGenerationStage

property int... additionalFeatures
Features that are optionally enabled by this stage, if possible
property var allrounderBlockIndex
Block type that is used for allrounder blocks
property string arrangementSeed
property float fixedParts
Amount of parts that are always fixed, based on a seed
property string fixedPartSeed
property int... forbiddenFeatures
Features forbidden by this stage
property bool ignoreSelfSymmetry
Allow placed parts to ignore the self-symmetry rule, that they can only be placed on connectors where they would be mirrored onto themselves, when they have a symmetry feature
property int maxAmount
Maximum amount of parts to be used from this stage.
property int maxRepetitions
Maximum times a part can repeat. Default: 4
property int minAmount
Minimum amount of parts to be used from this stage. May lead to Volume limit bein exceeded, which may result in a scale-down of the finished plan.
property int minRepetitions
Minimum times a part can repeat. Default: 2
property float mirrorBreakChance
Chance per connector, that when this stage is started, its mirroring feature is removed. Default: 0
property int... onlyFeatures
Only features of this stage, overrides all other settings
property float repetitionFavorChance
Chance that when repeating, a part from an open repetition is chosen over another part. Default: 0.5
property int... requiredFeatures
Features required by this stage
property var settings
Settings table of the stage that is integrated into style settings and then passed to generated parts
property float subdivideChance
Chance that when this stage is started, a part's connectors are subdivided. Default: 0
property var upscaleThreshold
Amount of parts that would have to be placed before an upscale takes place. Default: nil
property int variations
Amount of different parts there should be in this stage. Default: 1
property float volumeWeight
weight of volume from the total volume pool that is available for this stage. Default: 1

function var setAttachmentWeights(table[dir -> value] weights)

Sets the weights for directions that should be used in this stage to attach new parts. When the weights in a certain direction are large, then the ship will be mostly developed in those direction during the stage.

Parameters

weights A table containing the weights that are to be used. Example: { px = 0.1, nx = 0.1, py = 1, ny = 1, pz = 0.1, nz = 0.1, }). Note: 0 is a valid option, values greater than 1 are, too, negative values aren't.

Returns

nothing

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7