implement compileIntoCurrentProcedure for if-else-chain expressions

Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

implement compileIntoCurrentProcedure for if-else-chain expressions

Post by Honktown »

I want to use variables in conditionals for noise expressions. More complex functions can be implemented without doing work-arounds on map-gen. I was looking into atan2: have all the math correct for an accurate approximation, but no conditionals are available.

"condition-expression" isn't a valid type of expression, and using if-else-chain returns true for values > 0, false for values < 0 (and probably 0), but only takes literal-number's. There's no means of providing ordinary conditions (<, >, etc) documented anywhere, and I tried a bunch of things and looked all over.

I have example code for it, if examples would like to be taken for no-error/error arguments.
I have mods! I guess!
Link

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: implement compileIntoCurrentProcedure for if-else-chain expressions

Post by Honktown »

Nevermind, I figured out something for conditionals.
I have mods! I guess!
Link

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: implement compileIntoCurrentProcedure for if-else-chain expressions

Post by Bilka »

I added this in 0.18.37.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”