Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: nuFF3 on January 16, 2021, 02:33:30 PM

Title: Log10 and Logarithm actions
Post by: nuFF3 on January 16, 2021, 02:33:30 PM
I couldn't find any logarithm actions anywhere, so I decided to make them myself.
I really can't believe no one has made something like this before, since it's pretty vital for setting AudioMixer volumes more correctly, but it also has it's other uses too.
For setting volume one can use the "Convert Float To Decibels" but that's a very specific action for one thing. These actions at least have the possibility of being used for other stuff too.

I've made two actions and edited another from the Ecosystem.
The two that I made are the Float Log10 and Float Logarithm actions.
I edited the Float Operator Advanced to include logarithm operations along with what it already had.

Float Log10 takes one float variable, operates Mathf.Log10, and stores the result in a separate variable.
Float Logarithm does pretty much the same, but it takes both a variable for the Mathf.Log and a variable for base for the logarithm. It too stores the result in a separate variable.

Float Operator Advanced 2 is pretty much unaltered apart from the code that was needed for the logarithm to work.

Hope it helps.
Title: Re: Log10 and Logarithm actions
Post by: Ravencroft on December 01, 2021, 07:35:36 AM
I want to thank you for these. They have been of great use.

You wouldn't have any specific recommendations for default settings for a mixer slider would you such as min/max of slider and value for the log?