Factorio Prototype DocsVersion 1.1.100

NoiseArrayConstruction :: struct Example code

value_expressions property should be a list of numeric expressions, each of which will be evaluated to come up with the corresponding numeric value in the resulting array.

Used to construct map positions ({x, y}) and map position lists ({{x0,y0}, {y1,y1}, [...]}) for offset-points and distance-from-nearest-point functions.

Properties

type :: "array-construction"
value_expressions :: array[NoiseExpression]

Properties

type :: "array-construction"

value_expressions :: array[NoiseExpression]

Example

-- Examples of constructing a map position and map position list
local noise = require("noise")
local tne = noise.to_noise_expression

local map_pos_1 = -- the map position {x = 100, y = -200} specified directly
{
  type = "array-construction",
  value_expressions = {tne(100), tne(-200)}
}
-- or with make_array from the noise lib required above
local map_pos_2 = noise.make_array({100, 200})

local map_pos_list = -- a map position list: {{x = 100, y = -200}, {x = 100, y = 200}}
{
  type = "array-construction",
  value_expressions = {map_pos_1, map_pos_2}
}
-- or with the noise lib
local also_map_post_list = noise.make_point_list({{100, -200}, {100, 200}})

Prototypes

Types