Looking for Code to resolve noise expressions

Tools which are useful for mod development.
Natha
Fast Inserter
Fast Inserter
Posts: 239
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Looking for Code to resolve noise expressions

Post 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.
Xorimuth
Filter Inserter
Filter Inserter
Posts: 719
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Looking for Code to resolve noise expressions

Post 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.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Post Reply

Return to “Development tools”