Factorio Prototype DocsVersion 1.1.107

NoiseFunctionCompileTimeLog :: struct Example code

Prints between 0 and 32 arguments to the log file when the expression is compiled. For that it needs to part of another expression that is compiled. The last argument of the compile-time-log is returned as the "result" of the compile-time-log.

Properties

type :: "function-application"
function_name :: "compile-time-log"
arguments :: array[NoiseExpression]

Properties

type :: "function-application"

function_name :: "compile-time-log"

arguments :: array[NoiseExpression]

Example

-- Example usage inside a NamedNoiseExpression
local noise = require("noise")
local tne = noise.to_noise_expression

data:extend{{
  type = "noise-expression",
  name = "compile-log-test",
  intended_property = "elevation",
  expression = noise.compile_time_log(2000, noise.var("y"), tne(100) - noise.var("distance"))
}}

-- When "compile-log-test" is selected as the map type and a map preview or map is generated, this logs:
--  Info data-updates.lua:24: 2000.000000 reference to variable 'y' subtract
-- Furthermore, the elevation noise expression is set to 'tne(100) - noise.var("distance")', producing a circular island with a 100 tile radius

Prototypes

Types