Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# NoiseFunction - Prototype Docs

## NoiseFunction :: struct

The advantage of noise functions over noise expressions is that they have parameters.

## Properties

- default
- sorted

parameters | :: array[string] | The order of the parameters matters because functions can also be called with positional arguments. [...]
The order of the parameters matters because functions can also be called with positional arguments. [...]
expression | :: NoiseExpression |
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...]
A map of expression name to expression. [...]
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...]
A map of function name to function. [...]

expression | :: NoiseExpression |
parameters | :: array[string] | The order of the parameters matters because functions can also be called with positional arguments. [...]
The order of the parameters matters because functions can also be called with positional arguments. [...]
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...]
A map of expression name to expression. [...]
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...]
A map of function name to function. [...]

## Properties

### parameters :: array[string]

The order of the parameters matters because functions can also be called with positional arguments.

A function can't have more than 255 parameters.

### expression :: NoiseExpression

### local_expressions :: dictionary[string → NoiseExpression] optional

A map of expression name to expression.

Local expressions are meant to store data locally similar to local variables in Lua. Their purpose is to hold noise expressions used multiple times in the named noise expression, or just to tell the reader that the local expression has a specific purpose. Local expressions can access other local definitions and also function parameters, but recursive definitions aren't supported.

### local_functions :: dictionary[string → NoiseFunction] optional

A map of function name to function.

Local functions serve the same purpose as local expressions - they aren't visible outside of the specific prototype and they have access to other local definitions.

Type used in

- AutoplaceSpecification::local_functions
- NamedNoiseExpression::local_functions
- NamedNoiseFunction::local_functions
- NoiseFunction::local_functions