Page 1 of 1

Looking for Code to resolve noise expressions

Posted: Wed Jan 29, 2025 11:20 am
by Natha
Hello @Devs:
could you share the code which you use to resolve noise expressions? Like that every named noise expression/function and their local expressions and functions are replaced by their actual expression, so that only built-in constants and functions remain.
I need this to replace all occurences of certain variables in an expression.

Re: Looking for Code to resolve noise expressions

Posted: Wed Jan 29, 2025 11:32 am
by Xorimuth
Natha wrote: Wed Jan 29, 2025 11:20 am Hello @Devs:
could you share the code which you use to resolve noise expressions? Like that every named noise expression/function and their local expressions and functions are replaced by their actual expression, so that only built-in constants and functions remain.
I need this to replace all occurences of certain variables in an expression.
This isn't directly answering your question but I wonder if you've seen the section of the docs on name collisions? https://lua-api.factorio.com/latest/aux ... collisions.

My understanding is that this allows you to overwrite things just by adding to `local_expressions` or `local_functions` on the NamedNoiseExpression/NamedNoiseFunction. You could even overwrite built-in constants/variables/functions.