Factorio Prototype DocsVersion 1.1.107

NoiseFunctionRidge :: struct Example code

Similar to clamp, where the first argument is folded back across the third and second limits until it lies between them.

Properties

type :: "function-application"
function_name :: "ridge"
arguments :: {NoiseNumber, NoiseNumber, NoiseNumber}

The first argument is the number to be ridged, the second is the lower limit and the third is the upper limit.

The first argument is the number to be ridged, the second is the lower limit and the third is the upper limit.

Properties

type :: "function-application"

function_name :: "ridge"

arguments :: {NoiseNumber, NoiseNumber, NoiseNumber}

The first argument is the number to be ridged, the second is the lower limit and the third is the upper limit.

Example

local noise = require("noise")
local ridge_1 = noise.ridge(6, 1, 5) -- this returns 4
local ridge_2 = noise.ridge(-1, 1, 5) -- this returns 3

Prototypes

Types